~
This commit is contained in:
commit
82b11f5c96
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
**/layout
|
||||||
|
**/report
|
||||||
|
**/实施文件
|
||||||
|
**/image
|
||||||
|
**/doc
|
||||||
|
**/wav
|
||||||
|
**/__history
|
||||||
|
**/__recovery
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
*.ddp
|
||||||
|
*.dcu
|
||||||
|
*.~pas
|
||||||
|
*.~dfm
|
||||||
|
*.~ddp
|
||||||
|
*.~dpr
|
2
样品/DyeTwoStore.INI
Normal file
2
样品/DyeTwoStore.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[ム<>キア犲ナ]
|
||||||
|
ア犲ナタ獎ヘ=
|
42
样品/JWLCK.cfg
Normal file
42
样品/JWLCK.cfg
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
-$A8
|
||||||
|
-$B-
|
||||||
|
-$C+
|
||||||
|
-$D+
|
||||||
|
-$E-
|
||||||
|
-$F-
|
||||||
|
-$G+
|
||||||
|
-$H+
|
||||||
|
-$I+
|
||||||
|
-$J-
|
||||||
|
-$K-
|
||||||
|
-$L+
|
||||||
|
-$M-
|
||||||
|
-$N+
|
||||||
|
-$O+
|
||||||
|
-$P+
|
||||||
|
-$Q-
|
||||||
|
-$R-
|
||||||
|
-$S-
|
||||||
|
-$T-
|
||||||
|
-$U-
|
||||||
|
-$V+
|
||||||
|
-$W-
|
||||||
|
-$X+
|
||||||
|
-$YD
|
||||||
|
-$Z1
|
||||||
|
-cg
|
||||||
|
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
-H+
|
||||||
|
-W+
|
||||||
|
-M
|
||||||
|
-$M16384,1048576
|
||||||
|
-K$00400000
|
||||||
|
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-U"D:\말繫ERP"
|
||||||
|
-O"D:\말繫ERP"
|
||||||
|
-I"D:\말繫ERP"
|
||||||
|
-R"D:\말繫ERP"
|
||||||
|
-w-UNSAFE_TYPE
|
||||||
|
-w-UNSAFE_CODE
|
||||||
|
-w-UNSAFE_CAST
|
138
样品/JWLCK.dof
Normal file
138
样品/JWLCK.dof
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=D:\富通ERP
|
||||||
|
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;dclOffice2k;Rave50CLX;Rave50VCL
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=F:\selfware_83398\selfware\马国钢开发代码\项目代码\self\机物料仓库\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
||||||
|
[Excluded Packages]
|
||||||
|
c:\program files\borland\delphi7\Bin\DBWEBXPRT.BPL=Borland Web Wizard Package
|
BIN
样品/JWLCK.res
Normal file
BIN
样品/JWLCK.res
Normal file
Binary file not shown.
42
样品/OrderManage.cfg
Normal file
42
样品/OrderManage.cfg
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
-$A8
|
||||||
|
-$B-
|
||||||
|
-$C+
|
||||||
|
-$D+
|
||||||
|
-$E-
|
||||||
|
-$F-
|
||||||
|
-$G+
|
||||||
|
-$H+
|
||||||
|
-$I+
|
||||||
|
-$J-
|
||||||
|
-$K-
|
||||||
|
-$L+
|
||||||
|
-$M-
|
||||||
|
-$N+
|
||||||
|
-$O+
|
||||||
|
-$P+
|
||||||
|
-$Q-
|
||||||
|
-$R-
|
||||||
|
-$S-
|
||||||
|
-$T-
|
||||||
|
-$U-
|
||||||
|
-$V+
|
||||||
|
-$W-
|
||||||
|
-$X+
|
||||||
|
-$YD
|
||||||
|
-$Z1
|
||||||
|
-cg
|
||||||
|
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
-H+
|
||||||
|
-W+
|
||||||
|
-M
|
||||||
|
-$M16384,1048576
|
||||||
|
-K$00400000
|
||||||
|
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-U"D:\말繫ERP"
|
||||||
|
-O"D:\말繫ERP"
|
||||||
|
-I"D:\말繫ERP"
|
||||||
|
-R"D:\말繫ERP"
|
||||||
|
-w-UNSAFE_TYPE
|
||||||
|
-w-UNSAFE_CODE
|
||||||
|
-w-UNSAFE_CAST
|
138
样品/OrderManage.dof
Normal file
138
样品/OrderManage.dof
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=D:\富通ERP
|
||||||
|
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;dclOffice2k;Rave50CLX;Rave50VCL
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=F:\selfware_83398\selfware\马国钢开发代码\项目代码\self\订单\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
||||||
|
[Excluded Packages]
|
||||||
|
c:\program files\borland\delphi7\Bin\DBWEBXPRT.BPL=Borland Web Wizard Package
|
BIN
样品/OrderManage.res
Normal file
BIN
样品/OrderManage.res
Normal file
Binary file not shown.
23
样品/ProjectGroup1.bpg
Normal file
23
样品/ProjectGroup1.bpg
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
VERSION = BWS.01
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
!ifndef ROOT
|
||||||
|
ROOT = $(MAKEDIR)\..
|
||||||
|
!endif
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
|
||||||
|
DCC = $(ROOT)\bin\dcc32.exe $**
|
||||||
|
BRCC = $(ROOT)\bin\brcc32.exe $**
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
PROJECTS = testDll.exe ProductPrice.dll
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
default: $(PROJECTS)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
testDll.exe: testDll.dpr
|
||||||
|
$(DCC)
|
||||||
|
|
||||||
|
ProductPrice.dll: ProductPrice.dpr
|
||||||
|
$(DCC)
|
||||||
|
|
||||||
|
|
5
样品/SYSTEMSET.ini
Normal file
5
样品/SYSTEMSET.ini
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[SERVER]
|
||||||
|
服务器地址=101.132.143.144
|
||||||
|
服务器地址类型=542
|
||||||
|
是否自动更新=1
|
||||||
|
软件名称=惠峰纺织管理软件
|
362
样品/U_BaseIn.dfm
Normal file
362
样品/U_BaseIn.dfm
Normal file
|
@ -0,0 +1,362 @@
|
||||||
|
object frmBaseIn: TfrmBaseIn
|
||||||
|
Left = 58
|
||||||
|
Top = 224
|
||||||
|
Width = 1211
|
||||||
|
Height = 591
|
||||||
|
Caption = #20837#24211#32534#36753
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1203
|
||||||
|
Height = 20
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 18
|
||||||
|
ButtonWidth = 60
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Flat = True
|
||||||
|
List = True
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
Transparent = True
|
||||||
|
Wrapable = False
|
||||||
|
object BtnSave: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 5
|
||||||
|
OnClick = BtnSaveClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 40
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 23
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 80
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22797#21046#22686#34892
|
||||||
|
ImageIndex = 66
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 144
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #19968#38190#26367#25442
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 208
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 24
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object BtnExit: TToolButton
|
||||||
|
Left = 248
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 10
|
||||||
|
OnClick = BtnExitClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 8
|
||||||
|
Top = 32
|
||||||
|
Width = 1137
|
||||||
|
Height = 433
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'DefStr1'
|
||||||
|
Column = v1P_ChnName10
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'DefStr2'
|
||||||
|
Column = v1ShortName
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'RollUnit'
|
||||||
|
Column = v1UnitName
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'P_Code'
|
||||||
|
Column = v1P_ChnName
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Quantity
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20837#24211#26102#38388
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.Kind = ckDateTime
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 127
|
||||||
|
end
|
||||||
|
object v1defstr6: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #29677#27425
|
||||||
|
DataBinding.FieldName = 'defstr6'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1Column2PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1defstr7: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #29677#32452
|
||||||
|
DataBinding.FieldName = 'defstr7'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1defstr7PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1DepotClass: TcxGridDBColumn
|
||||||
|
Caption = #20837#24211#31867#22411
|
||||||
|
DataBinding.FieldName = 'DepotClass'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1DepotClassPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 87
|
||||||
|
end
|
||||||
|
object v1batchnum: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21367#21495
|
||||||
|
DataBinding.FieldName = 'batchnum'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object v1PlanNo: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #25209#21495
|
||||||
|
DataBinding.FieldName = 'PlanNo'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = False
|
||||||
|
Properties.OnButtonClick = v1PlanNoPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1P_ChnName: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'P_ChnName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1P_ChnNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 105
|
||||||
|
end
|
||||||
|
object v1P_ChnName10: TcxGridDBColumn
|
||||||
|
Caption = #22522#24067#21517#31216
|
||||||
|
DataBinding.FieldName = 'P_ChnName10'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1P_ChnName10PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 118
|
||||||
|
end
|
||||||
|
object v1ShortName: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'ShortName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1ShortNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 96
|
||||||
|
end
|
||||||
|
object v1DefStr3: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22522#24067#39068#33394
|
||||||
|
DataBinding.FieldName = 'DefStr3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1DefFlt1: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21402#24230
|
||||||
|
DataBinding.FieldName = 'DefFlt1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Quantity: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #20837#24211#25968#37327
|
||||||
|
DataBinding.FieldName = 'Quantity'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1UnitName: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'UnitName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1UnitNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 44
|
||||||
|
end
|
||||||
|
object v1DefStr4: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #31561#32423
|
||||||
|
DataBinding.FieldName = 'DefStr4'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1DefStr4PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Note: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'Note'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 108
|
||||||
|
end
|
||||||
|
object v1P_SeqNo: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #35745#21010#21333#24207#21495
|
||||||
|
DataBinding.FieldName = 'P_SeqNo'
|
||||||
|
Visible = False
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1P_Code: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #32534#21495
|
||||||
|
DataBinding.FieldName = 'P_Code'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
end
|
||||||
|
object v1DefStr1: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22522#24067#32534#21495
|
||||||
|
DataBinding.FieldName = 'DefStr1'
|
||||||
|
Visible = False
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1DefStr2: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #20379#24212#21830#32534#21495
|
||||||
|
DataBinding.FieldName = 'DefStr2'
|
||||||
|
Visible = False
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1RollUnit: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21333#20301#32534#21495
|
||||||
|
DataBinding.FieldName = 'RollUnit'
|
||||||
|
Visible = False
|
||||||
|
FooterAlignmentHorz = taCenter
|
||||||
|
Width = 52
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = CDS_Sub
|
||||||
|
Left = 216
|
||||||
|
Top = 144
|
||||||
|
end
|
||||||
|
object CDS_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 256
|
||||||
|
Top = 160
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Parameters = <>
|
||||||
|
Left = 184
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Parameters = <>
|
||||||
|
Left = 224
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Parameters = <>
|
||||||
|
Left = 264
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
end
|
585
样品/U_BaseIn.pas
Normal file
585
样品/U_BaseIn.pas
Normal file
|
@ -0,0 +1,585 @@
|
||||||
|
unit U_BaseIn;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics,
|
||||||
|
cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||||
|
cxClasses, cxControls, cxGridCustomView, cxGrid, ADODB, DBClient,
|
||||||
|
cxButtonEdit, cxDropDownEdit, cxCalendar;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmBaseIn = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
BtnSave: TToolButton;
|
||||||
|
BtnExit: TToolButton;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
v1PlanNo: TcxGridDBColumn;
|
||||||
|
v1P_ChnName: TcxGridDBColumn;
|
||||||
|
v1P_ChnName10: TcxGridDBColumn;
|
||||||
|
v1ShortName: TcxGridDBColumn;
|
||||||
|
v1DefStr3: TcxGridDBColumn;
|
||||||
|
v1DefFlt1: TcxGridDBColumn;
|
||||||
|
v1DefStr4: TcxGridDBColumn;
|
||||||
|
v1Note: TcxGridDBColumn;
|
||||||
|
v1Quantity: TcxGridDBColumn;
|
||||||
|
v1UnitName: TcxGridDBColumn;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
CDS_Sub: TClientDataSet;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1DefStr2: TcxGridDBColumn;
|
||||||
|
v1DefStr1: TcxGridDBColumn;
|
||||||
|
v1P_Code: TcxGridDBColumn;
|
||||||
|
v1RollUnit: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
v1P_SeqNo: TcxGridDBColumn;
|
||||||
|
v1batchnum: TcxGridDBColumn;
|
||||||
|
v1DepotClass: TcxGridDBColumn;
|
||||||
|
v1defstr6: TcxGridDBColumn;
|
||||||
|
v1defstr7: TcxGridDBColumn;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure BtnExitClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure v1P_ChnNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1P_ChnName10PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1ShortNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1UnitNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1DefStr4PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PlanNoPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure BtnSaveClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure v1DepotClassPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1Column2PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1defstr7PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
DepotNo:string;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmBaseIn: TfrmBaseIn;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.BtnExitClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmBaseIn.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec P_Get_ClothInOutList :begdate,:enddate,:DepotNo,:DepotCode,:PState,:CRK');
|
||||||
|
Parameters.ParamByName('DepotNo').Value:=Trim(DepotNo);
|
||||||
|
Parameters.ParamByName('PState').Value:=2;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
CreateCDS20(ADOQueryMain,CDS_Sub);
|
||||||
|
InitCDSData20(ADOQueryMain,CDS_Sub);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
CDS_Sub.FieldByName('UnitName').Value:='米';
|
||||||
|
CDS_Sub.FieldByName('RollUnit').Value:='JL004';
|
||||||
|
CDS_Sub.FieldByName('DefStr4').Value:='一等';
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
CDS_Sub.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.ToolButton4Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CopyAddRow(tv1,CDS_Sub);
|
||||||
|
///CDS_Sub.FieldByName('DepotNo').Value:='';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
OneKeyPost(Tv1,CDS_Sub);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmBaseIn.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
MaxNo,strSQL:string;
|
||||||
|
KID,i,SubId,j:Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
CDS_Sub.First;
|
||||||
|
for i:=0 to CDS_Sub.RecordCount-1 do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
MaxNo:=Trim(CDS_Sub.fieldbyname('DepotNo').AsString);
|
||||||
|
KID:=CDS_Sub.fieldbyname('KcID').AsInteger;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if GetMaxNo20(ADOQueryCmd,MaxNo,'WC_ClothInout','BR',1,4)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('UPDATE WC_ClothKcid SET KcID = KcID+1');
|
||||||
|
SQL.Add('SELECT KcID FROM WC_ClothKcid');
|
||||||
|
Open;
|
||||||
|
KID:=fieldbyname('KcID').AsInteger;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//保存主表
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from WC_ClothInout where DepotNO='''+Trim(DepotNo)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)<>'' then
|
||||||
|
Edit
|
||||||
|
else
|
||||||
|
Append;
|
||||||
|
FieldByName('DepotNo').Value:=Trim(MaxNo);
|
||||||
|
FieldByName('DepotCode').Value:=Trim(gDef1);
|
||||||
|
FieldByName('DepotType').Value:=1;
|
||||||
|
FieldByName('Filler').Value:=Trim(gUserName);
|
||||||
|
FieldByName('FillTime').Value:=Trim(CDS_Sub.fieldbyname('FillTime').AsString);
|
||||||
|
FieldByName('DepotClass').Value:=Trim(CDS_Sub.fieldbyname('DepotClass').AsString);
|
||||||
|
FieldByName('Status').Value:='I9';
|
||||||
|
FieldByName('DepotNo').Value:=Trim(MaxNo);
|
||||||
|
//SSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_Sub,'WC_ClothInout',1);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//保存从表
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from WC_ClothInOut_Info where DepotNO='''+Trim(DepotNo)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)<>'' then
|
||||||
|
Edit
|
||||||
|
else
|
||||||
|
Append;
|
||||||
|
FieldByName('DepotNo').Value:=Trim(MaxNo);
|
||||||
|
FieldByName('KCID').Value:=KID;
|
||||||
|
FieldByName('ID').Value:=1;
|
||||||
|
{if Trim(gdatabase)<>'期初' then
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)='' then
|
||||||
|
begin
|
||||||
|
FieldByName('DefFlt2').Value:=SubId;
|
||||||
|
FieldByName('DefFlt3').Value:=((SubId-1) div 10);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end; }
|
||||||
|
|
||||||
|
SSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_Sub,'WC_ClothInOut_Info',2);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select DepotNo,DefFlt2,DefFlt3 from WC_ClothInout_Info where DepotNo like ''BR%'' ');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('PlanNo').AsString)<>'' then
|
||||||
|
SQL.Add(' and PlanNo='''+CDS_Sub.fieldbyname('PlanNo').AsString+'''');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('P_Code').AsString)<>'' then
|
||||||
|
SQL.Add(' and P_Code='''+CDS_Sub.fieldbyname('P_Code').AsString+'''');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DefStr1').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr1='''+CDS_Sub.fieldbyname('DefStr1').AsString+'''');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DefStr2').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr2='''+CDS_Sub.fieldbyname('DefStr2').AsString+'''');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DefStr3').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr3='''+CDS_Sub.fieldbyname('DefStr3').AsString+'''');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DefStr4').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr4='''+CDS_Sub.fieldbyname('DefStr4').AsString+'''');
|
||||||
|
if Trim(CDS_Sub.fieldbyname('Defflt1').AsString)<>'' then
|
||||||
|
SQL.Add(' and Defflt1='''+CDS_Sub.fieldbyname('Defflt1').AsString+'''');
|
||||||
|
Open;
|
||||||
|
{ if ADOQueryTemp.fieldbyname('aa').AsInteger>0 then
|
||||||
|
SubId:=ADOQueryTemp.fieldbyname('aa').AsInteger
|
||||||
|
else}
|
||||||
|
//SubId:=ADOQueryTemp.fieldbyname('aa').AsInteger+1;
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
j:=1;
|
||||||
|
while not eof do
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Update WC_ClothInout_Info Set defflt2='+inttostr(j));
|
||||||
|
sql.Add(',defflt3='+inttostr((j-1) div 10) );
|
||||||
|
sql.Add(' where DepotNo='''+Trim(ADOQueryTemp.fieldbyname('DepotNo').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
j:=j+1;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//保存到库存表
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)='' then
|
||||||
|
begin
|
||||||
|
strSQL := 'INSERT WC_ClothClothing ('
|
||||||
|
+ 'KcID,'
|
||||||
|
+ 'batchnum,'
|
||||||
|
+ 'P_Code,'
|
||||||
|
+ 'P_ChnName,'
|
||||||
|
+ 'Quantity,'
|
||||||
|
+ 'RollUnit,'
|
||||||
|
+ 'DepotNo'
|
||||||
|
+ ') VALUES ('
|
||||||
|
+ IntToStr(KID) + ','
|
||||||
|
+ QuotedStr(Trim(CDS_Sub.fieldbyname('batchnum').AsString)) + ','
|
||||||
|
+ QuotedStr(Trim(CDS_Sub.fieldbyname('P_Code').AsString)) + ','
|
||||||
|
+ QuotedStr(Trim(CDS_Sub.fieldbyname('P_ChnName').AsString)) + ','
|
||||||
|
+ CDS_Sub.fieldbyname('Quantity').AsString + ','
|
||||||
|
+ QuotedStr(Trim(CDS_Sub.fieldbyname('RollUnit').AsString)) + ','
|
||||||
|
+ QuotedStr(MaxNo)
|
||||||
|
+ ')';
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
//更新到库存表
|
||||||
|
strSQL := 'UPDATE WC_ClothClothing SET '
|
||||||
|
+ 'batchnum = ' + QuotedStr(Trim(CDS_Sub.fieldbyname('batchnum').AsString)) + ','
|
||||||
|
+ 'P_Code = ' + QuotedStr(Trim(CDS_Sub.fieldbyname('P_Code').AsString)) + ','
|
||||||
|
+ 'P_ChnName = ' + QuotedStr(Trim(CDS_Sub.fieldbyname('P_ChnName').AsString)) + ','
|
||||||
|
+ 'Quantity = ' + CDS_Sub.fieldbyname('Quantity').AsString+ ','
|
||||||
|
+ 'RollUnit = ' + QuotedStr(Trim(CDS_Sub.fieldbyname('RollUnit').AsString)) + ' '
|
||||||
|
+ 'WHERE KcID = ' + IntToStr(KID);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add(strSQL);
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
//更新卷号
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Update WC_ClothInout_Info set batchnum='''+Trim(CDS_Sub.fieldbyname('batchnum').AsString)+'''');
|
||||||
|
sql.Add(' where KCID='+IntToStr(KID));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Next;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
DepotNo:=MaxNo;
|
||||||
|
ModalResult:=1;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1P_ChnNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductHelp:=TfrmProductHelp.Create(Application);
|
||||||
|
with frmProductHelp do
|
||||||
|
begin
|
||||||
|
fDipFlag:=3;
|
||||||
|
cxTabControl1.Tabs[0].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[1].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[2].Visible:=False;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('P_Code').Value:=ADOQueryHelp.fieldbyname('P_Code').AsString;
|
||||||
|
CDS_Sub.FieldByName('P_ChnName').Value:=ADOQueryHelp.fieldbyname('P_ChnName').AsString;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1P_ChnName10PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductHelp:=TfrmProductHelp.Create(Application);
|
||||||
|
with frmProductHelp do
|
||||||
|
begin
|
||||||
|
fDipFlag:=2;
|
||||||
|
cxTabControl1.Tabs[0].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[1].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[3].Visible:=False;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('DefStr1').Value:=ADOQueryHelp.fieldbyname('P_Code').AsString;
|
||||||
|
CDS_Sub.FieldByName('P_ChnName10').Value:=ADOQueryHelp.fieldbyname('P_ChnName').AsString;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1ShortNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmSupplyHelp:=TfrmSupplyHelp.Create(Application);
|
||||||
|
with frmSupplyHelp do
|
||||||
|
begin
|
||||||
|
FLType:='坯布';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
self.CDS_Sub.FieldByName('ShortName').Value:=Trim(ADOQueryHelp.fieldbyname('ShortName').AsString);
|
||||||
|
self.CDS_Sub.FieldByName('DefStr2').Value:=Trim(ADOQueryHelp.fieldbyname('CustomNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmSupplyHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1UnitNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
kf_frmJlUnitHelp:=Tkf_frmJlUnitHelp.Create(Application);
|
||||||
|
with kf_frmJlUnitHelp do
|
||||||
|
begin
|
||||||
|
Fflag:='length';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('UnitName').Value:=Trim(ADOQueryHelp.fieldbyname('名称').AsString);
|
||||||
|
Self.CDS_Sub.FieldByName('RollUnit').Value:=Trim(ADOQueryHelp.fieldbyname('编号').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
kf_frmJlUnitHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1DefStr4PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmItemManageNew:=TfrmItemManageNew.Create(Application);
|
||||||
|
with frmItemManageNew do
|
||||||
|
begin
|
||||||
|
flag:='DefStr4';
|
||||||
|
flagname:='贝斯等级';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('DefStr4').Value:=Trim(ClientDataSet1.fieldbyname('name').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmItemManageNew.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1PlanNoPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmGetPlanListHelp:=TfrmGetPlanListHelp.Create(Application);
|
||||||
|
with frmGetPlanListHelp do
|
||||||
|
begin
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('PlanNo').Value:=Trim(ADOQueryHelp.fieldbyname('PlanNo').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_SeqNo').Value:=Trim(ADOQueryHelp.fieldbyname('P_SeqNo').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr1').Value:=Trim(ADOQueryHelp.fieldbyname('P_BaseCode').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_ChnName10').Value:=Trim(ADOQueryHelp.fieldbyname('P_BaseChnName').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr2').Value:=Trim(ADOQueryHelp.fieldbyname('P_Factory').AsString);
|
||||||
|
CDS_Sub.FieldByName('Shortname').Value:=Trim(ADOQueryHelp.fieldbyname('SupplierName').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr3').Value:=Trim(ADOQueryHelp.fieldbyname('SBtr2').AsString);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Select P_Code from MC_CatLog where P_ChnName='''+Trim(ADOQueryHelp.fieldbyname('LbStr6').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName('P_Code').Value:=Trim(ADOQueryTemp.fieldbyname('P_Code').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_ChnName').Value:=Trim(ADOQueryHelp.fieldbyname('LbStr6').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmGetPlanListHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.BtnSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.Locate('FillTime',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('入库时间不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('PlanNo',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('批号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('P_ChnName',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('品名不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('DepotClass',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('入库类型不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('Quantity',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('数量不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1DepotClassPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmItemManageNew:=TfrmItemManageNew.Create(Application);
|
||||||
|
with frmItemManageNew do
|
||||||
|
begin
|
||||||
|
flag:='BSInType';
|
||||||
|
flagname:='贝斯入库类型';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('DepotClass').Value:=Trim(ClientDataSet1.fieldbyname('name').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmItemManageNew.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1Column2PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmItemManageNew:=TfrmItemManageNew.Create(Application);
|
||||||
|
with frmItemManageNew do
|
||||||
|
begin
|
||||||
|
flag:='BSBC';
|
||||||
|
flagname:='贝斯班次';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('defstr6').Value:=Trim(ClientDataSet1.fieldbyname('name').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmItemManageNew.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseIn.v1defstr7PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmItemManageNew:=TfrmItemManageNew.Create(Application);
|
||||||
|
with frmItemManageNew do
|
||||||
|
begin
|
||||||
|
flag:='BSBZ';
|
||||||
|
flagname:='贝斯班组';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('defstr7').Value:=Trim(ClientDataSet1.fieldbyname('name').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmItemManageNew.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
317
样品/U_BaseInList.dfm
Normal file
317
样品/U_BaseInList.dfm
Normal file
|
@ -0,0 +1,317 @@
|
||||||
|
object frmBaseInList: TfrmBaseInList
|
||||||
|
Left = 61
|
||||||
|
Top = 97
|
||||||
|
Width = 1165
|
||||||
|
Height = 618
|
||||||
|
Caption = #20837#24211#21015#34920
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1157
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
DisabledImages = DataLink_JWLCK.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_JWLCK.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #39640#32423#36807#28388
|
||||||
|
ImageIndex = 57
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 213
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 276
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 339
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBView: TToolButton
|
||||||
|
Left = 402
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26597#30475
|
||||||
|
ImageIndex = 25
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBViewClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 465
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 528
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBPrintClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 591
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1157
|
||||||
|
Height = 73
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 28
|
||||||
|
Top = 12
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20837#24211#26102#38388
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 64
|
||||||
|
Top = 36
|
||||||
|
Width = 12
|
||||||
|
Height = 12
|
||||||
|
Caption = #33267
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 12
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #29289#26009#21517#31216
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 360
|
||||||
|
Top = 12
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #35268' '#26684
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 36
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20379' '#24212' '#21830
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 77
|
||||||
|
Top = 9
|
||||||
|
Width = 87
|
||||||
|
Height = 20
|
||||||
|
Date = 40768.458268587970000000
|
||||||
|
Time = 40768.458268587970000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 77
|
||||||
|
Top = 33
|
||||||
|
Width = 87
|
||||||
|
Height = 20
|
||||||
|
Date = 40768.458268587970000000
|
||||||
|
Time = 40768.458268587970000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object PlanNo: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 233
|
||||||
|
Top = 9
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object P_ChnName20: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 398
|
||||||
|
Top = 9
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object ShorName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 233
|
||||||
|
Top = 33
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 28
|
||||||
|
Top = 124
|
||||||
|
Width = 1093
|
||||||
|
Height = 389
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Quantity
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20837#24211#26102#38388
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.Kind = ckDateTime
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1DepotClass: TcxGridDBColumn
|
||||||
|
Caption = #20837#24211#31867#22411
|
||||||
|
DataBinding.FieldName = 'DepotClass'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
object v1batchnum: TcxGridDBColumn
|
||||||
|
Caption = #29289#26009#21517#31216
|
||||||
|
DataBinding.FieldName = 'batchnum'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 74
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'defstr6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1ShortName: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'ShortName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Quantity: TcxGridDBColumn
|
||||||
|
Caption = #20837#24211#25968#37327
|
||||||
|
DataBinding.FieldName = 'Quantity'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 76
|
||||||
|
end
|
||||||
|
object v1UnitName: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'UnitName'
|
||||||
|
PropertiesClassName = 'TcxComboBoxProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Note: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'Note'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 99
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 496
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Parameters = <>
|
||||||
|
Left = 552
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 600
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 672
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryMain
|
||||||
|
Left = 640
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
end
|
331
样品/U_BaseInList.pas
Normal file
331
样品/U_BaseInList.pas
Normal file
|
@ -0,0 +1,331 @@
|
||||||
|
unit U_BaseInList;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
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, cxCalendar, cxButtonEdit, cxDropDownEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmBaseInList = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
TBView: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
Label7: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
PlanNo: TEdit;
|
||||||
|
P_ChnName20: TEdit;
|
||||||
|
ShorName: TEdit;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1ShortName: TcxGridDBColumn;
|
||||||
|
v1Quantity: TcxGridDBColumn;
|
||||||
|
v1UnitName: TcxGridDBColumn;
|
||||||
|
v1Note: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
v1batchnum: TcxGridDBColumn;
|
||||||
|
v1DepotClass: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBViewClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBPrintClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure PlanNoChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitForm();
|
||||||
|
function DelData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmBaseInList: TfrmBaseInList;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_BaseIn;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmBaseInList:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxgrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('入库列表',Tv1,'贝斯仓库');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec P_Get_ClothInOutList :begdate,:enddate,:DepotNo,:DepotCode,:PState,:CRK');
|
||||||
|
Parameters.ParamByName('DepotCode').Value:=Trim(gDef1);
|
||||||
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime));
|
||||||
|
Parameters.ParamByName('enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',enddate.DateTime+1));
|
||||||
|
Parameters.ParamByName('PState').Value:=1;
|
||||||
|
Parameters.ParamByName('CRK').Value:=1;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.InitForm();
|
||||||
|
begin
|
||||||
|
ReadCxGrid('入库列表',Tv1,'贝斯仓库');
|
||||||
|
BegDate.DateTime:=GetServerTime10(ADOQueryTemp);//SGetServerDate10(ADOQueryTemp);
|
||||||
|
EndDate.DateTime:=GetServerTime10(ADOQueryTemp);
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from WC_ClothInout_Info where KCID='+Trim(ADOQueryMain.fieldbyname('KCID').AsString));
|
||||||
|
sql.Add(' and DepotNO like ''BC%'' ');
|
||||||
|
open;
|
||||||
|
if ADOQueryTemp.RecordCount>0 then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('此贝斯已经有出库记录,不能进行操作!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
try
|
||||||
|
frmBaseIn:=TfrmBaseIn.Create(Application);
|
||||||
|
with frmBaseIn do
|
||||||
|
begin
|
||||||
|
DepotNo:=Trim(self.ADOQueryMain.fieldbyname('DepotNo').AsString);
|
||||||
|
ToolButton1.Visible:=False;
|
||||||
|
ToolButton2.Visible:=False;
|
||||||
|
ToolButton3.Visible:=False;
|
||||||
|
ToolButton4.Visible:=False;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.TBFind.Click;
|
||||||
|
Self.ADOQueryMain.Locate('DepotNo',DepotNo,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmBaseIn.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from WC_ClothInout_Info where KCID='+Trim(ADOQueryMain.fieldbyname('KCID').AsString));
|
||||||
|
sql.Add(' and DepotNO like ''BC%'' ');
|
||||||
|
open;
|
||||||
|
if ADOQueryTemp.RecordCount>0 then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('此贝斯已经有出库记录,不能进行操作!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
TBRafresh.Click;
|
||||||
|
TBFind.Click;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmBaseInList.DelData():Boolean;
|
||||||
|
var
|
||||||
|
FInt:Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from WC_ClothInout_Info where DefFlt2>0 ');
|
||||||
|
SQL.Add(' and DepotNo<>'''+Trim(ADOQueryMain.fieldbyname('DepotNo').AsString)+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('PlanNo').AsString)<>'' then
|
||||||
|
SQL.Add(' and PlanNo='''+ADOQueryMain.fieldbyname('PlanNo').AsString+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('P_Code').AsString)<>'' then
|
||||||
|
SQL.Add(' and P_Code='''+ADOQueryMain.fieldbyname('P_Code').AsString+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('DefStr1').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr1='''+ADOQueryMain.fieldbyname('DefStr1').AsString+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('DefStr2').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr2='''+ADOQueryMain.fieldbyname('DefStr2').AsString+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('DefStr3').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr3='''+ADOQueryMain.fieldbyname('DefStr3').AsString+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('DefStr4').AsString)<>'' then
|
||||||
|
SQL.Add(' and DefStr4='''+ADOQueryMain.fieldbyname('DefStr4').AsString+'''');
|
||||||
|
if Trim(ADOQueryMain.fieldbyname('Defflt1').AsString)<>'' then
|
||||||
|
SQL.Add(' and Defflt1='+ADOQueryMain.fieldbyname('Defflt1').AsString);
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
FInt:=1;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Update WC_ClothInout_Info Set DefFlt2='+inttostr(FInt));
|
||||||
|
sql.Add(',DefFlt3='+inttostr((FInt-1) div 10));
|
||||||
|
sql.Add(' where DepotNo='''+Trim(ADOQueryTemp.fieldbyname('DepotNo').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
FInt:=FInt+1;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete WC_ClothInout_Info where depotno='''+Trim(ADOQueryMain.fieldbyname('depotno').AsString)+'''');
|
||||||
|
sql.Add(' delete WC_ClothInout where depotno='''+Trim(ADOQueryMain.fieldbyname('depotno').AsString)+'''');
|
||||||
|
sql.Add(' delete WC_ClothClothing where KCID='+Trim(ADOQueryMain.fieldbyname('KCID').AsString));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBViewClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('入库列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBPrintClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmBaseIn:=TfrmBaseIn.Create(Application);
|
||||||
|
with frmBaseIn do
|
||||||
|
begin
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.TBFind.Click;
|
||||||
|
Self.ADOQueryMain.Locate('DepotNo',DepotNo,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmBaseIn.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.PlanNoChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitForm();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseInList.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
SeniorFilter(Tv1,ADOQueryMain);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
341
样品/U_BaseOut.dfm
Normal file
341
样品/U_BaseOut.dfm
Normal file
|
@ -0,0 +1,341 @@
|
||||||
|
object frmBaseOut: TfrmBaseOut
|
||||||
|
Left = 58
|
||||||
|
Top = 246
|
||||||
|
Width = 1211
|
||||||
|
Height = 591
|
||||||
|
Caption = #20986#24211#32534#36753
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1203
|
||||||
|
Height = 24
|
||||||
|
AutoSize = True
|
||||||
|
ButtonWidth = 51
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Flat = True
|
||||||
|
Images = ADODBMD_BSCK.ImageList24
|
||||||
|
List = True
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
Transparent = True
|
||||||
|
Wrapable = False
|
||||||
|
object BtnSave: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 5
|
||||||
|
OnClick = BtnSaveClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 55
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 23
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 110
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 24
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object BtnExit: TToolButton
|
||||||
|
Left = 165
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 10
|
||||||
|
OnClick = BtnExitClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 16
|
||||||
|
Top = 32
|
||||||
|
Width = 1169
|
||||||
|
Height = 433
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'DefStr1'
|
||||||
|
Column = v1P_ChnName10
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'DefStr2'
|
||||||
|
Column = v1ShortName
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'RollUnit'
|
||||||
|
Column = v1UnitName
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'P_Code'
|
||||||
|
Column = v1P_ChnName
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Quantity
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20986#24211#26102#38388
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.Kind = ckDateTime
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 127
|
||||||
|
end
|
||||||
|
object v1DepotClass: TcxGridDBColumn
|
||||||
|
Caption = #20986#24211#31867#22411
|
||||||
|
DataBinding.FieldName = 'DepotClass'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1DepotClassPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #29677#32452
|
||||||
|
DataBinding.FieldName = 'defstr7'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 50
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #29677#27425
|
||||||
|
DataBinding.FieldName = 'defstr6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 50
|
||||||
|
end
|
||||||
|
object v1batchnum: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21367#21495
|
||||||
|
DataBinding.FieldName = 'batchnum'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 78
|
||||||
|
end
|
||||||
|
object v1PlanNo: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #25209#21495
|
||||||
|
DataBinding.FieldName = 'PlanNo'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = False
|
||||||
|
Properties.OnButtonClick = v1PlanNoPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1P_SeqNo: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #35745#21010#21333#24207#21495
|
||||||
|
DataBinding.FieldName = 'P_SeqNo'
|
||||||
|
Visible = False
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1P_ChnName: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'P_ChnName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1P_ChnNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 105
|
||||||
|
end
|
||||||
|
object v1P_Code: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #32534#21495
|
||||||
|
DataBinding.FieldName = 'P_Code'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
end
|
||||||
|
object v1P_ChnName10: TcxGridDBColumn
|
||||||
|
Caption = #22522#24067#21517#31216
|
||||||
|
DataBinding.FieldName = 'P_ChnName10'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1P_ChnName10PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 118
|
||||||
|
end
|
||||||
|
object v1DefStr1: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22522#24067#32534#21495
|
||||||
|
DataBinding.FieldName = 'DefStr1'
|
||||||
|
Visible = False
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1ShortName: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'ShortName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1ShortNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 96
|
||||||
|
end
|
||||||
|
object v1DefStr2: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #20379#24212#21830#32534#21495
|
||||||
|
DataBinding.FieldName = 'DefStr2'
|
||||||
|
Visible = False
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1DefStr3: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22522#24067#39068#33394
|
||||||
|
DataBinding.FieldName = 'DefStr3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1DefFlt1: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21402#24230
|
||||||
|
DataBinding.FieldName = 'DefFlt1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Quantity: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #20986#24211#25968#37327
|
||||||
|
DataBinding.FieldName = 'Quantity'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1UnitName: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'UnitName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1UnitNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 44
|
||||||
|
end
|
||||||
|
object v1RollUnit: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21333#20301#32534#21495
|
||||||
|
DataBinding.FieldName = 'RollUnit'
|
||||||
|
Visible = False
|
||||||
|
FooterAlignmentHorz = taCenter
|
||||||
|
Width = 52
|
||||||
|
end
|
||||||
|
object v1DefStr4: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #31561#32423
|
||||||
|
DataBinding.FieldName = 'DefStr4'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1DefStr4PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Note: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'Note'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 108
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = CDS_Sub
|
||||||
|
Left = 216
|
||||||
|
Top = 144
|
||||||
|
end
|
||||||
|
object CDS_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 256
|
||||||
|
Top = 160
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = ADODBMD_BSCK.ADOCon
|
||||||
|
Parameters = <>
|
||||||
|
Left = 184
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = ADODBMD_BSCK.ADOCon
|
||||||
|
Parameters = <>
|
||||||
|
Left = 224
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = ADODBMD_BSCK.ADOCon
|
||||||
|
Parameters = <>
|
||||||
|
Left = 264
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
end
|
471
样品/U_BaseOut.pas
Normal file
471
样品/U_BaseOut.pas
Normal file
|
@ -0,0 +1,471 @@
|
||||||
|
unit U_BaseOut;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics,
|
||||||
|
cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||||
|
cxClasses, cxControls, cxGridCustomView, cxGrid, ADODB, DBClient,
|
||||||
|
cxButtonEdit, cxDropDownEdit, cxCalendar;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmBaseOut = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
BtnSave: TToolButton;
|
||||||
|
BtnExit: TToolButton;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
v1PlanNo: TcxGridDBColumn;
|
||||||
|
v1P_ChnName: TcxGridDBColumn;
|
||||||
|
v1P_ChnName10: TcxGridDBColumn;
|
||||||
|
v1ShortName: TcxGridDBColumn;
|
||||||
|
v1DefStr3: TcxGridDBColumn;
|
||||||
|
v1DefFlt1: TcxGridDBColumn;
|
||||||
|
v1DefStr4: TcxGridDBColumn;
|
||||||
|
v1Note: TcxGridDBColumn;
|
||||||
|
v1Quantity: TcxGridDBColumn;
|
||||||
|
v1UnitName: TcxGridDBColumn;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
CDS_Sub: TClientDataSet;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1DefStr2: TcxGridDBColumn;
|
||||||
|
v1DefStr1: TcxGridDBColumn;
|
||||||
|
v1P_Code: TcxGridDBColumn;
|
||||||
|
v1RollUnit: TcxGridDBColumn;
|
||||||
|
v1P_SeqNo: TcxGridDBColumn;
|
||||||
|
v1DepotClass: TcxGridDBColumn;
|
||||||
|
v1batchnum: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure BtnExitClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure v1P_ChnNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1P_ChnName10PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1ShortNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1UnitNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1DefStr4PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PlanNoPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure BtnSaveClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure v1DepotClassPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
DepotNo:string;
|
||||||
|
QuantityCK:string;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmBaseOut: TfrmBaseOut;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_adodbmd,U_global,U_FormPas,U_SelfForm,U_ProductHelp,
|
||||||
|
U_SupplyHelp,U_JlUnitHelp,U_ItemManageNew,U_GetPlanListHelp
|
||||||
|
,U_GetBaseInList;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.BtnExitClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmBaseOut.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec P_Get_ClothInOutList :begdate,:enddate,:DepotNo,:DepotCode,:PState,:CRK');
|
||||||
|
Parameters.ParamByName('DepotNo').Value:=Trim(DepotNo);
|
||||||
|
Parameters.ParamByName('PState').Value:=2;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
CreateCDS20(ADOQueryMain,CDS_Sub);
|
||||||
|
InitCDSData20(ADOQueryMain,CDS_Sub);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmGetBaseInList:=TfrmGetBaseInList.Create(Application);
|
||||||
|
with frmGetBaseInList do
|
||||||
|
begin
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
CDS_Sub.FieldByName('PlanNo').Value:=Trim(ADOQueryMain.fieldbyname('PlanNo').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_SeqNO').Value:=Trim(ADOQueryMain.fieldbyname('P_SeqNO').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_Code').Value:=Trim(ADOQueryMain.fieldbyname('P_Code').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_ChnName').Value:=Trim(ADOQueryMain.fieldbyname('P_ChnName').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr1').Value:=Trim(ADOQueryMain.fieldbyname('DefStr1').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_ChnName10').Value:=Trim(ADOQueryMain.fieldbyname('P_ChnName10').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr2').Value:=Trim(ADOQueryMain.fieldbyname('DefStr2').AsString);
|
||||||
|
CDS_Sub.FieldByName('ShortName').Value:=Trim(ADOQueryMain.fieldbyname('ShortName').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr3').Value:=Trim(ADOQueryMain.fieldbyname('DefStr3').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefFlt1').Value:=Trim(ADOQueryMain.fieldbyname('DefFlt1').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr6').Value:=Trim(ADOQueryMain.fieldbyname('DefStr6').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr7').Value:=Trim(ADOQueryMain.fieldbyname('DefStr7').AsString);
|
||||||
|
CDS_Sub.FieldByName('Quantity').Value:=Trim(ADOQueryMain.fieldbyname('QuantityKC').AsString);
|
||||||
|
CDS_Sub.FieldByName('UnitName').Value:=Trim(ADOQueryMain.fieldbyname('UnitName').AsString);
|
||||||
|
CDS_Sub.FieldByName('RollUnit').Value:=Trim(ADOQueryMain.fieldbyname('RollUnit').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr4').Value:=Trim(ADOQueryMain.fieldbyname('DefStr4').AsString);
|
||||||
|
CDS_Sub.FieldByName('KCID').Value:=Trim(ADOQueryMain.fieldbyname('KCID').AsString);
|
||||||
|
CDS_Sub.FieldByName('batchnum').Value:=Trim(ADOQueryMain.fieldbyname('batchnum').AsString);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmGetBaseInList.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
CDS_Sub.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmBaseOut.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
MaxNo,strSQL:string;
|
||||||
|
KID,i:Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
CDS_Sub.First;
|
||||||
|
for i:=0 to CDS_Sub.RecordCount-1 do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
MaxNo:=Trim(CDS_Sub.fieldbyname('DepotNo').AsString);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if GetMaxNo20(ADOQueryCmd,MaxNo,'WC_ClothInout','BC',1,4)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
KID:=CDS_Sub.fieldbyname('KcID').AsInteger;
|
||||||
|
//保存主表
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from WC_ClothInout where DepotNO='''+Trim(DepotNo)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)<>'' then
|
||||||
|
Edit
|
||||||
|
else
|
||||||
|
Append;
|
||||||
|
FieldByName('DepotNo').Value:=Trim(MaxNo);
|
||||||
|
FieldByName('DepotCode').Value:=Trim(gDef1);
|
||||||
|
FieldByName('DepotType').Value:=0;
|
||||||
|
FieldByName('Filler').Value:=Trim(gUserName);
|
||||||
|
FieldByName('FillTime').Value:=Trim(CDS_Sub.fieldbyname('FillTime').AsString);
|
||||||
|
FieldByName('DepotClass').Value:=Trim(CDS_Sub.fieldbyname('DepotClass').AsString);
|
||||||
|
FieldByName('Status').Value:='I9';
|
||||||
|
FieldByName('DepotNo').Value:=Trim(MaxNo);
|
||||||
|
//SSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_Sub,'WC_ClothInout',1);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//保存从表
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from WC_ClothInOut_Info where DepotNO='''+Trim(DepotNo)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)<>'' then
|
||||||
|
Edit
|
||||||
|
else
|
||||||
|
Append;
|
||||||
|
FieldByName('DepotNo').Value:=Trim(MaxNo);
|
||||||
|
FieldByName('KCID').Value:=KID;
|
||||||
|
FieldByName('ID').Value:=1;
|
||||||
|
SSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_Sub,'WC_ClothInOut_Info',2);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//保存到库存表
|
||||||
|
if Trim(CDS_Sub.fieldbyname('DepotNo').AsString)='' then
|
||||||
|
begin
|
||||||
|
//更新到库存表
|
||||||
|
strSQL := 'UPDATE WC_ClothClothing SET '
|
||||||
|
+ 'Quantity =Quantity-' + CDS_Sub.fieldbyname('Quantity').AsString+ ' '
|
||||||
|
+ 'WHERE KcID = ' + IntToStr(KID);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
//更新到库存表
|
||||||
|
strSQL := 'UPDATE WC_ClothClothing SET '
|
||||||
|
+ 'Quantity =Quantity+'+QuantityCK+'-'+CDS_Sub.fieldbyname('Quantity').AsString+ ' '
|
||||||
|
+ 'WHERE KcID = ' + IntToStr(KID);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add(strSQL);
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Next;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
DepotNo:=MaxNo;
|
||||||
|
ModalResult:=1;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1P_ChnNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductHelp:=TfrmProductHelp.Create(Application);
|
||||||
|
with frmProductHelp do
|
||||||
|
begin
|
||||||
|
fDipFlag:=3;
|
||||||
|
cxTabControl1.Tabs[0].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[1].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[2].Visible:=False;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('P_Code').Value:=ADOQueryHelp.fieldbyname('P_Code').AsString;
|
||||||
|
CDS_Sub.FieldByName('P_ChnName').Value:=ADOQueryHelp.fieldbyname('P_ChnName').AsString;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1P_ChnName10PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductHelp:=TfrmProductHelp.Create(Application);
|
||||||
|
with frmProductHelp do
|
||||||
|
begin
|
||||||
|
fDipFlag:=2;
|
||||||
|
cxTabControl1.Tabs[0].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[1].Visible:=False;
|
||||||
|
cxTabControl1.Tabs[3].Visible:=False;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('DefStr1').Value:=ADOQueryHelp.fieldbyname('P_Code').AsString;
|
||||||
|
CDS_Sub.FieldByName('P_ChnName10').Value:=ADOQueryHelp.fieldbyname('P_ChnName').AsString;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1ShortNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmSupplyHelp:=TfrmSupplyHelp.Create(Application);
|
||||||
|
with frmSupplyHelp do
|
||||||
|
begin
|
||||||
|
FLType:='坯布';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
self.CDS_Sub.FieldByName('ShortName').Value:=Trim(ADOQueryHelp.fieldbyname('ShortName').AsString);
|
||||||
|
self.CDS_Sub.FieldByName('DefStr2').Value:=Trim(ADOQueryHelp.fieldbyname('CustomNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmSupplyHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1UnitNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
kf_frmJlUnitHelp:=Tkf_frmJlUnitHelp.Create(Application);
|
||||||
|
with kf_frmJlUnitHelp do
|
||||||
|
begin
|
||||||
|
Fflag:='length';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('UnitName').Value:=Trim(ADOQueryHelp.fieldbyname('名称').AsString);
|
||||||
|
Self.CDS_Sub.FieldByName('RollUnit').Value:=Trim(ADOQueryHelp.fieldbyname('编号').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
kf_frmJlUnitHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1DefStr4PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmItemManageNew:=TfrmItemManageNew.Create(Application);
|
||||||
|
with frmItemManageNew do
|
||||||
|
begin
|
||||||
|
flag:='DefStr4';
|
||||||
|
flagname:='贝斯等级';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('DefStr4').Value:=Trim(ClientDataSet1.fieldbyname('name').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmItemManageNew.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1PlanNoPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmGetPlanListHelp:=TfrmGetPlanListHelp.Create(Application);
|
||||||
|
with frmGetPlanListHelp do
|
||||||
|
begin
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('PlanNo').Value:=Trim(ADOQueryHelp.fieldbyname('PlanNo').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_SeqNo').Value:=Trim(ADOQueryHelp.fieldbyname('P_SeqNo').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr1').Value:=Trim(ADOQueryHelp.fieldbyname('P_BaseCode').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_ChnName10').Value:=Trim(ADOQueryHelp.fieldbyname('P_BaseChnName').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr2').Value:=Trim(ADOQueryHelp.fieldbyname('P_Factory').AsString);
|
||||||
|
CDS_Sub.FieldByName('Shortname').Value:=Trim(ADOQueryHelp.fieldbyname('SupplierName').AsString);
|
||||||
|
CDS_Sub.FieldByName('DefStr3').Value:=Trim(ADOQueryHelp.fieldbyname('SBtr2').AsString);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Select P_Code from MC_CatLog where P_ChnName='''+Trim(ADOQueryHelp.fieldbyname('LbStr6').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName('P_Code').Value:=Trim(ADOQueryTemp.fieldbyname('P_Code').AsString);
|
||||||
|
CDS_Sub.FieldByName('P_ChnName').Value:=Trim(ADOQueryHelp.fieldbyname('LbStr6').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmGetPlanListHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.BtnSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.Locate('FillTime',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('出库时间不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('PlanNo',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('批号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('batchnum',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('卷号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('DepotClass',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('出库类型不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('P_ChnName',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('品名不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('Quantity',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('数量不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOut.v1DepotClassPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmItemManageNew:=TfrmItemManageNew.Create(Application);
|
||||||
|
with frmItemManageNew do
|
||||||
|
begin
|
||||||
|
flag:='BSOutType';
|
||||||
|
flagname:='贝斯出库类型';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('DepotClass').Value:=Trim(ClientDataSet1.fieldbyname('name').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmItemManageNew.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
465
样品/U_BaseOutList.dfm
Normal file
465
样品/U_BaseOutList.dfm
Normal file
|
@ -0,0 +1,465 @@
|
||||||
|
object frmBaseOutList: TfrmBaseOutList
|
||||||
|
Left = 83
|
||||||
|
Top = 124
|
||||||
|
Width = 1024
|
||||||
|
Height = 618
|
||||||
|
Caption = #20986#24211#21015#34920
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1016
|
||||||
|
Height = 23
|
||||||
|
ButtonWidth = 75
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Flat = True
|
||||||
|
Images = ADODBMD_BSCK.ImageList24
|
||||||
|
List = True
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 30
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 55
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 110
|
||||||
|
Top = 0
|
||||||
|
Caption = #39640#32423#36807#28388
|
||||||
|
ImageIndex = 57
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 185
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 240
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 15
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 295
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 7
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 350
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 47
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 405
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 4
|
||||||
|
OnClick = TBPrintClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 460
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 10
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 23
|
||||||
|
Width = 1016
|
||||||
|
Height = 73
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 28
|
||||||
|
Top = 12
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20986#24211#26102#38388
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 64
|
||||||
|
Top = 36
|
||||||
|
Width = 12
|
||||||
|
Height = 12
|
||||||
|
Caption = #33267
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 12
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #25209' '#21495
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 344
|
||||||
|
Top = 12
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517#20108
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 36
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #22522#24067#21517#31216
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 509
|
||||||
|
Top = 36
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #39068#33394
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 344
|
||||||
|
Top = 36
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
end
|
||||||
|
object Label8: TLabel
|
||||||
|
Left = 509
|
||||||
|
Top = 12
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #21402#24230
|
||||||
|
end
|
||||||
|
object Label9: TLabel
|
||||||
|
Left = 645
|
||||||
|
Top = 12
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #21367' '#21495
|
||||||
|
end
|
||||||
|
object Label10: TLabel
|
||||||
|
Left = 645
|
||||||
|
Top = 36
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #36125#26031#31867#21035
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 77
|
||||||
|
Top = 9
|
||||||
|
Width = 87
|
||||||
|
Height = 20
|
||||||
|
Date = 40768.458268587970000000
|
||||||
|
Time = 40768.458268587970000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 77
|
||||||
|
Top = 33
|
||||||
|
Width = 87
|
||||||
|
Height = 20
|
||||||
|
Date = 40768.458268587970000000
|
||||||
|
Time = 40768.458268587970000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object PlanNo: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 233
|
||||||
|
Top = 9
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object P_ChnName20: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 382
|
||||||
|
Top = 9
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object P_ChnName10: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 233
|
||||||
|
Top = 33
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object DefStr3: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 535
|
||||||
|
Top = 33
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 5
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object ShorName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 382
|
||||||
|
Top = 33
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 6
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object HD: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 534
|
||||||
|
Top = 9
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 7
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object batchnum: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 695
|
||||||
|
Top = 9
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 8
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
object BSTypeName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 695
|
||||||
|
Top = 33
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 9
|
||||||
|
OnChange = PlanNoChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 28
|
||||||
|
Top = 100
|
||||||
|
Width = 925
|
||||||
|
Height = 357
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Quantity
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20986#24211#26102#38388
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.Kind = ckDateTime
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1DepotClass: TcxGridDBColumn
|
||||||
|
Caption = #20986#24211#31867#22411
|
||||||
|
DataBinding.FieldName = 'DepotClass'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #29677#27425
|
||||||
|
DataBinding.FieldName = 'defstr6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #29677#32452
|
||||||
|
DataBinding.FieldName = 'defstr7'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 52
|
||||||
|
end
|
||||||
|
object v1batchnum: TcxGridDBColumn
|
||||||
|
Caption = #21367#21495
|
||||||
|
DataBinding.FieldName = 'batchnum'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 76
|
||||||
|
end
|
||||||
|
object v1PlanNo: TcxGridDBColumn
|
||||||
|
Caption = #25209#21495
|
||||||
|
DataBinding.FieldName = 'PlanNo'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1P_ChnName: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517#19968
|
||||||
|
DataBinding.FieldName = 'P_ChnName20'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1P_Spec10: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517#20108
|
||||||
|
DataBinding.FieldName = 'P_Spec10'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1BSTypeName: TcxGridDBColumn
|
||||||
|
Caption = #36125#26031#31867#21035
|
||||||
|
DataBinding.FieldName = 'BSTypeName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
object v1P_ChnName10: TcxGridDBColumn
|
||||||
|
Caption = #22522#24067#21517#31216
|
||||||
|
DataBinding.FieldName = 'P_ChnName10'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object v1ShortName: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'ShortName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1DefStr3: TcxGridDBColumn
|
||||||
|
Caption = #22522#24067#39068#33394
|
||||||
|
DataBinding.FieldName = 'DefStr3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1DefFlt1: TcxGridDBColumn
|
||||||
|
Caption = #21402#24230
|
||||||
|
DataBinding.FieldName = 'HD'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object v1Quantity: TcxGridDBColumn
|
||||||
|
Caption = #20986#24211#25968#37327
|
||||||
|
DataBinding.FieldName = 'Quantity'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 76
|
||||||
|
end
|
||||||
|
object v1UnitName: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'UnitName'
|
||||||
|
PropertiesClassName = 'TcxComboBoxProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1DefStr4: TcxGridDBColumn
|
||||||
|
Caption = #31561#32423
|
||||||
|
DataBinding.FieldName = 'DefStr4'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Note: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'Note'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 145
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 496
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = ADODBMD_BSCK.ADOCon
|
||||||
|
Parameters = <>
|
||||||
|
Left = 664
|
||||||
|
Top = 200
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = ADODBMD_BSCK.ADOCon
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 736
|
||||||
|
Top = 200
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = ADODBMD_BSCK.ADOCon
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 848
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryMain
|
||||||
|
Left = 800
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
end
|
267
样品/U_BaseOutList.pas
Normal file
267
样品/U_BaseOutList.pas
Normal file
|
@ -0,0 +1,267 @@
|
||||||
|
unit U_BaseOutList;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
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, cxCalendar, cxButtonEdit, cxDropDownEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmBaseOutList = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
Label7: TLabel;
|
||||||
|
Label8: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
PlanNo: TEdit;
|
||||||
|
P_ChnName20: TEdit;
|
||||||
|
P_ChnName10: TEdit;
|
||||||
|
DefStr3: TEdit;
|
||||||
|
ShorName: TEdit;
|
||||||
|
HD: TEdit;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1PlanNo: TcxGridDBColumn;
|
||||||
|
v1P_ChnName: TcxGridDBColumn;
|
||||||
|
v1P_ChnName10: TcxGridDBColumn;
|
||||||
|
v1ShortName: TcxGridDBColumn;
|
||||||
|
v1DefStr3: TcxGridDBColumn;
|
||||||
|
v1DefFlt1: TcxGridDBColumn;
|
||||||
|
v1Quantity: TcxGridDBColumn;
|
||||||
|
v1UnitName: TcxGridDBColumn;
|
||||||
|
v1DefStr4: TcxGridDBColumn;
|
||||||
|
v1Note: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
v1P_Spec10: TcxGridDBColumn;
|
||||||
|
v1BSTypeName: TcxGridDBColumn;
|
||||||
|
v1DepotClass: TcxGridDBColumn;
|
||||||
|
v1batchnum: TcxGridDBColumn;
|
||||||
|
Label9: TLabel;
|
||||||
|
batchnum: TEdit;
|
||||||
|
Label10: TLabel;
|
||||||
|
BSTypeName: TEdit;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBPrintClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure PlanNoChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitForm();
|
||||||
|
function DelData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmBaseOutList: TfrmBaseOutList;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_adodbmd,U_SelfForm,U_CxGridSet,U_FormPas,U_BaseOut,U_global;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmBaseOutList:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxgrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('出库列表',Tv1,'贝斯仓库');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec P_Get_ClothInOutList :begdate,:enddate,:DepotNo,:DepotCode,:PState,:CRK');
|
||||||
|
Parameters.ParamByName('DepotCode').Value:=Trim(gDef1);
|
||||||
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime));
|
||||||
|
Parameters.ParamByName('enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',enddate.DateTime+1));
|
||||||
|
Parameters.ParamByName('PState').Value:=1;
|
||||||
|
Parameters.ParamByName('CRK').Value:=0;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.InitForm();
|
||||||
|
begin
|
||||||
|
ReadCxGrid('出库列表',Tv1,'贝斯仓库');
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
EndDate.DateTime:=BegDate.DateTime;
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
try
|
||||||
|
frmBaseOut:=TfrmBaseOut.Create(Application);
|
||||||
|
with frmBaseOut do
|
||||||
|
begin
|
||||||
|
DepotNo:=Trim(self.ADOQueryMain.fieldbyname('DepotNo').AsString);
|
||||||
|
QuantityCK:=Trim(self.ADOQueryMain.fieldbyname('Quantity').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.TBFind.Click;
|
||||||
|
Self.ADOQueryMain.Locate('DepotNo',DepotNo,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmBaseOut.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
TBRafresh.Click;
|
||||||
|
TBFind.Click;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmBaseOutList.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete WC_ClothInout_Info where depotno='''+Trim(ADOQueryMain.fieldbyname('depotno').AsString)+'''');
|
||||||
|
sql.Add(' delete WC_ClothInout where depotno='''+Trim(ADOQueryMain.fieldbyname('depotno').AsString)+'''');
|
||||||
|
SQL.Add(' Update WC_ClothClothing Set Quantity=Quantity+'+Trim(ADOQueryMain.fieldbyname('Quantity').AsString));
|
||||||
|
sql.Add(' where KCID='+Trim(ADOQueryMain.fieldbyname('KCID').AsString));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('入库列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBPrintClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmBaseOut:=TfrmBaseOut.Create(Application);
|
||||||
|
with frmBaseOut do
|
||||||
|
begin
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.TBFind.Click;
|
||||||
|
Self.ADOQueryMain.Locate('DepotNo',DepotNo,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmBaseOut.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.PlanNoChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitForm();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmBaseOutList.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SeniorFilter(Tv1,ADOQueryMain);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
515
样品/U_CPAdd.dfm
Normal file
515
样品/U_CPAdd.dfm
Normal file
|
@ -0,0 +1,515 @@
|
||||||
|
object frmCPAdd: TfrmCPAdd
|
||||||
|
Left = 299
|
||||||
|
Top = 69
|
||||||
|
Width = 1296
|
||||||
|
Height = 515
|
||||||
|
Align = alClient
|
||||||
|
Caption = #26679#21697#36755#20837
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1280
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 14
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object TBADD: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 103
|
||||||
|
OnClick = TBADDClick
|
||||||
|
end
|
||||||
|
object TBdel: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 107
|
||||||
|
OnClick = TBdelClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 185
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 248
|
||||||
|
Top = 0
|
||||||
|
Width = 131
|
||||||
|
Height = 30
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 0
|
||||||
|
object CheckBox1: TCheckBox
|
||||||
|
Left = 10
|
||||||
|
Top = 7
|
||||||
|
Width = 97
|
||||||
|
Height = 17
|
||||||
|
Caption = #38376#24133#21333#20301#33521#23544
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = CheckBox1Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1280
|
||||||
|
Height = 443
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #24211#20301#25918#32622
|
||||||
|
DataBinding.FieldName = 'DefStr2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object Tv1Column1: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
DataBinding.FieldName = 'CYNO'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20013#25991#21697#21517
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1Column2PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYEName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20013#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYCF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #33521#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYECF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'CYMF'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column7PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'CYKZ'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column8PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20013#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column41: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #33521#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColorEng'
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #33457#22411
|
||||||
|
DataBinding.FieldName = 'CYHX'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column35: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22383#24067#32463#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr10'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column36: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22383#24067#32428#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr11'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column37: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #25104#21697#32463#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr12'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column38: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #25104#21697#32428#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr13'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column20: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20844#26020#20215
|
||||||
|
DataBinding.FieldName = 'CYPriceKg'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column20PropertiesEditValueChanged
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
VisibleForCustomization = False
|
||||||
|
Width = 53
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #31859#20215
|
||||||
|
DataBinding.FieldName = 'CYPriceM'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
VisibleForCustomization = False
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column30: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22383#24067#38376#24133
|
||||||
|
DataBinding.FieldName = 'PBMF'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column30PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column31: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22383#24067#20811#37325
|
||||||
|
DataBinding.FieldName = 'PBKZ'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column31PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #32769#32534#21495
|
||||||
|
DataBinding.FieldName = 'defstr1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column19: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20379#24212#21830#32534#21495
|
||||||
|
DataBinding.FieldName = 'defstr6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column32: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'defstr7'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1Column32PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column22: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #24037#21378#32534#30721
|
||||||
|
DataBinding.FieldName = 'defnote4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object v1Column23: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #32553#29575
|
||||||
|
DataBinding.FieldName = 'Price1'
|
||||||
|
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||||
|
Properties.DisplayFormat = '0.##'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column28: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20215#26684
|
||||||
|
DataBinding.FieldName = 'Price6'
|
||||||
|
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||||
|
Properties.DisplayFormat = '0.##'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column24: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22383#24067#36153
|
||||||
|
DataBinding.FieldName = 'Price2'
|
||||||
|
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||||
|
Properties.DisplayFormat = '0.##'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column25: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #26579#36153
|
||||||
|
DataBinding.FieldName = 'Price3'
|
||||||
|
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||||
|
Properties.DisplayFormat = '0.##'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column26: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = 'FOB'#36816#36153'+'#21253#35013
|
||||||
|
DataBinding.FieldName = 'Price4'
|
||||||
|
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||||
|
Properties.DisplayFormat = '0.##'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column27: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21518#21152#24037#36153#29992
|
||||||
|
DataBinding.FieldName = 'Price5'
|
||||||
|
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||||
|
Properties.DisplayFormat = '0.##'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #23494#24230
|
||||||
|
DataBinding.FieldName = 'defstr3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column16: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #32463#32428#25467#24230
|
||||||
|
DataBinding.FieldName = 'defstr4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column17: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'Qty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column21: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
DataBinding.FieldName = 'defnote3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column33: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21407#26009#32452#25104
|
||||||
|
DataBinding.FieldName = 'defstr8'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column18: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #32433#25903
|
||||||
|
DataBinding.FieldName = 'defnote5'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column34: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #19978#26426#35268#26684
|
||||||
|
DataBinding.FieldName = 'DefStr9'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'CYNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 85
|
||||||
|
end
|
||||||
|
object v1Column39: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #26469#26679#26085#26399
|
||||||
|
DataBinding.FieldName = 'defnote2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column40: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'defstr14'
|
||||||
|
PropertiesClassName = 'TcxComboBoxProperties'
|
||||||
|
Properties.Items.Strings = (
|
||||||
|
'RMB/Y'
|
||||||
|
'RMB/M'
|
||||||
|
'RMB/KG'
|
||||||
|
'USD/Y'
|
||||||
|
'USD/M'
|
||||||
|
'USD/KG')
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column42: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22383#24067#23494#24230
|
||||||
|
DataBinding.FieldName = 'defstr15'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column43: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #26579#21378
|
||||||
|
DataBinding.FieldName = 'defstr16'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column44: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #23458#25143
|
||||||
|
DataBinding.FieldName = 'defstr17'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = 'FOB'#20215
|
||||||
|
DataBinding.FieldName = 'Price7'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CDS_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 416
|
||||||
|
Top = 208
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 453
|
||||||
|
Top = 209
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = CDS_Sub
|
||||||
|
Left = 491
|
||||||
|
Top = 211
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 589
|
||||||
|
Top = 169
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 573
|
||||||
|
Top = 121
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 528
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
end
|
753
样品/U_CPAdd.pas
Normal file
753
样品/U_CPAdd.pas
Normal file
|
@ -0,0 +1,753 @@
|
||||||
|
unit U_CPAdd;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, ADODB, DBClient, cxGridLevel,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||||
|
cxControls, cxGridCustomView, cxGrid, ComCtrls, ToolWin,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, cxButtonEdit,
|
||||||
|
StdCtrls, ExtCtrls, cxCurrencyEdit, cxDropDownEdit, cxLookAndFeels,
|
||||||
|
cxLookAndFeelPainters, cxNavigator;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCPAdd = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
CDS_Sub: TClientDataSet;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
v1Column20: TcxGridDBColumn;
|
||||||
|
v1Column41: TcxGridDBColumn;
|
||||||
|
Panel1: TPanel;
|
||||||
|
CheckBox1: TCheckBox;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
v1Column16: TcxGridDBColumn;
|
||||||
|
v1Column17: TcxGridDBColumn;
|
||||||
|
v1Column21: TcxGridDBColumn;
|
||||||
|
v1Column22: TcxGridDBColumn;
|
||||||
|
v1Column23: TcxGridDBColumn;
|
||||||
|
v1Column24: TcxGridDBColumn;
|
||||||
|
v1Column25: TcxGridDBColumn;
|
||||||
|
v1Column26: TcxGridDBColumn;
|
||||||
|
v1Column27: TcxGridDBColumn;
|
||||||
|
v1Column28: TcxGridDBColumn;
|
||||||
|
v1Column30: TcxGridDBColumn;
|
||||||
|
v1Column31: TcxGridDBColumn;
|
||||||
|
v1Column18: TcxGridDBColumn;
|
||||||
|
v1Column19: TcxGridDBColumn;
|
||||||
|
v1Column32: TcxGridDBColumn;
|
||||||
|
v1Column33: TcxGridDBColumn;
|
||||||
|
v1Column34: TcxGridDBColumn;
|
||||||
|
v1Column35: TcxGridDBColumn;
|
||||||
|
v1Column36: TcxGridDBColumn;
|
||||||
|
v1Column37: TcxGridDBColumn;
|
||||||
|
v1Column38: TcxGridDBColumn;
|
||||||
|
v1Column39: TcxGridDBColumn;
|
||||||
|
v1Column40: TcxGridDBColumn;
|
||||||
|
v1Column42: TcxGridDBColumn;
|
||||||
|
v1Column43: TcxGridDBColumn;
|
||||||
|
v1Column44: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
TBADD: TToolButton;
|
||||||
|
TBdel: TToolButton;
|
||||||
|
Tv1Column1: TcxGridDBColumn;
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure v1Column7PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure v1Column8PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure v1Column2PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1Column26PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1Column27PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1Column20PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure CheckBox1Click(Sender: TObject);
|
||||||
|
procedure v1Column31PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure v1Column30PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure v1Column32PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure TBdelClick(Sender: TObject);
|
||||||
|
procedure TBADDClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
canshu1:string;
|
||||||
|
Fint:Integer;
|
||||||
|
procedure InitSubGrid();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
FCYID,FCYCode,FCPID,FCPNO:String;
|
||||||
|
CopyInt:Integer;
|
||||||
|
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmCPAdd: TfrmCPAdd;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_iniParam,U_ZDYHelp;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.InitSubGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from CP_YDang where CYID='''+Trim(FCYID)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Sub);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Sub);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.FormShow(Sender: TObject);
|
||||||
|
var
|
||||||
|
fsj,FFSj,FFQZSj,FFFSj,FFType:String;
|
||||||
|
FFInt,i,j:Integer;
|
||||||
|
ii:LongInt;
|
||||||
|
begin
|
||||||
|
//canshu1:=Trim(DParameters1);
|
||||||
|
ReadCxGrid('样品编辑YT1',Tv1,'样品管理');
|
||||||
|
InitSubGrid();
|
||||||
|
if CopyInt=1 then
|
||||||
|
begin
|
||||||
|
FCYID:='';
|
||||||
|
fsj:=trim(fcpNo);
|
||||||
|
if GetLSNo(ADOQueryCmd,FFSj,fsj,'CP_YDang',3,0)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Append;
|
||||||
|
CDS_Sub.fieldbyName('CYNO').Value:=trim(FFSj);
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end;
|
||||||
|
{ if Trim(YPCodeType)<>'' then
|
||||||
|
begin
|
||||||
|
if Trim(FCYID)='' then
|
||||||
|
begin
|
||||||
|
//取前缀
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select CYNO AA from CP_YDang ');
|
||||||
|
SQL.Add('where Cast(CYID as int)=(select isnull(Max(Cast(CYID as int)),0) from CP_YDang where CYType='''+Trim(FCPID)+''')');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
if Trim(ADOQueryTemp.fieldbyname('AA').asstring)='' then
|
||||||
|
begin
|
||||||
|
FFQZSj:=Trim(FCPNO);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
fsj:=Trim(ADOQueryTemp.fieldbyname('AA').asstring);
|
||||||
|
FFInt:=0;
|
||||||
|
i:=0;
|
||||||
|
FFFSj:=Trim(Copy(fsj,Length(FCPNO)+1,Length(fsj)));
|
||||||
|
while FFInt<=0 do
|
||||||
|
begin
|
||||||
|
FFSj:=Trim(Copy(fsj,Length(FCPNO)+1+i,Length(fsj)));
|
||||||
|
if TryStrToInt(FFSj,ii) then
|
||||||
|
begin
|
||||||
|
if StrToInt(FFSj)>=0 then
|
||||||
|
begin
|
||||||
|
i:=i+1;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
FFQZSj:=Trim(Copy(fsj,1,Length(FCPNO)+i+1));//前缀字符串
|
||||||
|
end;
|
||||||
|
if i=Length(FFFSj) then
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
FFQZSj:=Trim(FCPNO);
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
FFQZSj:=Trim(Copy(fsj,1,Length(FCPNO)+i+1));//前缀字符串
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//取前缀
|
||||||
|
//取后缀
|
||||||
|
if Trim(YPCodeType)='大类' then
|
||||||
|
begin
|
||||||
|
i:=99;
|
||||||
|
while i>=1 do
|
||||||
|
begin
|
||||||
|
if i=99 then
|
||||||
|
begin
|
||||||
|
FFType:=Trim(FCPID);
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_Type where CPID='''+Trim(FFType)+'''');
|
||||||
|
Open;
|
||||||
|
i:=fieldbyname('CPLevel').AsInteger;
|
||||||
|
if i>1 then
|
||||||
|
FFType:=Trim(fieldbyname('CPParent').AsString)
|
||||||
|
else
|
||||||
|
if i=1 then
|
||||||
|
begin
|
||||||
|
FFType:=Trim(fieldbyname('CPID').AsString);
|
||||||
|
i:=0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec P_Select_CP_YDang_MaxNo :CPType');
|
||||||
|
Parameters.ParamByName('CPType').Value:=Trim(FFType);
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
if Trim(YPCodeType)='小类' then
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select CYNO AA from CP_YDang ');
|
||||||
|
SQL.Add('where Cast(CYID as int)=(select isnull(Max(Cast(CYID as int)),0) from CP_YDang where CYType='''+Trim(FCPID)+''')');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Trim(ADOQueryTemp.fieldbyname('AA').asstring)='' then
|
||||||
|
begin
|
||||||
|
FFFSj:='0001';
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
fsj:=Trim(ADOQueryTemp.fieldbyname('AA').asstring);
|
||||||
|
FFInt:=0;
|
||||||
|
i:=0;
|
||||||
|
FFFSj:='';
|
||||||
|
fsj:=Trim( Copy( fsj,Length(FFQZSj)+1,Length(fsj) ) );
|
||||||
|
while FFInt<=0 do
|
||||||
|
begin
|
||||||
|
FFSj:=Trim(Copy(fsj,(Length(fsj)-i),(Length(fsj))));
|
||||||
|
if TryStrToInt(FFSj,ii) then
|
||||||
|
begin
|
||||||
|
if StrToInt(FFSj)>=0 then
|
||||||
|
begin
|
||||||
|
FFFSj:=Trim(FFSj);//后缀数字字符串
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
end;
|
||||||
|
i:=i+1;
|
||||||
|
if i=Length(fsj) then
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
i:=Length(FFFSj); //数字编号长度 3
|
||||||
|
FFInt:=StrToInt(FFFSj)+1;//最大号
|
||||||
|
j:=Length(Trim(IntToStr(FFInt))); //最大号位数 1
|
||||||
|
FFFSj:=Trim(IntToStr(FFInt));//后缀数字字符串
|
||||||
|
while j<i do
|
||||||
|
begin
|
||||||
|
FFFSj:='0'+Trim(FFFsj);
|
||||||
|
j:=j+1
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//取后缀
|
||||||
|
fsj:=Trim(FFQZSj)+Trim(FFFSj);
|
||||||
|
if CopyInt=0 then
|
||||||
|
CDS_Sub.Append
|
||||||
|
else
|
||||||
|
if CopyInt=1 then
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('CYNo').Value:=Trim(fsj);
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end;
|
||||||
|
end else }
|
||||||
|
|
||||||
|
|
||||||
|
if CDS_Sub.IsEmpty then
|
||||||
|
begin
|
||||||
|
fsj:=trim(fcpNo);
|
||||||
|
if GetLSNo(ADOQueryCmd,FFSj,fsj,'CP_YDang',3,0)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Append;
|
||||||
|
CDS_Sub.fieldbyName('CYNO').Value:=trim(FFSj);
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid('样品编辑YT1',Tv1,'样品管理');
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
function TfrmCPAdd.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
fsj,FFSj,maxId:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
CDS_Sub.DisableControls;
|
||||||
|
CDS_Sub.First;
|
||||||
|
while not CDS_Sub.Eof do
|
||||||
|
begin
|
||||||
|
if trim(CDS_Sub.fieldbyName('CYID').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxId,'','CP_YDang',3,1)=False then
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
{ fsj:=trim(fcpNo);
|
||||||
|
if GetLSNo(ADOQueryCmd,FFSj,fsj,'CP_YDang',3,0)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end; }
|
||||||
|
CDS_Sub.edit;
|
||||||
|
CDS_Sub.fieldbyName('CYID').Value:=trim(maxId);
|
||||||
|
// CDS_Sub.fieldbyName('CYNO').Value:=trim(FFSj);
|
||||||
|
CDS_Sub.FieldByName('CYType').Value:=Trim(FCPID);
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
maxId:=trim(CDS_Sub.fieldbyName('CYID').AsString);
|
||||||
|
end;
|
||||||
|
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYID='''+trim(CDS_Sub.fieldbyName('CYID').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if ADOQueryCmd.IsEmpty then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldbyName('Filler').Value:=trim(DName);
|
||||||
|
FieldByName('CYType').Value:=Trim(FCPID);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldbyName('editer').Value:=trim(DName);
|
||||||
|
FieldbyName('editTime').Value:=now();
|
||||||
|
end;
|
||||||
|
FieldByName('CYID').Value:=trim(CDS_Sub.fieldbyName('CYID').AsString);
|
||||||
|
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv1,CDS_Sub,'CP_YDang',3);
|
||||||
|
if Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString)='' then
|
||||||
|
FieldByName('CYPriceKg').Value:=0
|
||||||
|
else
|
||||||
|
FieldByName('CYPriceKg').Value:=CDS_Sub.fieldbyname('CYPriceKg').AsString;
|
||||||
|
if Trim(CDS_Sub.fieldbyname('CYPriceM').AsString)='' then
|
||||||
|
FieldByName('CYPriceM').Value:=0
|
||||||
|
else
|
||||||
|
FieldByName('CYPriceM').Value:=CDS_Sub.fieldbyname('CYPriceM').AsString;
|
||||||
|
FieldByName('CYNO').Value:=CDS_Sub.fieldbyname('CYNO').AsString;
|
||||||
|
FieldByName('Price1').Value:=CDS_Sub.fieldbyname('Price1').AsFloat;
|
||||||
|
FieldByName('Price2').Value:=CDS_Sub.fieldbyname('Price2').AsFloat;
|
||||||
|
FieldByName('Price3').Value:=CDS_Sub.fieldbyname('Price3').AsFloat;
|
||||||
|
FieldByName('Price4').Value:=CDS_Sub.fieldbyname('Price4').AsFloat;
|
||||||
|
FieldByName('Price5').Value:=CDS_Sub.fieldbyname('Price5').AsFloat;
|
||||||
|
FieldByName('Price6').Value:=CDS_Sub.fieldbyname('Price6').AsFloat;
|
||||||
|
FieldByName('Price7').Value:=CDS_Sub.fieldbyname('Price7').AsFloat;
|
||||||
|
FieldByName('Price8').Value:=CDS_Sub.fieldbyname('Price8').AsFloat;
|
||||||
|
FieldByName('Qty').Value:=CDS_Sub.fieldbyname('Qty').AsFloat;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select count(CYID) as AA from CP_YDang where CYNo='''+Trim(CDS_Sub.fieldbyname('CYNo').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if FieldByName('AA').AsInteger>1 then
|
||||||
|
begin
|
||||||
|
CDS_Sub.EnableControls;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('编号重复!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Next;
|
||||||
|
end;
|
||||||
|
FCYID:=Trim(maxId);
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
CDS_Sub.EnableControls;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
Result:=True;
|
||||||
|
CDS_Sub.EnableControls;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
{if CDS_Sub.Locate('CYName',null,[])=True then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('中文名称不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end; }
|
||||||
|
ToolBar1.SetFocus;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
ModalResult:=1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column7PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FieldName,PriceKg,MF,KZ:string;
|
||||||
|
FReal:Double;
|
||||||
|
begin
|
||||||
|
mvalue:=Trim(TcxTextEdit(Sender).EditingText);
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if TryStrToFloat(mvalue,FReal)=False then
|
||||||
|
FieldByName('CYMF').Value:=mvalue
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if Trim(canshu1)='英寸' then
|
||||||
|
FieldByName('CYMF').Value:=mvalue+'"'
|
||||||
|
else
|
||||||
|
FieldByName('CYMF').Value:=mvalue+'CM';
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
{ FieldName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||||
|
PriceKg:=Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString);
|
||||||
|
if Trim(PriceKg)='' then
|
||||||
|
begin
|
||||||
|
PriceKg:='0';
|
||||||
|
end;
|
||||||
|
MF:=Trim(CDS_Sub.fieldbyname('CYMF').AsString);
|
||||||
|
KZ:=Trim(CDS_Sub.fieldbyname('CYKZ').AsString);
|
||||||
|
if Trim(canshu1)<>'英寸' then
|
||||||
|
MF:=Copy(MF,1,Pos('C',MF)-1)
|
||||||
|
else
|
||||||
|
MF:=Copy(MF,1,Pos('"',MF)-1);
|
||||||
|
KZ:=Copy(KZ,1,Pos('g',KZ)-1);
|
||||||
|
if TryStrToFloat(MF,FReal)=False then
|
||||||
|
begin
|
||||||
|
MF:='0';
|
||||||
|
end;
|
||||||
|
if TryStrToFloat(KZ,FReal)=False then
|
||||||
|
begin
|
||||||
|
KZ:='0';
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if Trim(canshu1)<>'英寸' then
|
||||||
|
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*StrToFloat(KZ)*1.00/100000
|
||||||
|
else
|
||||||
|
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*2.54*StrToFloat(KZ)*1.00/100000;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column8PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FieldName,PriceKg,MF,KZ:string;
|
||||||
|
FReal:Double;
|
||||||
|
begin
|
||||||
|
mvalue:=Trim(TcxTextEdit(Sender).EditingText);
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if TryStrToFloat(mvalue,FReal)=False then
|
||||||
|
FieldByName('CYKZ').Value:=mvalue
|
||||||
|
else
|
||||||
|
FieldByName('CYKZ').Value:=mvalue+'GSM';
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column2PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='YPName';
|
||||||
|
flagname:='样品名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('CYName').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column26PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
var
|
||||||
|
fsj:string;
|
||||||
|
begin
|
||||||
|
fsj:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='GYStr';
|
||||||
|
flagname:='工艺名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(fsj).Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column27PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
var
|
||||||
|
fsj:string;
|
||||||
|
begin
|
||||||
|
fsj:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='YPJGFactory';
|
||||||
|
flagname:='加工厂/供应商';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(fsj).Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column20PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
var
|
||||||
|
FieldName,mvalue,MF,KZ,PriceKg:string;
|
||||||
|
FReal:Double;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
FieldName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(FieldName).Value:=mvalue;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
{ PriceKg:=Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString);
|
||||||
|
if Trim(PriceKg)='' then
|
||||||
|
begin
|
||||||
|
PriceKg:='0';
|
||||||
|
end;
|
||||||
|
MF:=Trim(CDS_Sub.fieldbyname('CYMF').AsString);
|
||||||
|
KZ:=Trim(CDS_Sub.fieldbyname('CYKZ').AsString);
|
||||||
|
if Trim(canshu1)<>'英寸' then
|
||||||
|
MF:=Copy(MF,1,Pos('C',MF)-1)
|
||||||
|
else
|
||||||
|
MF:=Copy(MF,1,Pos('"',MF)-1);
|
||||||
|
KZ:=Copy(KZ,1,Pos('g',KZ)-1);
|
||||||
|
if TryStrToFloat(MF,FReal)=False then
|
||||||
|
begin
|
||||||
|
MF:='0';
|
||||||
|
end;
|
||||||
|
if TryStrToFloat(KZ,FReal)=False then
|
||||||
|
begin
|
||||||
|
KZ:='0';
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if Trim(canshu1)<>'英寸' then
|
||||||
|
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*StrToFloat(KZ)*1.00/100000
|
||||||
|
else
|
||||||
|
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*2.54*StrToFloat(KZ)*1.00/100000;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.CheckBox1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CheckBox1.Checked=True then
|
||||||
|
begin
|
||||||
|
canshu1:='英寸';
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
canshu1:='';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column31PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FieldName,PriceKg,MF,KZ:string;
|
||||||
|
FReal:Double;
|
||||||
|
begin
|
||||||
|
mvalue:=Trim(TcxTextEdit(Sender).EditingText);
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if TryStrToFloat(mvalue,FReal)=False then
|
||||||
|
FieldByName('PBKZ').Value:=mvalue
|
||||||
|
else
|
||||||
|
FieldByName('PBKZ').Value:=mvalue+'g/㎡';
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column30PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FieldName,PriceKg,MF,KZ:string;
|
||||||
|
FReal:Double;
|
||||||
|
begin
|
||||||
|
mvalue:=Trim(TcxTextEdit(Sender).EditingText);
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if TryStrToFloat(mvalue,FReal)=False then
|
||||||
|
FieldByName('PBMF').Value:=mvalue
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if Trim(canshu1)='英寸' then
|
||||||
|
FieldByName('PBMF').Value:=mvalue+'"'
|
||||||
|
else
|
||||||
|
FieldByName('PBMF').Value:=mvalue+'CM';
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.v1Column32PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
var
|
||||||
|
fsj:string;
|
||||||
|
begin
|
||||||
|
fsj:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='YPJGFactory';
|
||||||
|
flagname:='加工厂/供应商';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(fsj).Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.TBdelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
IF CDS_Sub.IsEmpty then exit;
|
||||||
|
IF trim(CDS_Sub.fieldbyName('CYID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Sub.fieldbyname('CYID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPAdd.TBADDClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
fsj,FFSj:string;
|
||||||
|
begin
|
||||||
|
fsj:=trim(fcpNo);
|
||||||
|
if GetLSNo(ADOQueryCmd,FFSj,fsj,'CP_YDang',3,0)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
CopyAddRow(tv1,CDS_Sub);
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
CDS_Sub.fieldbyName('CYNO').Value:=trim(FFSj);
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
1100
样品/U_CPManage.dfm
Normal file
1100
样品/U_CPManage.dfm
Normal file
File diff suppressed because it is too large
Load Diff
1088
样品/U_CPManage.pas
Normal file
1088
样品/U_CPManage.pas
Normal file
File diff suppressed because it is too large
Load Diff
913
样品/U_CPManageCX.dfm
Normal file
913
样品/U_CPManageCX.dfm
Normal file
|
@ -0,0 +1,913 @@
|
||||||
|
object frmCPManageCX: TfrmCPManageCX
|
||||||
|
Left = -8
|
||||||
|
Top = -8
|
||||||
|
Width = 1382
|
||||||
|
Height = 754
|
||||||
|
Caption = #20135#21697#26723#26696
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnKeyDown = FormKeyDown
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1366
|
||||||
|
Height = 31
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object ToolButton7: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22797#21046
|
||||||
|
ImageIndex = 57
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton7Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 53
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 441
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26631#31614#25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object ToolButton10: TToolButton
|
||||||
|
Left = 528
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26631#31614#39044#35272
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = ToolButton10Click
|
||||||
|
end
|
||||||
|
object ToolButton8: TToolButton
|
||||||
|
Left = 615
|
||||||
|
Top = 0
|
||||||
|
Caption = #26679#21697#20837#24211
|
||||||
|
ImageIndex = 103
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton8Click
|
||||||
|
end
|
||||||
|
object ToolButton9: TToolButton
|
||||||
|
Left = 698
|
||||||
|
Top = 0
|
||||||
|
Caption = #26679#21697#20986#24211
|
||||||
|
ImageIndex = 107
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton9Click
|
||||||
|
end
|
||||||
|
object ToolButton5: TToolButton
|
||||||
|
Left = 781
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22270#29255#19978#20256
|
||||||
|
ImageIndex = 109
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton5Click
|
||||||
|
end
|
||||||
|
object ToolButton6: TToolButton
|
||||||
|
Left = 868
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22270#29255#19979#36733
|
||||||
|
ImageIndex = 104
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton6Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 955
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
object ComboBox1: TComboBox
|
||||||
|
Left = 1018
|
||||||
|
Top = 5
|
||||||
|
Width = 112
|
||||||
|
Height = 20
|
||||||
|
Style = csDropDownList
|
||||||
|
ItemHeight = 12
|
||||||
|
ItemIndex = 0
|
||||||
|
TabOrder = 0
|
||||||
|
Text = #26679#21697#26631#31614
|
||||||
|
Items.Strings = (
|
||||||
|
#26679#21697#26631#31614
|
||||||
|
#26679#21697#26631#31614'1')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxDBTreeList1: TcxDBTreeList
|
||||||
|
Left = 0
|
||||||
|
Top = 89
|
||||||
|
Width = 189
|
||||||
|
Height = 627
|
||||||
|
Align = alLeft
|
||||||
|
Bands = <
|
||||||
|
item
|
||||||
|
end>
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.ParentField = 'CPParent'
|
||||||
|
DataController.KeyField = 'CPID'
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
OptionsBehavior.ExpandOnDblClick = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.CellAutoHeight = True
|
||||||
|
OptionsView.ColumnAutoWidth = True
|
||||||
|
OptionsView.Headers = False
|
||||||
|
RootValue = -1
|
||||||
|
Styles.Inactive = DataLink_YPGL.Red
|
||||||
|
Styles.Selection = DataLink_YPGL.Red
|
||||||
|
Styles.IncSearch = DataLink_YPGL.Red
|
||||||
|
TabOrder = 1
|
||||||
|
OnDblClick = cxDBTreeList1DblClick
|
||||||
|
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
Width = 210
|
||||||
|
Position.ColIndex = 0
|
||||||
|
Position.RowIndex = 0
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Summary.FooterSummaryItems = <>
|
||||||
|
Summary.GroupFooterSummaryItems = <>
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxSplitter1: TcxSplitter
|
||||||
|
Left = 189
|
||||||
|
Top = 89
|
||||||
|
Width = 8
|
||||||
|
Height = 627
|
||||||
|
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||||
|
Control = cxDBTreeList1
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 31
|
||||||
|
Width = 1366
|
||||||
|
Height = 58
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 3
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 16
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #25195#25551#20837#21475
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 361
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #24120#35268#21517#31216
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 471
|
||||||
|
Top = 15
|
||||||
|
Width = 60
|
||||||
|
Height = 12
|
||||||
|
Caption = #20379#24212#21830#32534#21495
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 1247
|
||||||
|
Top = 67
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #32433#25903
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 216
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 1046
|
||||||
|
Top = 16
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #20221#25968
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 615
|
||||||
|
Top = 15
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
end
|
||||||
|
object Label13: TLabel
|
||||||
|
Left = 738
|
||||||
|
Top = 15
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #32769#32534#21495
|
||||||
|
end
|
||||||
|
object Label8: TLabel
|
||||||
|
Left = 866
|
||||||
|
Top = 15
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #35268#26684
|
||||||
|
end
|
||||||
|
object CYID: TEdit
|
||||||
|
Tag = 3
|
||||||
|
Left = 72
|
||||||
|
Top = 11
|
||||||
|
Width = 121
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnKeyPress = CYIDKeyPress
|
||||||
|
end
|
||||||
|
object CYName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 411
|
||||||
|
Top = 11
|
||||||
|
Width = 56
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object DefStr6: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 532
|
||||||
|
Top = 11
|
||||||
|
Width = 59
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object defnote5: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 1273
|
||||||
|
Top = 63
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = defnote5Change
|
||||||
|
end
|
||||||
|
object CYNO: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 262
|
||||||
|
Top = 11
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object Edit1: TEdit
|
||||||
|
Left = 1004
|
||||||
|
Top = 11
|
||||||
|
Width = 38
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object DefStr7: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 649
|
||||||
|
Top = 11
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 6
|
||||||
|
OnChange = defnote5Change
|
||||||
|
end
|
||||||
|
object defstr1: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 776
|
||||||
|
Top = 11
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 7
|
||||||
|
OnChange = defnote5Change
|
||||||
|
end
|
||||||
|
object CYSpec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 892
|
||||||
|
Top = 11
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 8
|
||||||
|
OnChange = defnote5Change
|
||||||
|
end
|
||||||
|
object CheckBox1: TCheckBox
|
||||||
|
Left = 72
|
||||||
|
Top = 36
|
||||||
|
Width = 97
|
||||||
|
Height = 17
|
||||||
|
Caption = #20840#36873
|
||||||
|
TabOrder = 9
|
||||||
|
OnClick = CheckBox1Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel2: TPanel
|
||||||
|
Left = 512
|
||||||
|
Top = 232
|
||||||
|
Width = 193
|
||||||
|
Height = 41
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
|
||||||
|
Color = clSkyBlue
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 4
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object Panel3: TPanel
|
||||||
|
Left = 223
|
||||||
|
Top = 75
|
||||||
|
Width = 1073
|
||||||
|
Height = 609
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Caption = 'Panel3'
|
||||||
|
TabOrder = 5
|
||||||
|
object GroupBox1: TGroupBox
|
||||||
|
Left = 2
|
||||||
|
Top = 412
|
||||||
|
Width = 1069
|
||||||
|
Height = 195
|
||||||
|
Align = alBottom
|
||||||
|
Caption = #26679#21697#32553#30053#22270#65288#21452#20987#22270#29255#26597#30475#21407#22270#65289
|
||||||
|
TabOrder = 0
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = 2
|
||||||
|
Top = 14
|
||||||
|
Width = 1065
|
||||||
|
Height = 179
|
||||||
|
Align = alClient
|
||||||
|
BevelInner = bvLowered
|
||||||
|
BorderStyle = bsNone
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 2
|
||||||
|
Top = 2
|
||||||
|
Width = 1069
|
||||||
|
Height = 410
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
OnKeyDown = Tv1KeyDown
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
Navigator.Buttons.Delete.Enabled = False
|
||||||
|
Navigator.Buttons.Delete.Visible = False
|
||||||
|
OnCellClick = Tv1CellClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Deleting = False
|
||||||
|
OptionsData.DeletingConfirmation = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_YPGL.SHuangSe
|
||||||
|
Styles.IncSearch = DataLink_YPGL.SHuangSe
|
||||||
|
Styles.Selection = DataLink_YPGL.SHuangSe
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
object v1Column19: TcxGridDBColumn
|
||||||
|
Caption = #36873#25321
|
||||||
|
DataBinding.FieldName = 'SSel'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.ImmediatePost = True
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 40
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Caption = #31867#22411
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Caption = #24211#20301#20301#32622
|
||||||
|
DataBinding.FieldName = 'DefStr2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 71
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
DataBinding.FieldName = 'CYNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#21697#21517
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYEName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYCF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYECF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'CYKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'CYMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column42: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColorEng'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column16: TcxGridDBColumn
|
||||||
|
Caption = #33457#22411
|
||||||
|
DataBinding.FieldName = 'CYHX'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column37: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#32463#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr10'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column38: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#32428#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr11'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column39: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#32463#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr12'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column40: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#32428#23494'/CM'
|
||||||
|
DataBinding.FieldName = 'defstr13'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 90
|
||||||
|
end
|
||||||
|
object v1Column17: TcxGridDBColumn
|
||||||
|
Caption = #32769#32534#21495
|
||||||
|
DataBinding.FieldName = 'defstr1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column25: TcxGridDBColumn
|
||||||
|
Caption = #24037#21378#32534#30721
|
||||||
|
DataBinding.FieldName = 'defnote4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column23: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830#32534#21495
|
||||||
|
DataBinding.FieldName = 'DefStr6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column34: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'DefStr7'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Caption = #22270#29255#19978#20256
|
||||||
|
DataBinding.FieldName = 'TPFlag'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #20844#26020#20215
|
||||||
|
DataBinding.FieldName = 'CYPriceKg'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
VisibleForCustomization = False
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Caption = #31859#20215
|
||||||
|
DataBinding.FieldName = 'CYPriceM'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
VisibleForCustomization = False
|
||||||
|
Width = 54
|
||||||
|
end
|
||||||
|
object v1Column26: TcxGridDBColumn
|
||||||
|
Caption = #32553#29575
|
||||||
|
DataBinding.FieldName = 'price1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column27: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#36153
|
||||||
|
DataBinding.FieldName = 'Price2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column28: TcxGridDBColumn
|
||||||
|
Caption = #26579#36153
|
||||||
|
DataBinding.FieldName = 'price3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column18: TcxGridDBColumn
|
||||||
|
Caption = #23494#24230
|
||||||
|
DataBinding.FieldName = 'defstr3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column29: TcxGridDBColumn
|
||||||
|
Caption = 'FOB'#36816#36153'+'#21253#35013
|
||||||
|
DataBinding.FieldName = 'price4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 88
|
||||||
|
end
|
||||||
|
object v1Column31: TcxGridDBColumn
|
||||||
|
Caption = #20215#26684
|
||||||
|
DataBinding.FieldName = 'price6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column30: TcxGridDBColumn
|
||||||
|
Caption = #21518#21152#24037#36153
|
||||||
|
DataBinding.FieldName = 'price5'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column20: TcxGridDBColumn
|
||||||
|
Caption = #32463#32428#25467#24230
|
||||||
|
DataBinding.FieldName = 'defstr4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column21: TcxGridDBColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'Qty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column24: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
DataBinding.FieldName = 'defnote3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column22: TcxGridDBColumn
|
||||||
|
Caption = #32433#25903
|
||||||
|
DataBinding.FieldName = 'defnote5'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column32: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#38376#24133
|
||||||
|
DataBinding.FieldName = 'PBMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column33: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#20811#37325
|
||||||
|
DataBinding.FieldName = 'PBKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column35: TcxGridDBColumn
|
||||||
|
Caption = #21407#26009#32452#25104
|
||||||
|
DataBinding.FieldName = 'DefStr8'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column36: TcxGridDBColumn
|
||||||
|
Caption = #19978#26426#35268#26684
|
||||||
|
DataBinding.FieldName = 'DefStr9'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 80
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'CYNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column41: TcxGridDBColumn
|
||||||
|
Caption = #26469#26679#26085#26399
|
||||||
|
DataBinding.FieldName = 'defnote2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column43: TcxGridDBColumn
|
||||||
|
Caption = #20462#25913#26102#38388
|
||||||
|
DataBinding.FieldName = 'EditTime'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 120
|
||||||
|
end
|
||||||
|
object v1Column44: TcxGridDBColumn
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'defstr14'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column45: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#23494#24230
|
||||||
|
DataBinding.FieldName = 'defstr15'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column46: TcxGridDBColumn
|
||||||
|
Caption = #26579#21378
|
||||||
|
DataBinding.FieldName = 'defstr16'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column47: TcxGridDBColumn
|
||||||
|
Caption = #23458#25143
|
||||||
|
DataBinding.FieldName = 'defstr17'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column48: TcxGridDBColumn
|
||||||
|
Caption = #30331#35760#26102#38388
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryTree
|
||||||
|
Left = 91
|
||||||
|
Top = 147
|
||||||
|
end
|
||||||
|
object ADOQueryTree: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 117
|
||||||
|
Top = 145
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 937
|
||||||
|
Top = 65525
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 893
|
||||||
|
Top = 65525
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 456
|
||||||
|
Top = 184
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 451
|
||||||
|
Top = 155
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 429
|
||||||
|
Top = 185
|
||||||
|
end
|
||||||
|
object CDS_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 392
|
||||||
|
Top = 184
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDB_Main
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 392
|
||||||
|
Top = 152
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDB_Main: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 424
|
||||||
|
Top = 152
|
||||||
|
end
|
||||||
|
object ODPat: TOpenDialog
|
||||||
|
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||||
|
Left = 484
|
||||||
|
Top = 157
|
||||||
|
end
|
||||||
|
object IdFTP1: TIdFTP
|
||||||
|
MaxLineAction = maException
|
||||||
|
ReadTimeout = 0
|
||||||
|
ProxySettings.ProxyType = fpcmNone
|
||||||
|
ProxySettings.Port = 0
|
||||||
|
Left = 485
|
||||||
|
Top = 188
|
||||||
|
end
|
||||||
|
object SaveDialog1: TSaveDialog
|
||||||
|
Left = 521
|
||||||
|
Top = 157
|
||||||
|
end
|
||||||
|
object adoqueryPicture: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 479
|
||||||
|
Top = 256
|
||||||
|
end
|
||||||
|
end
|
824
样品/U_CPManageCX.pas
Normal file
824
样品/U_CPManageCX.pas
Normal file
|
@ -0,0 +1,824 @@
|
||||||
|
unit U_CPManageCX;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||||
|
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||||||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||||||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||||
|
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox,jpeg,U_SLT,
|
||||||
|
cxLookAndFeels, cxLookAndFeelPainters, cxTLdxBarBuiltInMenu, cxNavigator;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCPManageCX = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxDBTreeList1: TcxDBTreeList;
|
||||||
|
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
ADOQueryTree: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
cxSplitter1: TcxSplitter;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label2: TLabel;
|
||||||
|
CYID: TEdit;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
CDS_Main: TClientDataSet;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDB_Main: TRMDBDataSet;
|
||||||
|
ODPat: TOpenDialog;
|
||||||
|
IdFTP1: TIdFTP;
|
||||||
|
SaveDialog1: TSaveDialog;
|
||||||
|
ToolButton5: TToolButton;
|
||||||
|
ToolButton6: TToolButton;
|
||||||
|
ToolButton7: TToolButton;
|
||||||
|
ToolButton8: TToolButton;
|
||||||
|
ToolButton9: TToolButton;
|
||||||
|
Panel2: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
CYName: TEdit;
|
||||||
|
DefStr6: TEdit;
|
||||||
|
defnote5: TEdit;
|
||||||
|
CYNO: TEdit;
|
||||||
|
Edit1: TEdit;
|
||||||
|
Label7: TLabel;
|
||||||
|
DefStr7: TEdit;
|
||||||
|
defstr1: TEdit;
|
||||||
|
Label13: TLabel;
|
||||||
|
ComboBox1: TComboBox;
|
||||||
|
Panel3: TPanel;
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
adoqueryPicture: TADOQuery;
|
||||||
|
ToolButton10: TToolButton;
|
||||||
|
CYSpec: TEdit;
|
||||||
|
Label8: TLabel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column19: TcxGridDBColumn;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column42: TcxGridDBColumn;
|
||||||
|
v1Column16: TcxGridDBColumn;
|
||||||
|
v1Column37: TcxGridDBColumn;
|
||||||
|
v1Column38: TcxGridDBColumn;
|
||||||
|
v1Column39: TcxGridDBColumn;
|
||||||
|
v1Column40: TcxGridDBColumn;
|
||||||
|
v1Column17: TcxGridDBColumn;
|
||||||
|
v1Column25: TcxGridDBColumn;
|
||||||
|
v1Column23: TcxGridDBColumn;
|
||||||
|
v1Column34: TcxGridDBColumn;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
v1Column26: TcxGridDBColumn;
|
||||||
|
v1Column27: TcxGridDBColumn;
|
||||||
|
v1Column28: TcxGridDBColumn;
|
||||||
|
v1Column18: TcxGridDBColumn;
|
||||||
|
v1Column29: TcxGridDBColumn;
|
||||||
|
v1Column31: TcxGridDBColumn;
|
||||||
|
v1Column30: TcxGridDBColumn;
|
||||||
|
v1Column20: TcxGridDBColumn;
|
||||||
|
v1Column21: TcxGridDBColumn;
|
||||||
|
v1Column24: TcxGridDBColumn;
|
||||||
|
v1Column22: TcxGridDBColumn;
|
||||||
|
v1Column32: TcxGridDBColumn;
|
||||||
|
v1Column33: TcxGridDBColumn;
|
||||||
|
v1Column35: TcxGridDBColumn;
|
||||||
|
v1Column36: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
v1Column41: TcxGridDBColumn;
|
||||||
|
v1Column43: TcxGridDBColumn;
|
||||||
|
v1Column44: TcxGridDBColumn;
|
||||||
|
v1Column45: TcxGridDBColumn;
|
||||||
|
v1Column46: TcxGridDBColumn;
|
||||||
|
v1Column47: TcxGridDBColumn;
|
||||||
|
v1Column48: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
CheckBox1: TCheckBox;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure CYNoChange(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure ToolButton5Click(Sender: TObject);
|
||||||
|
procedure ToolButton6Click(Sender: TObject);
|
||||||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
procedure Tv1KeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
procedure ToolButton7Click(Sender: TObject);
|
||||||
|
procedure ToolButton8Click(Sender: TObject);
|
||||||
|
procedure ToolButton9Click(Sender: TObject);
|
||||||
|
procedure defnote5Change(Sender: TObject);
|
||||||
|
procedure ToolButton10Click(Sender: TObject);
|
||||||
|
procedure CheckBox1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
CPID:string;
|
||||||
|
PState:Integer;
|
||||||
|
FCPID,FTopID:String;
|
||||||
|
procedure InitTree();
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure ReadINIFile();
|
||||||
|
procedure InitImage();
|
||||||
|
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmCPManageCX: TfrmCPManageCX;
|
||||||
|
Mach: array of TfrmSlt;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_CPAdd,U_FileUp,U_YPCR;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.InitImage();
|
||||||
|
var
|
||||||
|
i,j:integer;
|
||||||
|
jpg:TJpegImage;
|
||||||
|
myStream: TADOBlobStream;
|
||||||
|
begin
|
||||||
|
|
||||||
|
j:=length(Mach);
|
||||||
|
if j>0 then
|
||||||
|
begin
|
||||||
|
for i:=0 to j-1 do
|
||||||
|
begin
|
||||||
|
Mach[i].free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
SetLength(Mach, 0);
|
||||||
|
|
||||||
|
try
|
||||||
|
with adoqueryPicture do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select A.TFID,A.WBID,A.FilesOther,B.FileName from TP_File A,XD_File B where A.TFID =B.XFID and A.WBID='+quotedstr(trim(CDS_Main.fieldbyname('CYID').AsString)));
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
j:=adoqueryPicture.RecordCount;
|
||||||
|
if j<1 then exit;
|
||||||
|
adoqueryPicture.DisableControls;
|
||||||
|
adoqueryPicture.First;
|
||||||
|
SetLength(Mach, j);
|
||||||
|
jpg:=TJpegImage.Create();
|
||||||
|
for i:=0 to j-1 do
|
||||||
|
begin
|
||||||
|
if triM(adoqueryPicture.fieldbyname('FilesOther').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
myStream:=tadoblobstream.Create(tblobfield(adoqueryPicture.fieldbyname('FilesOther')),bmread);
|
||||||
|
jpg.LoadFromStream(myStream);
|
||||||
|
Mach[i] := TfrmSlt.Create(Self);
|
||||||
|
Mach[i].Name:=trim(adoqueryPicture.fieldbyname('TFID').AsString);
|
||||||
|
Mach[i].Parent := ScrollBox1;
|
||||||
|
Mach[I].Left:=0+i*165;
|
||||||
|
Mach[i].Init(adoqueryPicture.fieldbyname('TFID').AsString,adoqueryPicture.fieldbyname('FileName').AsString,jpg);
|
||||||
|
end;
|
||||||
|
adoqueryPicture.Next;
|
||||||
|
end;
|
||||||
|
adoqueryPicture.EnableControls;
|
||||||
|
finally
|
||||||
|
jpg.free;
|
||||||
|
application.ProcessMessages;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.InitTree();
|
||||||
|
var
|
||||||
|
i:Integer;
|
||||||
|
begin
|
||||||
|
with ADOQueryTree do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
cxDBTreeList1.Items[0].Expand(false);
|
||||||
|
//cxDBTreeList1.Items[1].Expand(False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.InitGrid();
|
||||||
|
begin
|
||||||
|
Panel2.Visible:=True;
|
||||||
|
Panel2.Refresh;
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
||||||
|
Parameters.ParamByName('Code').Value:='';
|
||||||
|
Parameters.ParamByName('PState').Value:=0;
|
||||||
|
Parameters.ParamByName('CYType').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
Panel2.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmCPManageCX:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
var
|
||||||
|
i,j:integer;
|
||||||
|
begin
|
||||||
|
j:=length(Mach);
|
||||||
|
if j>0 then
|
||||||
|
begin
|
||||||
|
for i:=0 to j-1 do
|
||||||
|
begin
|
||||||
|
Mach[i].free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
SetLength(Mach, 0);
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid('样品列表查询',Tv1,'样品管理');
|
||||||
|
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||||
|
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmCPManageCX.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CDS_Main.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Panel3.Align:=alclient;
|
||||||
|
InitTree();
|
||||||
|
ReadCxGrid('样品列表查询',Tv1,'样品管理');
|
||||||
|
if DParameters1='1' then
|
||||||
|
begin
|
||||||
|
TBAdd.Visible:=False;
|
||||||
|
TBDel.Visible:=False;
|
||||||
|
ToolButton3.Visible:=False;
|
||||||
|
ToolButton5.Visible:=False;
|
||||||
|
end;
|
||||||
|
//InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.cxDBTreeList1DblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||||
|
with frmCPAdd do
|
||||||
|
begin
|
||||||
|
CopyInt:=0;
|
||||||
|
FCYID:='';
|
||||||
|
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmCPAdd.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||||
|
with frmCPAdd do
|
||||||
|
begin
|
||||||
|
CopyInt:=0;
|
||||||
|
FCYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.CDS_Main.Locate('CYID',FCYID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmCPAdd.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYID='''+Trim(CYID.Text)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
CPID:=Trim(ADOQueryTemp.fieldbyname('CYType').AsString);
|
||||||
|
if Trim(CYID.Text)='' then Exit;
|
||||||
|
SDofilter(ADOQueryMain,' CYID='''+Trim(CYID.Text)+''' ');
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
CYID.Text:='';
|
||||||
|
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.CYNoChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// if Length(Trim(CYNO.Text))<4 then Exit;
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('样品档案',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile,FFCYID:string;
|
||||||
|
DPS,i,j:Integer;
|
||||||
|
Txt,fImagePath:string;
|
||||||
|
Moudle: THandle;
|
||||||
|
Makebar:TMakebar;
|
||||||
|
Mixtext:TMixtext;
|
||||||
|
begin
|
||||||
|
CYID.SetFocus;
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
//if CDS_CYNO.IsEmpty then Exit;
|
||||||
|
IF trim(ComboBox1.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('样品标签不能为空!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if Trim(Edit1.Text)<>'' then
|
||||||
|
begin
|
||||||
|
if TryStrToInt(Edit1.Text,i)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('份数录入错误!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+trim(ComboBox1.Text)+'.rmf';
|
||||||
|
CDS_Main.DisableControls;
|
||||||
|
DPS:=0;
|
||||||
|
FFCYID:='';
|
||||||
|
|
||||||
|
with CDS_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||||
|
begin
|
||||||
|
sleep(200);
|
||||||
|
try
|
||||||
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||||
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||||
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||||
|
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
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;
|
||||||
|
RMVariables['QRBARCODE']:=fImagePath;
|
||||||
|
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.DefaultCopies:=strtointdef(trim(Edit1.Text),1);
|
||||||
|
RM1.PrintReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if DPS=0 then
|
||||||
|
begin
|
||||||
|
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||||
|
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Main.EnableControls;
|
||||||
|
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||||
|
Edit1.Text:='1';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton5Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmFileUp:=TfrmFileUp.Create(Application);
|
||||||
|
with frmFileUp do
|
||||||
|
begin
|
||||||
|
Code.Text:=Trim(Self.CDS_Main.fieldbyname('CYNO').AsString);
|
||||||
|
CYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.CDS_Main.Locate('CYID',CYID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmFileUp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton6Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fHandle:THandle;
|
||||||
|
FInt:Integer;
|
||||||
|
FFName,FPath:String;
|
||||||
|
begin
|
||||||
|
{FPath:='C:\HTTP1209\';
|
||||||
|
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||||
|
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from XD_File where CYNO='''+Trim(CDS_Main.fieldbyname('CYNO').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if IsEmpty then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('样品图片未上传!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
try
|
||||||
|
ReadINIFile();
|
||||||
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||||
|
if Length(server)<6 then
|
||||||
|
begin
|
||||||
|
server:='127.0.0.1';
|
||||||
|
end;
|
||||||
|
IdFTP1.Host :=server;//PicSvr;
|
||||||
|
IdFTP1.Username := 'three';
|
||||||
|
IdFTP1.Password := '641010';
|
||||||
|
IdFTP1.Connect();
|
||||||
|
except
|
||||||
|
IdFTP1.Quit;
|
||||||
|
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
FPath:='D:\Right1209\';
|
||||||
|
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||||
|
CreateDir(ExtractFileDir(FPath));
|
||||||
|
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||||
|
FFName:=FPath+FFName;
|
||||||
|
if FileExists(FFName) then
|
||||||
|
begin
|
||||||
|
FInt:=1;
|
||||||
|
end;
|
||||||
|
if FInt<>1 then
|
||||||
|
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||||
|
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||||
|
);
|
||||||
|
if IdFTP1.Connected then IdFTP1.Quit;
|
||||||
|
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
end;
|
||||||
|
procedure TfrmCPManageCX.ReadINIFile();
|
||||||
|
var
|
||||||
|
programIni:Tinifile; //配置文件名
|
||||||
|
FileName:string;
|
||||||
|
begin
|
||||||
|
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
||||||
|
programIni:=Tinifile.create(FileName);
|
||||||
|
server:=programIni.ReadString('SERVER','服务器地址','127.0.0.1');
|
||||||
|
programIni.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
{ with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').asstring)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
CPID:=Trim(ADOQueryTemp.fieldbyname('CYType').AsString);
|
||||||
|
ADOQueryTree.Locate('CPID',CPID,[]); }
|
||||||
|
initimage();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
{if Key= then
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定6666要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CDS_Main.Delete;
|
||||||
|
end; }
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.Tv1KeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Key=46 then
|
||||||
|
begin
|
||||||
|
TBDel.Click;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton7Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||||
|
with frmCPAdd do
|
||||||
|
begin
|
||||||
|
CopyInt:=1;
|
||||||
|
FCYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.CDS_Main.Locate('CYID',FCYID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmCPAdd.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton8Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmYPCR:=TfrmYPCR.Create(Application);
|
||||||
|
with frmYPCR do
|
||||||
|
begin
|
||||||
|
FCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
RKFlag:='入库';
|
||||||
|
frmYPCR.InitGrid();
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('CYID').Value:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
FieldByName('CYName').Value:=Trim(CDS_Main.fieldbyname('CYName').AsString);
|
||||||
|
FieldByName('CYSpec').Value:=Trim(CDS_Main.fieldbyname('CYSpec').AsString);
|
||||||
|
FieldByName('KCUnit').Value:=Trim(CDS_Main.fieldbyname('KCUnit').AsString);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
frmYPCR.SaveData();
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmYPCR.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton9Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmYPCR:=TfrmYPCR.Create(Application);
|
||||||
|
with frmYPCR do
|
||||||
|
begin
|
||||||
|
FCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
RKFlag:='出库';
|
||||||
|
frmYPCR.InitGrid();
|
||||||
|
frmYPCR.cxGridDBColumn1.Caption:='出库日期';
|
||||||
|
frmYPCR.cxGridDBColumn5.Caption:='出库数量';
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('CYID').Value:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
FieldByName('CYName').Value:=Trim(CDS_Main.fieldbyname('CYName').AsString);
|
||||||
|
FieldByName('CYSpec').Value:=Trim(CDS_Main.fieldbyname('CYSpec').AsString);
|
||||||
|
FieldByName('KCUnit').Value:=Trim(CDS_Main.fieldbyname('KCUnit').AsString);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
frmYPCR.SaveData();
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmYPCR.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.defnote5Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.ToolButton10Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile,FFCYID:string;
|
||||||
|
DPS,i,j:Integer;
|
||||||
|
Txt,fImagePath:string;
|
||||||
|
Moudle: THandle;
|
||||||
|
Makebar:TMakebar;
|
||||||
|
Mixtext:TMixtext;
|
||||||
|
begin
|
||||||
|
CYID.SetFocus;
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
//if CDS_CYNO.IsEmpty then Exit;
|
||||||
|
IF trim(ComboBox1.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('样品标签不能为空!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if Trim(Edit1.Text)<>'' then
|
||||||
|
begin
|
||||||
|
if TryStrToInt(Edit1.Text,i)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('份数录入错误!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+trim(ComboBox1.Text)+'.rmf';
|
||||||
|
CDS_Main.DisableControls;
|
||||||
|
DPS:=0;
|
||||||
|
FFCYID:='';
|
||||||
|
|
||||||
|
with CDS_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if CDS_Main.FieldByName('SSel').AsBoolean then
|
||||||
|
begin
|
||||||
|
sleep(200);
|
||||||
|
try
|
||||||
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||||
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||||
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||||
|
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
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;
|
||||||
|
RMVariables['QRBARCODE']:=fImagePath;
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.DefaultCopies:=strtointdef(trim(Edit1.Text),1);
|
||||||
|
// RM1.PrintReport;
|
||||||
|
RM1.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if DPS=0 then
|
||||||
|
begin
|
||||||
|
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||||
|
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Main.EnableControls;
|
||||||
|
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||||
|
Edit1.Text:='1';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageCX.CheckBox1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SelOKNo(CDS_Main,checkbox1.Checked);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
703
样品/U_CPManageSel.dfm
Normal file
703
样品/U_CPManageSel.dfm
Normal file
|
@ -0,0 +1,703 @@
|
||||||
|
object frmCPManageSel: TfrmCPManageSel
|
||||||
|
Left = -8
|
||||||
|
Top = -8
|
||||||
|
Width = 1382
|
||||||
|
Height = 754
|
||||||
|
Caption = #20135#21697#21015#34920
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnKeyDown = FormKeyDown
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1366
|
||||||
|
Height = 31
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton7: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #30830#23450
|
||||||
|
ImageIndex = 57
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 53
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26631#31614#25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 339
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
object ComboBox1: TComboBox
|
||||||
|
Left = 402
|
||||||
|
Top = 5
|
||||||
|
Width = 112
|
||||||
|
Height = 20
|
||||||
|
Style = csDropDownList
|
||||||
|
ItemHeight = 12
|
||||||
|
ItemIndex = 0
|
||||||
|
TabOrder = 0
|
||||||
|
Text = #26679#21697#26631#31614
|
||||||
|
Visible = False
|
||||||
|
Items.Strings = (
|
||||||
|
#26679#21697#26631#31614
|
||||||
|
#26679#21697#26631#31614'1')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxDBTreeList1: TcxDBTreeList
|
||||||
|
Left = 0
|
||||||
|
Top = 73
|
||||||
|
Width = 121
|
||||||
|
Height = 643
|
||||||
|
Align = alLeft
|
||||||
|
Bands = <
|
||||||
|
item
|
||||||
|
end>
|
||||||
|
BufferedPaint = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.ParentField = 'CPParent'
|
||||||
|
DataController.KeyField = 'CPID'
|
||||||
|
OptionsBehavior.ExpandOnDblClick = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.CellAutoHeight = True
|
||||||
|
OptionsView.Headers = False
|
||||||
|
RootValue = -1
|
||||||
|
Styles.Inactive = DataLink_YPGL.Red
|
||||||
|
Styles.Selection = DataLink_YPGL.Red
|
||||||
|
Styles.IncSearch = DataLink_YPGL.Red
|
||||||
|
TabOrder = 1
|
||||||
|
OnDblClick = cxDBTreeList1DblClick
|
||||||
|
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
Width = 210
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
Position.BandIndex = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxSplitter1: TcxSplitter
|
||||||
|
Left = 121
|
||||||
|
Top = 73
|
||||||
|
Width = 8
|
||||||
|
Height = 643
|
||||||
|
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||||
|
Control = cxDBTreeList1
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 31
|
||||||
|
Width = 1366
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 3
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 12
|
||||||
|
Top = 55
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #25195#25551#20837#21475
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 177
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 295
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 419
|
||||||
|
Top = 15
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #35268#26684
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 32
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 1046
|
||||||
|
Top = 48
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #20221#25968
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 539
|
||||||
|
Top = 15
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #20811#37325
|
||||||
|
end
|
||||||
|
object Label13: TLabel
|
||||||
|
Left = 842
|
||||||
|
Top = 15
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #32769#32534#21495
|
||||||
|
end
|
||||||
|
object CYID: TEdit
|
||||||
|
Tag = 3
|
||||||
|
Left = 60
|
||||||
|
Top = 51
|
||||||
|
Width = 121
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnKeyPress = CYIDKeyPress
|
||||||
|
end
|
||||||
|
object CYName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 227
|
||||||
|
Top = 11
|
||||||
|
Width = 56
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object CYEName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 344
|
||||||
|
Top = 11
|
||||||
|
Width = 59
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object CYSpec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 445
|
||||||
|
Top = 11
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = CYSpecChange
|
||||||
|
end
|
||||||
|
object CYNO: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 78
|
||||||
|
Top = 11
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object Edit1: TEdit
|
||||||
|
Left = 1004
|
||||||
|
Top = 43
|
||||||
|
Width = 38
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object CYKZ: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 565
|
||||||
|
Top = 11
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 6
|
||||||
|
OnChange = CYSpecChange
|
||||||
|
end
|
||||||
|
object defstr1: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 880
|
||||||
|
Top = 11
|
||||||
|
Width = 76
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 7
|
||||||
|
OnChange = CYSpecChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel2: TPanel
|
||||||
|
Left = 512
|
||||||
|
Top = 232
|
||||||
|
Width = 193
|
||||||
|
Height = 41
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
|
||||||
|
Color = clSkyBlue
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 4
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object Panel3: TPanel
|
||||||
|
Left = 127
|
||||||
|
Top = 83
|
||||||
|
Width = 1073
|
||||||
|
Height = 609
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Caption = 'Panel3'
|
||||||
|
TabOrder = 5
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 2
|
||||||
|
Top = 2
|
||||||
|
Width = 1069
|
||||||
|
Height = 410
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
NavigatorButtons.Delete.Enabled = False
|
||||||
|
NavigatorButtons.Delete.Visible = False
|
||||||
|
OnCellClick = Tv1CellClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Deleting = False
|
||||||
|
OptionsData.DeletingConfirmation = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_YPGL.SHuangSe
|
||||||
|
Styles.IncSearch = DataLink_YPGL.SHuangSe
|
||||||
|
Styles.Selection = DataLink_YPGL.SHuangSe
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
object v1Column19: TcxGridDBColumn
|
||||||
|
Caption = #36873#25321
|
||||||
|
DataBinding.FieldName = 'SSel'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.ImmediatePost = True
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 40
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Caption = #31867#21035
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Caption = #38472#21015#20301#32622
|
||||||
|
DataBinding.FieldName = 'DefStr2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 71
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
DataBinding.FieldName = 'CYNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYCF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYEName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYECF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#20811#37325
|
||||||
|
DataBinding.FieldName = 'CYKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#38376#24133
|
||||||
|
DataBinding.FieldName = 'CYMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1Column16: TcxGridDBColumn
|
||||||
|
Caption = #33457#22411
|
||||||
|
DataBinding.FieldName = 'CYHX'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column42: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColorEng'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'CYNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Caption = #22270#29255#19978#20256
|
||||||
|
DataBinding.FieldName = 'TPFlag'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #20844#26020#20215
|
||||||
|
DataBinding.FieldName = 'CYPriceKg'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Hidden = True
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Caption = #31859#20215
|
||||||
|
DataBinding.FieldName = 'CYPriceM'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Hidden = True
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 54
|
||||||
|
end
|
||||||
|
object v1Column17: TcxGridDBColumn
|
||||||
|
Caption = #32769#32534#21495
|
||||||
|
DataBinding.FieldName = 'defstr1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column18: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#23494#24230
|
||||||
|
DataBinding.FieldName = 'defstr3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column20: TcxGridDBColumn
|
||||||
|
Caption = #32463#32428#25467#24230
|
||||||
|
DataBinding.FieldName = 'defstr4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column21: TcxGridDBColumn
|
||||||
|
Caption = #25346#38057#25968
|
||||||
|
DataBinding.FieldName = 'defstr5'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column24: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#26469#28304
|
||||||
|
DataBinding.FieldName = 'defnote3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column25: TcxGridDBColumn
|
||||||
|
Caption = #26222#36890#26469#28304
|
||||||
|
DataBinding.FieldName = 'defnote4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column26: TcxGridDBColumn
|
||||||
|
Caption = #32553#29575
|
||||||
|
DataBinding.FieldName = 'price1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column27: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#36153
|
||||||
|
DataBinding.FieldName = 'Price2'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column28: TcxGridDBColumn
|
||||||
|
Caption = #26579#36153
|
||||||
|
DataBinding.FieldName = 'price3'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column29: TcxGridDBColumn
|
||||||
|
Caption = 'FOB'#36816#36153'+'#21253#35013
|
||||||
|
DataBinding.FieldName = 'price4'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 88
|
||||||
|
end
|
||||||
|
object v1Column30: TcxGridDBColumn
|
||||||
|
Caption = #21518#21152#24037#36153
|
||||||
|
DataBinding.FieldName = 'price5'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column31: TcxGridDBColumn
|
||||||
|
Caption = #21442#32771#20215
|
||||||
|
DataBinding.FieldName = 'price6'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column32: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#38376#24133
|
||||||
|
DataBinding.FieldName = 'PBMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column33: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#20811#37325
|
||||||
|
DataBinding.FieldName = 'PBKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object GroupBox1: TGroupBox
|
||||||
|
Left = 2
|
||||||
|
Top = 412
|
||||||
|
Width = 1069
|
||||||
|
Height = 195
|
||||||
|
Align = alBottom
|
||||||
|
Caption = #26679#21697#32553#30053#22270#65288#21452#20987#22270#29255#26597#30475#21407#22270#65289
|
||||||
|
TabOrder = 1
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = 2
|
||||||
|
Top = 14
|
||||||
|
Width = 1065
|
||||||
|
Height = 179
|
||||||
|
Align = alClient
|
||||||
|
BevelInner = bvLowered
|
||||||
|
BorderStyle = bsNone
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryTree
|
||||||
|
Left = 91
|
||||||
|
Top = 147
|
||||||
|
end
|
||||||
|
object ADOQueryTree: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 117
|
||||||
|
Top = 145
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 909
|
||||||
|
Top = 17
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 877
|
||||||
|
Top = 17
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 456
|
||||||
|
Top = 184
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 451
|
||||||
|
Top = 155
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 429
|
||||||
|
Top = 185
|
||||||
|
end
|
||||||
|
object CDS_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 392
|
||||||
|
Top = 184
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDB_Main
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 392
|
||||||
|
Top = 152
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDB_Main: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 424
|
||||||
|
Top = 152
|
||||||
|
end
|
||||||
|
object ODPat: TOpenDialog
|
||||||
|
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||||
|
Left = 484
|
||||||
|
Top = 157
|
||||||
|
end
|
||||||
|
object IdFTP1: TIdFTP
|
||||||
|
MaxLineAction = maException
|
||||||
|
ReadTimeout = 0
|
||||||
|
ProxySettings.ProxyType = fpcmNone
|
||||||
|
ProxySettings.Port = 0
|
||||||
|
Left = 485
|
||||||
|
Top = 188
|
||||||
|
end
|
||||||
|
object SaveDialog1: TSaveDialog
|
||||||
|
Left = 521
|
||||||
|
Top = 157
|
||||||
|
end
|
||||||
|
object adoqueryPicture: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 479
|
||||||
|
Top = 256
|
||||||
|
end
|
||||||
|
end
|
475
样品/U_CPManageSel.pas
Normal file
475
样品/U_CPManageSel.pas
Normal file
|
@ -0,0 +1,475 @@
|
||||||
|
unit U_CPManageSel;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||||
|
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||||||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||||||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||||
|
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox,jpeg,U_SLT;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCPManageSel = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxDBTreeList1: TcxDBTreeList;
|
||||||
|
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
ADOQueryTree: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
cxSplitter1: TcxSplitter;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label2: TLabel;
|
||||||
|
CYID: TEdit;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
CDS_Main: TClientDataSet;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDB_Main: TRMDBDataSet;
|
||||||
|
ODPat: TOpenDialog;
|
||||||
|
IdFTP1: TIdFTP;
|
||||||
|
SaveDialog1: TSaveDialog;
|
||||||
|
ToolButton7: TToolButton;
|
||||||
|
Panel2: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
CYName: TEdit;
|
||||||
|
CYEName: TEdit;
|
||||||
|
CYSpec: TEdit;
|
||||||
|
CYNO: TEdit;
|
||||||
|
Edit1: TEdit;
|
||||||
|
Label7: TLabel;
|
||||||
|
CYKZ: TEdit;
|
||||||
|
defstr1: TEdit;
|
||||||
|
Label13: TLabel;
|
||||||
|
ComboBox1: TComboBox;
|
||||||
|
Panel3: TPanel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column19: TcxGridDBColumn;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column16: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column42: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
v1Column17: TcxGridDBColumn;
|
||||||
|
v1Column18: TcxGridDBColumn;
|
||||||
|
v1Column20: TcxGridDBColumn;
|
||||||
|
v1Column21: TcxGridDBColumn;
|
||||||
|
v1Column24: TcxGridDBColumn;
|
||||||
|
v1Column25: TcxGridDBColumn;
|
||||||
|
v1Column26: TcxGridDBColumn;
|
||||||
|
v1Column27: TcxGridDBColumn;
|
||||||
|
v1Column28: TcxGridDBColumn;
|
||||||
|
v1Column29: TcxGridDBColumn;
|
||||||
|
v1Column30: TcxGridDBColumn;
|
||||||
|
v1Column31: TcxGridDBColumn;
|
||||||
|
v1Column32: TcxGridDBColumn;
|
||||||
|
v1Column33: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
GroupBox1: TGroupBox;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
adoqueryPicture: TADOQuery;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure CYNoChange(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
procedure CYSpecChange(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
CPID:string;
|
||||||
|
PState:Integer;
|
||||||
|
FCPID,FTopID:String;
|
||||||
|
procedure InitTree();
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure ReadINIFile();
|
||||||
|
procedure InitImage();
|
||||||
|
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmCPManageSel: TfrmCPManageSel;
|
||||||
|
Mach: array of TfrmSlt;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.InitImage();
|
||||||
|
var
|
||||||
|
i,j:integer;
|
||||||
|
jpg:TJpegImage;
|
||||||
|
myStream: TADOBlobStream;
|
||||||
|
begin
|
||||||
|
|
||||||
|
j:=length(Mach);
|
||||||
|
if j>0 then
|
||||||
|
begin
|
||||||
|
for i:=0 to j-1 do
|
||||||
|
begin
|
||||||
|
Mach[i].free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
SetLength(Mach, 0);
|
||||||
|
|
||||||
|
try
|
||||||
|
with adoqueryPicture do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select A.TFID,A.WBID,A.FilesOther,B.FileName from TP_File A,XD_File B where A.TFID =B.XFID and A.WBID='+quotedstr(trim(CDS_Main.fieldbyname('CYID').AsString)));
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
j:=adoqueryPicture.RecordCount;
|
||||||
|
if j<1 then exit;
|
||||||
|
adoqueryPicture.DisableControls;
|
||||||
|
adoqueryPicture.First;
|
||||||
|
SetLength(Mach, j);
|
||||||
|
jpg:=TJpegImage.Create();
|
||||||
|
for i:=0 to j-1 do
|
||||||
|
begin
|
||||||
|
if triM(adoqueryPicture.fieldbyname('FilesOther').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
myStream:=tadoblobstream.Create(tblobfield(adoqueryPicture.fieldbyname('FilesOther')),bmread);
|
||||||
|
jpg.LoadFromStream(myStream);
|
||||||
|
Mach[i] := TfrmSlt.Create(Self);
|
||||||
|
Mach[i].Name:=trim(adoqueryPicture.fieldbyname('TFID').AsString);
|
||||||
|
Mach[i].Parent := ScrollBox1;
|
||||||
|
Mach[I].Left:=0+i*165;
|
||||||
|
Mach[i].Init(adoqueryPicture.fieldbyname('TFID').AsString,adoqueryPicture.fieldbyname('FileName').AsString,jpg);
|
||||||
|
end;
|
||||||
|
adoqueryPicture.Next;
|
||||||
|
end;
|
||||||
|
adoqueryPicture.EnableControls;
|
||||||
|
finally
|
||||||
|
jpg.free;
|
||||||
|
application.ProcessMessages;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.InitTree();
|
||||||
|
var
|
||||||
|
i:Integer;
|
||||||
|
begin
|
||||||
|
with ADOQueryTree do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
cxDBTreeList1.Items[0].Expand(false);
|
||||||
|
//cxDBTreeList1.Items[1].Expand(False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.InitGrid();
|
||||||
|
begin
|
||||||
|
Panel2.Visible:=True;
|
||||||
|
Panel2.Refresh;
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
||||||
|
Parameters.ParamByName('Code').Value:='';
|
||||||
|
Parameters.ParamByName('PState').Value:=0;
|
||||||
|
Parameters.ParamByName('CYType').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
Panel2.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmCPManageSel:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
var
|
||||||
|
i,j:integer;
|
||||||
|
begin
|
||||||
|
j:=length(Mach);
|
||||||
|
if j>0 then
|
||||||
|
begin
|
||||||
|
for i:=0 to j-1 do
|
||||||
|
begin
|
||||||
|
Mach[i].free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
SetLength(Mach, 0);
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid(self.Caption,Tv1,'样品管理');
|
||||||
|
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||||
|
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmCPManageSel.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Panel3.Align:=alclient;
|
||||||
|
InitTree();
|
||||||
|
ReadCxGrid(self.Caption,Tv1,'样品管理');
|
||||||
|
//InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.cxDBTreeList1DblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYID='''+Trim(CYID.Text)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
CPID:=Trim(ADOQueryTemp.fieldbyname('CYType').AsString);
|
||||||
|
if Trim(CYID.Text)='' then Exit;
|
||||||
|
SDofilter(ADOQueryMain,' CYID='''+Trim(CYID.Text)+''' ');
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
CYID.Text:='';
|
||||||
|
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.CYNoChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// if Length(Trim(CYNO.Text))<4 then Exit;
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('样品档案',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.ToolButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile,FFCYID:string;
|
||||||
|
DPS,i,j:Integer;
|
||||||
|
Txt,fImagePath:string;
|
||||||
|
Moudle: THandle;
|
||||||
|
Makebar:TMakebar;
|
||||||
|
Mixtext:TMixtext;
|
||||||
|
begin
|
||||||
|
CYID.SetFocus;
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
//if CDS_CYNO.IsEmpty then Exit;
|
||||||
|
IF trim(ComboBox1.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('样品标签不能为空!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if Trim(Edit1.Text)<>'' then
|
||||||
|
begin
|
||||||
|
if TryStrToInt(Edit1.Text,i)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('份数录入错误!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+trim(ComboBox1.Text)+'.rmf';
|
||||||
|
CDS_Main.DisableControls;
|
||||||
|
DPS:=0;
|
||||||
|
FFCYID:='';
|
||||||
|
i:=1;
|
||||||
|
if Trim(Edit1.Text)='' then
|
||||||
|
begin
|
||||||
|
j:=1;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
j:=StrToInt(Edit1.Text);
|
||||||
|
end;
|
||||||
|
with CDS_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||||
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||||
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||||
|
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
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;
|
||||||
|
RMVariables['QRBARCODE']:=fImagePath;
|
||||||
|
for i:=1 to j do
|
||||||
|
begin
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.PrintReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if DPS=0 then
|
||||||
|
begin
|
||||||
|
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||||
|
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Main.EnableControls;
|
||||||
|
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||||
|
Edit1.Text:='1';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.ReadINIFile();
|
||||||
|
var
|
||||||
|
programIni:Tinifile; //配置文件名
|
||||||
|
FileName:string;
|
||||||
|
begin
|
||||||
|
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
||||||
|
programIni:=Tinifile.create(FileName);
|
||||||
|
server:=programIni.ReadString('SERVER','服务器地址','127.0.0.1');
|
||||||
|
programIni.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
{ with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').asstring)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
CPID:=Trim(ADOQueryTemp.fieldbyname('CYType').AsString);
|
||||||
|
ADOQueryTree.Locate('CPID',CPID,[]); }
|
||||||
|
initimage();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
{if Key= then
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定6666要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CDS_Main.Delete;
|
||||||
|
end; }
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPManageSel.CYSpecChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
183
样品/U_CPType.dfm
Normal file
183
样品/U_CPType.dfm
Normal file
|
@ -0,0 +1,183 @@
|
||||||
|
object frmCPType: TfrmCPType
|
||||||
|
Left = 281
|
||||||
|
Top = 184
|
||||||
|
Width = 870
|
||||||
|
Height = 505
|
||||||
|
Caption = #20135#21697#31867#21035
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 862
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686#23376#31867
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 150
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 14
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 213
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 276
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxDBTreeList1: TcxDBTreeList
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 249
|
||||||
|
Height = 435
|
||||||
|
Align = alLeft
|
||||||
|
Bands = <
|
||||||
|
item
|
||||||
|
end>
|
||||||
|
BufferedPaint = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.ParentField = 'CPParent'
|
||||||
|
DataController.KeyField = 'CPID'
|
||||||
|
OptionsBehavior.ExpandOnDblClick = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.CellAutoHeight = True
|
||||||
|
OptionsView.Headers = False
|
||||||
|
RootValue = -1
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = cxDBTreeList1Click
|
||||||
|
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
Width = 210
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
Position.BandIndex = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 270
|
||||||
|
Top = 54
|
||||||
|
Width = 315
|
||||||
|
Height = 150
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 2
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 66
|
||||||
|
Top = 24
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #29238' '#31867
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 66
|
||||||
|
Top = 65
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #31867#21035#21517#31216
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 66
|
||||||
|
Top = 105
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #31867#21035#32534#30721
|
||||||
|
end
|
||||||
|
object CPTopName: TEdit
|
||||||
|
Left = 129
|
||||||
|
Top = 21
|
||||||
|
Width = 121
|
||||||
|
Height = 20
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object CPName: TEdit
|
||||||
|
Left = 129
|
||||||
|
Top = 61
|
||||||
|
Width = 121
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnKeyPress = CPNameKeyPress
|
||||||
|
end
|
||||||
|
object CPNo: TEdit
|
||||||
|
Left = 129
|
||||||
|
Top = 101
|
||||||
|
Width = 121
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryTree
|
||||||
|
Left = 91
|
||||||
|
Top = 147
|
||||||
|
end
|
||||||
|
object ADOQueryTree: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 117
|
||||||
|
Top = 145
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 709
|
||||||
|
Top = 209
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 677
|
||||||
|
Top = 137
|
||||||
|
end
|
||||||
|
end
|
239
样品/U_CPType.pas
Normal file
239
样品/U_CPType.pas
Normal file
|
@ -0,0 +1,239 @@
|
||||||
|
unit U_CPType;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||||
|
StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmCPType = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxDBTreeList1: TcxDBTreeList;
|
||||||
|
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
ADOQueryTree: TADOQuery;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
CPTopName: TEdit;
|
||||||
|
CPName: TEdit;
|
||||||
|
CPNo: TEdit;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure cxDBTreeList1Click(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure CPNameKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
PState:Integer;
|
||||||
|
FCPID,FTopID:String;
|
||||||
|
procedure InitTree();
|
||||||
|
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmCPType: TfrmCPType;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmCPType.InitTree();
|
||||||
|
var
|
||||||
|
i:Integer;
|
||||||
|
begin
|
||||||
|
with ADOQueryTree do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
cxDBTreeList1.Items[0].Expand(false);
|
||||||
|
//cxDBTreeList1.Items[1].Expand(False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmCPType:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitTree();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
PState:=11;
|
||||||
|
CPTopName.Text:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||||
|
//FTopID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
FCPID:='';
|
||||||
|
CPName.Text:='';
|
||||||
|
CPNo.Text:='';
|
||||||
|
CPName.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.cxDBTreeList1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
PState:=22;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_Type where CPID='''+Trim(ADOQueryTree.fieldbyname('CPParent').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
FCPID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
CPTopName.Text:=Trim(ADOQueryTemp.fieldbyname('CPName').AsString);
|
||||||
|
CPName.Text:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||||
|
CPNo.Text:=Trim(ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.ToolButton1Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
maxId:String;
|
||||||
|
begin
|
||||||
|
if Trim(CPName.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('类别名称不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Trim(CPNo.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('类别编码不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
if PState=11 then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxId,'CP','CP_Type',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('区最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxId:=Trim(FCPID);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from CP_Type where CPID='''+Trim(FCPID)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if PState=11 then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('CPID').Value:=Trim(maxId);
|
||||||
|
FieldByName('CPName').Value:=Trim(CPName.Text);
|
||||||
|
FieldByName('CPNo').Value:=Trim(CPNo.Text);
|
||||||
|
FieldByName('CPParent').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
FieldByName('CPLevel').Value:=ADOQueryTree.fieldbyname('CPLevel').AsInteger+1;
|
||||||
|
Post;
|
||||||
|
end else
|
||||||
|
if PState=22 then
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('CPID').Value:=Trim(maxId);
|
||||||
|
FieldByName('CPName').Value:=Trim(CPName.Text);
|
||||||
|
FieldByName('CPNo').Value:=Trim(CPNo.Text);
|
||||||
|
//FieldByName('CPParent').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
//FieldByName('CPOrder').Value:=ADOQueryTree.fieldbyname('CPOrder').AsInteger+1;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryTree.FieldByName('CPLevel').AsInteger=0 then Exit;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_Type where CPParent='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('已经定义子类不能删除!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYType='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('已经有产品属于此类不能删除!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_Type where CPID='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||||
|
sql.Add('delete CP_Type where CPParent='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
InitTree();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.CPNameKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
CPNo.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmCPType.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitTree();
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
513
样品/U_ClothContractInPut.dfm
Normal file
513
样品/U_ClothContractInPut.dfm
Normal file
|
@ -0,0 +1,513 @@
|
||||||
|
object frmClothContractInPut: TfrmClothContractInPut
|
||||||
|
Left = 198
|
||||||
|
Top = 87
|
||||||
|
Width = 829
|
||||||
|
Height = 625
|
||||||
|
Caption = #22383#24067#35746#36141#21512#21516#24405#20837
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 821
|
||||||
|
Height = 29
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
EdgeInner = esNone
|
||||||
|
EdgeOuter = esNone
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBSave: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 14
|
||||||
|
OnClick = TBSaveClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = 0
|
||||||
|
Top = 29
|
||||||
|
Width = 821
|
||||||
|
Height = 281
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvNone
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Ctl3D = False
|
||||||
|
ParentCtl3D = False
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 24
|
||||||
|
Top = 15
|
||||||
|
Width = 66
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746' '#21333' '#21495#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 617
|
||||||
|
Top = 15
|
||||||
|
Width = 65
|
||||||
|
Height = 12
|
||||||
|
Caption = #20132#36135#26085#26399#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 312
|
||||||
|
Top = 16
|
||||||
|
Width = 66
|
||||||
|
Height = 12
|
||||||
|
Caption = #22383' '#24067' '#21378#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 46
|
||||||
|
Top = 53
|
||||||
|
Width = 13
|
||||||
|
Height = 84
|
||||||
|
Caption = #20184#13#10#13#10#27454#13#10#13#10#26041#13#10#13#10#24335
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 425
|
||||||
|
Top = 53
|
||||||
|
Width = 13
|
||||||
|
Height = 84
|
||||||
|
Caption = #20132#13#10#13#10#26399#13#10#13#10#35201#13#10#13#10#27714
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 46
|
||||||
|
Top = 165
|
||||||
|
Width = 13
|
||||||
|
Height = 84
|
||||||
|
Caption = #36136#13#10#13#10#37327#13#10#13#10#26631#13#10#13#10#20934
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label8: TLabel
|
||||||
|
Left = 420
|
||||||
|
Top = 165
|
||||||
|
Width = 26
|
||||||
|
Height = 84
|
||||||
|
Caption = #35299#20915#13#10#13#10#21512#21516#13#10#13#10#32416#32439#13#10#13#10#26041#24335
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object ConNo: TEdit
|
||||||
|
Left = 86
|
||||||
|
Top = 13
|
||||||
|
Width = 100
|
||||||
|
Height = 18
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object DeliveryDate: TDateTimePicker
|
||||||
|
Left = 679
|
||||||
|
Top = 11
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
BevelInner = bvNone
|
||||||
|
Date = 40916.670856296290000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40916.670856296290000000
|
||||||
|
ShowCheckbox = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object FactoryNoName: TcxButtonEdit
|
||||||
|
Left = 375
|
||||||
|
Top = 10
|
||||||
|
Hint = 'FactoryNo'
|
||||||
|
BeepOnEnter = False
|
||||||
|
ParentShowHint = False
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = FactoryNoNamePropertiesButtonClick
|
||||||
|
Properties.OnChange = FactoryNoNamePropertiesChange
|
||||||
|
ShowHint = False
|
||||||
|
TabOrder = 2
|
||||||
|
OnKeyDown = PRTCodeNameKeyDown
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object ConTK1: TRichEdit
|
||||||
|
Left = 86
|
||||||
|
Top = 48
|
||||||
|
Width = 291
|
||||||
|
Height = 98
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object ConTK2: TRichEdit
|
||||||
|
Left = 472
|
||||||
|
Top = 48
|
||||||
|
Width = 305
|
||||||
|
Height = 98
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
object ConTK3: TRichEdit
|
||||||
|
Left = 86
|
||||||
|
Top = 160
|
||||||
|
Width = 291
|
||||||
|
Height = 98
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object ConTK4: TRichEdit
|
||||||
|
Left = 472
|
||||||
|
Top = 160
|
||||||
|
Width = 305
|
||||||
|
Height = 98
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
object PanZDY: TPanel
|
||||||
|
Left = 617
|
||||||
|
Top = 112
|
||||||
|
Width = 202
|
||||||
|
Height = 153
|
||||||
|
TabOrder = 7
|
||||||
|
Visible = False
|
||||||
|
object CXGridZDY: TcxGrid
|
||||||
|
Left = 3
|
||||||
|
Top = 4
|
||||||
|
Width = 197
|
||||||
|
Height = 113
|
||||||
|
TabOrder = 0
|
||||||
|
object TVZDY: TcxGridDBTableView
|
||||||
|
OnKeyPress = TVZDYKeyPress
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellDblClick = TVZDYCellDblClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object VHelpZDYName: TcxGridDBColumn
|
||||||
|
DataBinding.FieldName = 'ZDYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 163
|
||||||
|
IsCaptionAssigned = True
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CXGridZDYLevel1: TcxGridLevel
|
||||||
|
GridView = TVZDY
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 64
|
||||||
|
Top = 120
|
||||||
|
Width = 65
|
||||||
|
Height = 25
|
||||||
|
Caption = #20851#38381
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = Button1Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ToolBar2: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 310
|
||||||
|
Width = 821
|
||||||
|
Height = 29
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
EdgeInner = esNone
|
||||||
|
EdgeOuter = esNone
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 2
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 103
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 107
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 339
|
||||||
|
Width = 821
|
||||||
|
Height = 249
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 3
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'C_Code'
|
||||||
|
Column = v1Column1
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'C_CodeName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1Column1PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
DataBinding.FieldName = 'C_Spec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 78
|
||||||
|
end
|
||||||
|
object v1PRTColor: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#20811#37325
|
||||||
|
DataBinding.FieldName = 'KZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325#21333#20301
|
||||||
|
DataBinding.FieldName = 'KZUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1PRTMFPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #21487#35009#21098#38376#24133
|
||||||
|
DataBinding.FieldName = 'MF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 76
|
||||||
|
end
|
||||||
|
object v1OrderQty: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133#21333#20301
|
||||||
|
DataBinding.FieldName = 'MFUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1OrderQtyPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1Price: TcxGridDBColumn
|
||||||
|
Caption = #21333#20215
|
||||||
|
DataBinding.FieldName = 'Price'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 51
|
||||||
|
end
|
||||||
|
object v1ClothQty: TcxGridDBColumn
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'PriceUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1ClothQtyPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1ClothUnit: TcxGridDBColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'C_Qty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'C_Unit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1Column2PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 50
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 46
|
||||||
|
end
|
||||||
|
object v1PRTQty: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #24635#20215
|
||||||
|
DataBinding.FieldName = 'Money'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ADOTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 608
|
||||||
|
Top = 125
|
||||||
|
end
|
||||||
|
object ADOCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 624
|
||||||
|
Top = 157
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Sub
|
||||||
|
Left = 344
|
||||||
|
Top = 376
|
||||||
|
end
|
||||||
|
object Order_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 384
|
||||||
|
Top = 376
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = ADOZDY
|
||||||
|
Left = 240
|
||||||
|
Top = 8
|
||||||
|
end
|
||||||
|
object ADOZDY: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 280
|
||||||
|
Top = 5
|
||||||
|
end
|
||||||
|
object CDS_ZDY: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 208
|
||||||
|
Top = 16
|
||||||
|
end
|
||||||
|
object ADOQuery1: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 576
|
||||||
|
Top = 173
|
||||||
|
end
|
||||||
|
end
|
580
样品/U_ClothContractInPut.pas
Normal file
580
样品/U_ClothContractInPut.pas
Normal file
|
@ -0,0 +1,580 @@
|
||||||
|
unit U_ClothContractInPut;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
||||||
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
||||||
|
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
||||||
|
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
||||||
|
ExtCtrls, BtnEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmClothContractInPut = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBSave: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
Label1: TLabel;
|
||||||
|
ConNo: TEdit;
|
||||||
|
Label4: TLabel;
|
||||||
|
DeliveryDate: TDateTimePicker;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
ToolBar2: TToolBar;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTColor: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1OrderQty: TcxGridDBColumn;
|
||||||
|
v1ClothQty: TcxGridDBColumn;
|
||||||
|
v1PRTQty: TcxGridDBColumn;
|
||||||
|
v1Price: TcxGridDBColumn;
|
||||||
|
v1ClothUnit: TcxGridDBColumn;
|
||||||
|
ADOTemp: TADOQuery;
|
||||||
|
ADOCmd: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Order_Sub: TClientDataSet;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOZDY: TADOQuery;
|
||||||
|
CDS_ZDY: TClientDataSet;
|
||||||
|
FactoryNoName: TcxButtonEdit;
|
||||||
|
ADOQuery1: TADOQuery;
|
||||||
|
Label7: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label8: TLabel;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
ConTK1: TRichEdit;
|
||||||
|
ConTK2: TRichEdit;
|
||||||
|
ConTK3: TRichEdit;
|
||||||
|
ConTK4: TRichEdit;
|
||||||
|
PanZDY: TPanel;
|
||||||
|
CXGridZDY: TcxGrid;
|
||||||
|
TVZDY: TcxGridDBTableView;
|
||||||
|
VHelpZDYName: TcxGridDBColumn;
|
||||||
|
CXGridZDYLevel1: TcxGridLevel;
|
||||||
|
Button1: TButton;
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure PRTCodeNameKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
procedure TVZDYKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBSaveClick(Sender: TObject);
|
||||||
|
procedure v1OrderUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PRTUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PRTColorPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure FactoryNoNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1Column1PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PRTMFPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1OrderQtyPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1ClothQtyPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1Column2PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure FactoryNoNamePropertiesChange(Sender: TObject);
|
||||||
|
private
|
||||||
|
FXS:Integer;
|
||||||
|
procedure InitData();
|
||||||
|
procedure ZDYHelp(FButn:TcxButtonEdit;LType:string);
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
PState:Integer;
|
||||||
|
FMainId:String;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmClothContractInPut: TfrmClothContractInPut;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_ZDYHelp,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.InitData();
|
||||||
|
begin
|
||||||
|
with ADOQuery1 do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add(' exec ClothContract_QryList :MainId,:WSql');
|
||||||
|
if PState=1 then
|
||||||
|
begin
|
||||||
|
ADOQuery1.Parameters.ParamByName('MainId').Value:=Trim(FMainId);
|
||||||
|
ADOQuery1.Parameters.ParamByName('WSQl').Value:='';
|
||||||
|
end;
|
||||||
|
if PState=0 then
|
||||||
|
begin
|
||||||
|
ADOQuery1.Parameters.ParamByName('MainId').Value:=Trim(FMainId);
|
||||||
|
ADOQuery1.Parameters.ParamByName('WSql').Value:=' and 1<>1 ';
|
||||||
|
end;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQuery1,Order_Sub);
|
||||||
|
SInitCDSData20(ADOQuery1,Order_Sub);
|
||||||
|
SCSHData(ADOQuery1,ScrollBox1,0);
|
||||||
|
if PState=0 then
|
||||||
|
begin
|
||||||
|
with ADOTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select Top 1* from Contract_Main order by FillTime desc ');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
ConTK1.Text:=ADOTemp.fieldbyname('ConTK1').AsString;
|
||||||
|
ConTK2.Text:=ADOTemp.fieldbyname('ConTK2').AsString;
|
||||||
|
ConTK3.Text:=ADOTemp.fieldbyname('ConTK3').AsString;
|
||||||
|
ConTK4.Text:=ADOTemp.fieldbyname('ConTK4').AsString;
|
||||||
|
end;
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.ZDYHelp(FButn:TcxButtonEdit;LType:string);
|
||||||
|
var
|
||||||
|
FType,ZDYName,FText:String;
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=True;
|
||||||
|
PanZDY.Left:=FButn.Left;
|
||||||
|
PanZDY.Top:=FButn.Top+FButn.Height;
|
||||||
|
with ADOZDY do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type='''+Trim(LType)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
FText:=Trim(FButn.Text);
|
||||||
|
if FText<>'' then
|
||||||
|
SDofilter(ADOZDY,' ZDYName like '+QuotedStr('%'+Trim(FText)+'%'))
|
||||||
|
else
|
||||||
|
SDofilter(ADOZDY,'');
|
||||||
|
VHelpZDYName.Summary.GroupFormat:=Trim(FButn.Name);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.TVZDYCellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
var
|
||||||
|
FName:string;
|
||||||
|
begin
|
||||||
|
if ADOZDY.IsEmpty then Exit;
|
||||||
|
FName:=Trim(VHelpZDYName.Summary.GroupFormat);
|
||||||
|
TcxButtonEdit(FindComponent(FName)).Text:=Trim(ADOZDY.fieldbyname('ZDYName').AsString);
|
||||||
|
TcxButtonEdit(FindComponent(FName)).Hint:=Trim(ADOZDY.fieldbyname('ZDYNO').AsString);
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.PRTCodeNameKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if (key=vk_return) or (Key=vk_Down) then
|
||||||
|
begin
|
||||||
|
if ADOZDY.Active then
|
||||||
|
CXGridZDY.SetFocus;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.TVZDYKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
if ADOZDY.IsEmpty then Exit;
|
||||||
|
TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text:=Trim(ADOZDY.fieldbyname('ZDYName').AsString);
|
||||||
|
TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint:=Trim(ADOZDY.fieldbyname('ZDYNO').AsString);
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
ADOZDY.Active:=False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Trim(DParameters1)='1' then
|
||||||
|
begin
|
||||||
|
v1Price.Visible:=False;
|
||||||
|
v1ClothQty.Visible:=False;
|
||||||
|
v1PRTQty.Visible:=False;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
v1Price.Visible:=True;
|
||||||
|
v1ClothQty.Visible:=True;
|
||||||
|
v1PRTQty.Visible:=True;
|
||||||
|
end;
|
||||||
|
InitData();
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmClothContractInPut.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
maxno:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOCmd.Connection.BeginTrans;
|
||||||
|
///保存主表
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from Contract_Main where MainId='''+Trim(FMainId)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
if Trim(FMainId)='' then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
if GetLSNo(ADOTemp,maxno,'CM','Contract_Main',2,1)=False then
|
||||||
|
begin
|
||||||
|
ADOCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('生成流水号异常!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
maxno:=Trim(FMainId);
|
||||||
|
Edit;
|
||||||
|
end;
|
||||||
|
FieldByName('MainId').Value:=Trim(maxno);
|
||||||
|
SSetsaveSql(ADOCmd,'Contract_Main',ScrollBox1,0);
|
||||||
|
if Trim(FMainId)='' then
|
||||||
|
begin
|
||||||
|
FieldByName('Filler').Value:=Trim(DName);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('Editer').Value:=Trim(DName);
|
||||||
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
FMainId:=Trim(maxno);
|
||||||
|
///保存子表
|
||||||
|
with Order_Sub do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOTemp,maxno,'CS','Contract_Sub',3,1)=False then
|
||||||
|
begin
|
||||||
|
ADOCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取子流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(Order_Sub.fieldbyname('SubId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from Contract_Sub where MainId='''+Trim(FMainId)+'''');
|
||||||
|
sql.Add(' and SubId='''+Trim(maxno)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('MainId').Value:=Trim(FMainId);
|
||||||
|
FieldByName('SubId').Value:=Trim(maxno);
|
||||||
|
SSetSaveDataCDSNew(ADOCmd,Tv1,Order_Sub,'Contract_Sub',0);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Order_Sub.Edit;
|
||||||
|
Order_Sub.FieldByName('SubId').Value:=Trim(maxno);
|
||||||
|
//Order_Sub.Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
Result:=False;
|
||||||
|
ADOCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.TBSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DeliveryDate.SetFocus;
|
||||||
|
if Trim(ConNo.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('订单编号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Trim(FactoryNoName.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('坯布厂不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Order_Sub.IsEmpty then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('明细不能为空!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1OrderUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdUnit';
|
||||||
|
flagname:='单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('OrderUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1PRTUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdUnit';
|
||||||
|
flagname:='单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('PRTUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1PRTColorPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdColor';
|
||||||
|
flagname:='颜色';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('PRTColor').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with Order_Sub do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Sub.IsEmpty then Exit;
|
||||||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub where SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Order_Sub.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.FactoryNoNamePropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='FactoryNo1Name';
|
||||||
|
flagname:='坯布厂名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
FXS:=99;
|
||||||
|
FactoryNoName.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
FactoryNoName.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1Column1PropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='Cloth';
|
||||||
|
flagname:='坯布名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('C_CodeName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
Self.Order_Sub.FieldByName('C_Code').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1PRTMFPropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='KZ';
|
||||||
|
flagname:='克重单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('KZUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1OrderQtyPropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='MF';
|
||||||
|
flagname:='门幅单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('MFUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1ClothQtyPropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='PriceUnit';
|
||||||
|
flagname:='计价单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('PriceUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.v1Column2PropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdUnit';
|
||||||
|
flagname:='单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('C_Unit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractInPut.FactoryNoNamePropertiesChange(
|
||||||
|
Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FXS=99 then
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
FXS:=0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
ZDYHelp(FactoryNoName,'FactoryNo1Name');
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
672
样品/U_ClothContractList.dfm
Normal file
672
样品/U_ClothContractList.dfm
Normal file
|
@ -0,0 +1,672 @@
|
||||||
|
object frmClothContractList: TfrmClothContractList
|
||||||
|
Left = 113
|
||||||
|
Top = 123
|
||||||
|
Width = 1280
|
||||||
|
Height = 554
|
||||||
|
Caption = #22383#24067#37319#36141#21512#21516
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1272
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = TBPrintClick
|
||||||
|
end
|
||||||
|
object ToolButton6: TToolButton
|
||||||
|
Left = 441
|
||||||
|
Top = 0
|
||||||
|
Width = 48
|
||||||
|
Caption = 'ToolButton6'
|
||||||
|
ImageIndex = 115
|
||||||
|
Style = tbsSeparator
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 489
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 552
|
||||||
|
Top = 0
|
||||||
|
Width = 41
|
||||||
|
Caption = 'ToolButton1'
|
||||||
|
ImageIndex = 60
|
||||||
|
Style = tbsSeparator
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 593
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 103
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 656
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 107
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 719
|
||||||
|
Top = 0
|
||||||
|
Caption = #21040#22383#30830#23450
|
||||||
|
ImageIndex = 113
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object ToolButton5: TToolButton
|
||||||
|
Left = 802
|
||||||
|
Top = 0
|
||||||
|
Caption = #22383#24067#23433#25490
|
||||||
|
ImageIndex = 114
|
||||||
|
OnClick = ToolButton5Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 32
|
||||||
|
Width = 1272
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #30331#35760#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 39
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 574
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object ConNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 323
|
||||||
|
Top = 11
|
||||||
|
Width = 81
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object C_CodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object C_Spec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 627
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = -172
|
||||||
|
Top = 112
|
||||||
|
Width = 1366
|
||||||
|
Height = 369
|
||||||
|
BorderStyle = bsNone
|
||||||
|
TabOrder = 2
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 777
|
||||||
|
Height = 369
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
OnMouseDown = Tv1MouseDown
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnFocusedRecordChanged = Tv1FocusedRecordChanged
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTOrderQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column1
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTQty
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Editing = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
object v1OrderNo: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
DataBinding.FieldName = 'ConNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'C_CodeName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1DeliveryDate: TcxGridDBColumn
|
||||||
|
Caption = #20132#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'DeliveryDate'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1FactoryNo1Name: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#21378
|
||||||
|
DataBinding.FieldName = 'FactoryNoName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
DataBinding.FieldName = 'C_Spec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #21487#35009#38376#24133
|
||||||
|
DataBinding.FieldName = 'MF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133#21333#20301
|
||||||
|
DataBinding.FieldName = 'MFUnit'
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#20811#37325
|
||||||
|
DataBinding.FieldName = 'KZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1ClothUnit: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325#21333#20301
|
||||||
|
DataBinding.FieldName = 'KZUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Qty1: TcxGridDBColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 46
|
||||||
|
end
|
||||||
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'C_Qty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'C_Unit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 47
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #21333#20215
|
||||||
|
DataBinding.FieldName = 'Price'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
object v1PRTUnit: TcxGridDBColumn
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'PriceUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1PRTQty: TcxGridDBColumn
|
||||||
|
Caption = #24635#20215
|
||||||
|
DataBinding.FieldName = 'Money'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2: TcxGrid
|
||||||
|
Left = 785
|
||||||
|
Top = 0
|
||||||
|
Width = 320
|
||||||
|
Height = 369
|
||||||
|
Align = alRight
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv2: TcxGridDBTableView
|
||||||
|
OnMouseDown = Tv2MouseDown
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellClick = Tv2CellClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v2MxQty
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
object v2ComeDate: TcxGridDBColumn
|
||||||
|
Caption = #21040#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'ComeDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v2BatchNo: TcxGridDBColumn
|
||||||
|
Caption = #25209#21495
|
||||||
|
DataBinding.FieldName = 'BatchNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v2Qty1: TcxGridDBColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 44
|
||||||
|
end
|
||||||
|
object v2MxQty: TcxGridDBColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'MxQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 48
|
||||||
|
end
|
||||||
|
object v2MxNote: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'MxNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2Level1: TcxGridLevel
|
||||||
|
GridView = Tv2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid3: TcxGrid
|
||||||
|
Left = 1113
|
||||||
|
Top = 0
|
||||||
|
Width = 253
|
||||||
|
Height = 369
|
||||||
|
Align = alRight
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv3: TcxGridDBTableView
|
||||||
|
OnMouseDown = Tv3MouseDown
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource3
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object cxGridDBColumn1: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
DataBinding.FieldName = 'OrderNo'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = cxGridDBColumn1PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v3Column1: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'PRTCodeName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object cxPRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517'/'#35268#26684
|
||||||
|
DataBinding.FieldName = 'PRTSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object cxGridDBPRTColor: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'PRTColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 36
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridLevel1: TcxGridLevel
|
||||||
|
GridView = Tv3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxSplitter1: TcxSplitter
|
||||||
|
Left = 1105
|
||||||
|
Top = 0
|
||||||
|
Width = 8
|
||||||
|
Height = 369
|
||||||
|
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||||
|
AlignSplitter = salRight
|
||||||
|
Control = cxGrid3
|
||||||
|
end
|
||||||
|
object cxSplitter2: TcxSplitter
|
||||||
|
Left = 777
|
||||||
|
Top = 0
|
||||||
|
Width = 8
|
||||||
|
Height = 369
|
||||||
|
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||||
|
AlignSplitter = salRight
|
||||||
|
Control = cxGrid2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 656
|
||||||
|
Top = 96
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 608
|
||||||
|
Top = 64
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 640
|
||||||
|
Top = 72
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 672
|
||||||
|
Top = 64
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 704
|
||||||
|
Top = 64
|
||||||
|
end
|
||||||
|
object Order_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 608
|
||||||
|
Top = 96
|
||||||
|
end
|
||||||
|
object ClientDataSet3: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 1112
|
||||||
|
Top = 240
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = ClientDataSet2
|
||||||
|
Left = 880
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object DataSource3: TDataSource
|
||||||
|
DataSet = ClientDataSet3
|
||||||
|
Left = 1112
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
object ClientDataSet2: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 920
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDBMain
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 352
|
||||||
|
Top = 192
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDBMain: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 400
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
object RMXLSExport1: TRMXLSExport
|
||||||
|
ShowAfterExport = True
|
||||||
|
ExportPrecision = 1
|
||||||
|
PagesOfSheet = 1
|
||||||
|
ExportImages = True
|
||||||
|
ExportFrames = True
|
||||||
|
ExportImageFormat = ifBMP
|
||||||
|
JPEGQuality = 0
|
||||||
|
ScaleX = 1.000000000000000000
|
||||||
|
ScaleY = 1.000000000000000000
|
||||||
|
CompressFile = False
|
||||||
|
Left = 416
|
||||||
|
Top = 248
|
||||||
|
end
|
||||||
|
end
|
652
样品/U_ClothContractList.pas
Normal file
652
样品/U_ClothContractList.pas
Normal file
|
@ -0,0 +1,652 @@
|
||||||
|
unit U_ClothContractList;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
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, cxCalendar, cxButtonEdit, cxSplitter,
|
||||||
|
RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmClothContractList = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Label3: TLabel;
|
||||||
|
ConNoM: TEdit;
|
||||||
|
Label5: TLabel;
|
||||||
|
C_CodeNameM: TEdit;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
Order_Main: TClientDataSet;
|
||||||
|
Label4: TLabel;
|
||||||
|
C_Spec: TEdit;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1OrderNo: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1DeliveryDate: TcxGridDBColumn;
|
||||||
|
v1FactoryNo1Name: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1ClothUnit: TcxGridDBColumn;
|
||||||
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1PRTUnit: TcxGridDBColumn;
|
||||||
|
v1PRTQty: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid2: TcxGrid;
|
||||||
|
Tv2: TcxGridDBTableView;
|
||||||
|
v2ComeDate: TcxGridDBColumn;
|
||||||
|
v2BatchNo: TcxGridDBColumn;
|
||||||
|
v2MxQty: TcxGridDBColumn;
|
||||||
|
v2MxNote: TcxGridDBColumn;
|
||||||
|
cxGrid2Level1: TcxGridLevel;
|
||||||
|
cxGrid3: TcxGrid;
|
||||||
|
Tv3: TcxGridDBTableView;
|
||||||
|
cxGridDBColumn1: TcxGridDBColumn;
|
||||||
|
cxPRTSpec: TcxGridDBColumn;
|
||||||
|
cxGridDBPRTColor: TcxGridDBColumn;
|
||||||
|
cxGridLevel1: TcxGridLevel;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ClientDataSet3: TClientDataSet;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
DataSource3: TDataSource;
|
||||||
|
ClientDataSet2: TClientDataSet;
|
||||||
|
v3Column1: TcxGridDBColumn;
|
||||||
|
ToolButton5: TToolButton;
|
||||||
|
ToolButton6: TToolButton;
|
||||||
|
cxSplitter1: TcxSplitter;
|
||||||
|
cxSplitter2: TcxSplitter;
|
||||||
|
v1Qty1: TcxGridDBColumn;
|
||||||
|
v2Qty1: TcxGridDBColumn;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDBMain: TRMDBDataSet;
|
||||||
|
RMXLSExport1: TRMXLSExport;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBPrintClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure ConNoMChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||||
|
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure Tv3MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure Tv2CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure ToolButton5Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
FInt:Integer;
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitForm();
|
||||||
|
function DelData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmClothContractList: TfrmClothContractList;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_ClothContractInPut,U_Fun,U_ProductOrderList;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmClothContractList:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ScrollBox1.Align:=alClient;
|
||||||
|
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
||||||
|
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('坯布合同订单列表',Tv1,'指示单管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec ClothContract_QryList :MainId,:WSql');
|
||||||
|
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
|
||||||
|
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.InitForm();
|
||||||
|
begin
|
||||||
|
ReadCxGrid('坯布合同订单列表',Tv1,'指示单管理');
|
||||||
|
if Trim(DParameters1)='1' then
|
||||||
|
begin
|
||||||
|
TBPrint.Visible:=False;
|
||||||
|
v1Column1.Visible:=False;
|
||||||
|
v1Column1.Hidden:=True;
|
||||||
|
v1PRTUnit.Visible:=False;
|
||||||
|
v1PRTUnit.Hidden:=True;
|
||||||
|
v1PRTQty.Visible:=False;
|
||||||
|
v1PRTQty.Hidden:=True;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
v1Column1.Visible:=True;
|
||||||
|
v1Column1.Hidden:=False;
|
||||||
|
v1PRTUnit.Visible:=True;
|
||||||
|
v1PRTUnit.Hidden:=False;
|
||||||
|
v1PRTQty.Visible:=True;
|
||||||
|
v1PRTQty.Hidden:=False;
|
||||||
|
TBPrint.Visible:=True;
|
||||||
|
end;
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
try
|
||||||
|
frmClothContractInPut:=TfrmClothContractInPut.Create(Application);
|
||||||
|
with frmClothContractInPut do
|
||||||
|
begin
|
||||||
|
PState:=1;
|
||||||
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmClothContractInPut.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
//TBRafresh.Click;
|
||||||
|
//TBFind.Click;
|
||||||
|
Order_Main.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmClothContractList.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub where SubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
if Trim(Order_Main.fieldbyname('SubId').AsString)='' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('坯布合同订单列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBPrintClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile,FConNoM:string;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\坯布订购合同.rmf' ;
|
||||||
|
FConNoM:=Trim(Order_Main.fieldbyname('ConNoM').AsString);
|
||||||
|
SDofilter(ADOQueryMain,' ConNoM='''+Trim(Order_Main.fieldbyname('ConNoM').AsString)+'''');
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
//RMVariables['begindate']:=begindate.DateTime;
|
||||||
|
//RMVariables['enddate']:=enddate.DateTime;
|
||||||
|
//RMVariables['printtime']:=Now;
|
||||||
|
//RMVariables['printer']:=Trim(gUserName);
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\坯布订购合同.rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
SDofilter(ADOQueryMain,'');
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
Order_Main.Locate('ConNoM',FConNoM,[]);
|
||||||
|
//SelPrintData(TV4,ADOQueryMain,'合同查询报表');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmClothContractInPut:=TfrmClothContractInPut.Create(Application);
|
||||||
|
with frmClothContractInPut do
|
||||||
|
begin
|
||||||
|
PState:=0;
|
||||||
|
FMainId:='';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmClothContractInPut.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.ConNoMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitForm();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if FInt=2 then
|
||||||
|
begin
|
||||||
|
ClientDataSet2.Append;
|
||||||
|
ClientDataSet2.Post;
|
||||||
|
end else
|
||||||
|
if FInt=3 then
|
||||||
|
begin
|
||||||
|
ClientDataSet3.Append;
|
||||||
|
ClientDataSet3.Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.Tv1FocusedRecordChanged(
|
||||||
|
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||||
|
AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from Contract_Sub_Mx where SubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet2);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet2);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select A.*,B.PRTSpec,B.PRTColor,C.PRTCodeName,C.OrderNo from Contract_Sub_MxTo A inner join Order_Sub B on A.OrdSubId=B.SubId');
|
||||||
|
SQL.Add(' inner join Order_Main C on C.MainId=B.MainId ');
|
||||||
|
sql.Add('where A.MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.Tv2MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
FInt:=2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.Tv1MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
FInt:=1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.Tv3MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
FInt:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.ToolButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
maxno:string;
|
||||||
|
begin
|
||||||
|
if ClientDataSet2.IsEmpty then Exit;
|
||||||
|
if ClientDataSet2.Locate('ComeDate',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('到货日期不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if ClientDataSet2.Locate('BatchNo',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('批号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if ClientDataSet2.Locate('MxQty',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('到货数量不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
//保存明细表
|
||||||
|
with ClientDataSet2 do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not eof do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MXId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxno,'MX','Contract_Sub_Mx',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取明细流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(ClientDataSet2.fieldbyname('MXId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from Contract_Sub_Mx where MxId='''+Trim(ClientDataSet2.fieldbyname('MXId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MXId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('MxId').Value:=Trim(maxno);
|
||||||
|
FieldByName('SubId').Value:=Trim(Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv2,ClientDataSet2,'Contract_Sub_Mx',0);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ClientDataSet2 do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('MxId').Value:=Trim(maxno);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('确定成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('确定异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.cxGridDBColumn1PropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductOrderList:=TfrmProductOrderList.Create(Application);
|
||||||
|
with frmProductOrderList do
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
frmProductOrderList.TBAdd.Visible:=False;
|
||||||
|
frmProductOrderList.TBEdit.Visible:=False;
|
||||||
|
frmProductOrderList.TBDel.Visible:=False;
|
||||||
|
frmProductOrderList.TBExport.Visible:=False;
|
||||||
|
frmProductOrderList.TBPrint.Visible:=False;
|
||||||
|
frmProductOrderList.TBTP.Visible:=False;
|
||||||
|
frmProductOrderList.cxGrid2.Visible:=False;
|
||||||
|
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with ClientDataSet3 do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('OrdSubId').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
FieldByName('OrderNo').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('OrderNo').AsString);
|
||||||
|
FieldByName('PRTCodeName').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTCodeName').AsString);
|
||||||
|
FieldByName('PRTSpec').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTSpec').AsString);
|
||||||
|
FieldByName('PRTColor').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTColor').AsString);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductOrderList.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.Tv2CellClick(
|
||||||
|
Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select A.*,B.PRTSpec,B.PRTColor,C.PRTCodeName,C.OrderNo from Contract_Sub_MxTo A inner join Order_Sub B on A.OrdSubId=B.SubId');
|
||||||
|
SQL.Add(' inner join Order_Main C on C.MainId=B.MainId ');
|
||||||
|
sql.Add('where A.MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.ToolButton5Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
maxno:string;
|
||||||
|
begin
|
||||||
|
if ClientDataSet3.IsEmpty then Exit;
|
||||||
|
if ClientDataSet2.IsEmpty then Exit;
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MXId').AsString)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('到货数量未确定!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if ClientDataSet3.Locate('OrderNo',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('指定订单编号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
//保存去向表
|
||||||
|
with ClientDataSet3 do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not eof do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet3.fieldbyname('ToId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxno,'To','Contract_Sub_MxTo',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取去向流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(ClientDataSet3.fieldbyname('ToId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from Contract_Sub_MxTo where ToId='''+Trim(ClientDataSet3.fieldbyname('ToId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet3.fieldbyname('ToId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('MxId').Value:=Trim(ClientDataSet2.fieldbyname('MxId').AsString);
|
||||||
|
FieldByName('ToId').Value:=Trim(maxno);
|
||||||
|
FieldByName('OrdSubId').Value:=Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ClientDataSet3 do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('ToId').Value:=Trim(maxno);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('安排成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('安排异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractList.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FInt=2 then
|
||||||
|
begin
|
||||||
|
if ClientDataSet2.IsEmpty then Exit;
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MxId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub_Mx where MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ClientDataSet2.Delete;
|
||||||
|
end else
|
||||||
|
if FInt=3 then
|
||||||
|
begin
|
||||||
|
if ClientDataSet3.IsEmpty then Exit;
|
||||||
|
if Trim(ClientDataSet3.fieldbyname('ToId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub_MxTo where ToId='''+Trim(ClientDataSet3.fieldbyname('ToId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ClientDataSet3.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
587
样品/U_ClothContractPay.dfm
Normal file
587
样品/U_ClothContractPay.dfm
Normal file
|
@ -0,0 +1,587 @@
|
||||||
|
object frmClothContractPay: TfrmClothContractPay
|
||||||
|
Left = -6
|
||||||
|
Top = 129
|
||||||
|
Width = 1292
|
||||||
|
Height = 554
|
||||||
|
Caption = #22383#24067#23545#36134#21333
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1284
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
Caption = #22383#24067#20184#27454
|
||||||
|
ImageIndex = 113
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 272
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 103
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 335
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 107
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 398
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBPrintClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 461
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1284
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #30331#35760#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 39
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 574
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 734
|
||||||
|
Top = 15
|
||||||
|
Width = 39
|
||||||
|
Height = 12
|
||||||
|
Caption = #22383#24067#21378
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object ConNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 323
|
||||||
|
Top = 11
|
||||||
|
Width = 81
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object C_CodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object C_Spec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 627
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object FactoryNoName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 787
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 5
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = -172
|
||||||
|
Top = 112
|
||||||
|
Width = 1366
|
||||||
|
Height = 369
|
||||||
|
BorderStyle = bsNone
|
||||||
|
TabOrder = 2
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1083
|
||||||
|
Height = 369
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
OnMouseDown = Tv1MouseDown
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnFocusedRecordChanged = Tv1FocusedRecordChanged
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTOrderQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column1
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column5
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column4
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column9
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Editing = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
object v1OrderNo: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
DataBinding.FieldName = 'ConNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'C_CodeName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1DeliveryDate: TcxGridDBColumn
|
||||||
|
Caption = #20132#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'DeliveryDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.ShowTime = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1FactoryNo1Name: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#21378
|
||||||
|
DataBinding.FieldName = 'FactoryNoName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
DataBinding.FieldName = 'C_Spec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #21487#35009#38376#24133
|
||||||
|
DataBinding.FieldName = 'MF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133#21333#20301
|
||||||
|
DataBinding.FieldName = 'MFUnit'
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#20811#37325
|
||||||
|
DataBinding.FieldName = 'KZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1ClothUnit: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325#21333#20301
|
||||||
|
DataBinding.FieldName = 'KZUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Qty1: TcxGridDBColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'PQty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 46
|
||||||
|
end
|
||||||
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'C_Qty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'C_Unit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 47
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #21333#20215
|
||||||
|
DataBinding.FieldName = 'Price'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #30331#35760#26085#26399
|
||||||
|
DataBinding.FieldName = 'FillTime'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1PRTUnit: TcxGridDBColumn
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'PriceUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1PRTQty: TcxGridDBColumn
|
||||||
|
Caption = #24635#20215
|
||||||
|
DataBinding.FieldName = 'Money'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #25209#21495
|
||||||
|
DataBinding.FieldName = 'BatchNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 55
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #21040#36135#25968#37327
|
||||||
|
DataBinding.FieldName = 'MxQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #21040#36135#21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #21040#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'ComeDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.ShowTime = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #23454#38469#37329#39069
|
||||||
|
DataBinding.FieldName = 'SJMoney'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2: TcxGrid
|
||||||
|
Left = 1091
|
||||||
|
Top = 0
|
||||||
|
Width = 275
|
||||||
|
Height = 369
|
||||||
|
Align = alRight
|
||||||
|
TabOrder = 1
|
||||||
|
Visible = False
|
||||||
|
object Tv2: TcxGridDBTableView
|
||||||
|
OnMouseDown = Tv2MouseDown
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellClick = Tv2CellClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.SkyBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.SkyBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.SkyBlue
|
||||||
|
object v2ComeDate: TcxGridDBColumn
|
||||||
|
Caption = #20184#27454#26085#26399
|
||||||
|
DataBinding.FieldName = 'ComeDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v2BatchNo: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#21378
|
||||||
|
DataBinding.FieldName = 'BatchNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v2Qty1: TcxGridDBColumn
|
||||||
|
Caption = #37329#39069
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 44
|
||||||
|
end
|
||||||
|
object v2MxNote: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'MxNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2Level1: TcxGridLevel
|
||||||
|
GridView = Tv2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxSplitter2: TcxSplitter
|
||||||
|
Left = 1083
|
||||||
|
Top = 0
|
||||||
|
Width = 8
|
||||||
|
Height = 369
|
||||||
|
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||||
|
AlignSplitter = salRight
|
||||||
|
Control = cxGrid2
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 648
|
||||||
|
Top = 200
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 576
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 608
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 512
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 480
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
object Order_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 544
|
||||||
|
Top = 80
|
||||||
|
end
|
||||||
|
object ClientDataSet3: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 1112
|
||||||
|
Top = 240
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = ClientDataSet2
|
||||||
|
Left = 880
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object DataSource3: TDataSource
|
||||||
|
DataSet = ClientDataSet3
|
||||||
|
Left = 1112
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
object ClientDataSet2: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 920
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
end
|
472
样品/U_ClothContractPay.pas
Normal file
472
样品/U_ClothContractPay.pas
Normal file
|
@ -0,0 +1,472 @@
|
||||||
|
unit U_ClothContractPay;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
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, cxCalendar, cxButtonEdit, cxSplitter;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmClothContractPay = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Label3: TLabel;
|
||||||
|
ConNoM: TEdit;
|
||||||
|
Label5: TLabel;
|
||||||
|
C_CodeNameM: TEdit;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
Order_Main: TClientDataSet;
|
||||||
|
Label4: TLabel;
|
||||||
|
C_Spec: TEdit;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1OrderNo: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1DeliveryDate: TcxGridDBColumn;
|
||||||
|
v1FactoryNo1Name: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1ClothUnit: TcxGridDBColumn;
|
||||||
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1PRTUnit: TcxGridDBColumn;
|
||||||
|
v1PRTQty: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid2: TcxGrid;
|
||||||
|
Tv2: TcxGridDBTableView;
|
||||||
|
v2ComeDate: TcxGridDBColumn;
|
||||||
|
v2BatchNo: TcxGridDBColumn;
|
||||||
|
v2MxNote: TcxGridDBColumn;
|
||||||
|
cxGrid2Level1: TcxGridLevel;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
ClientDataSet3: TClientDataSet;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
DataSource3: TDataSource;
|
||||||
|
ClientDataSet2: TClientDataSet;
|
||||||
|
cxSplitter2: TcxSplitter;
|
||||||
|
v1Qty1: TcxGridDBColumn;
|
||||||
|
v2Qty1: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
Label6: TLabel;
|
||||||
|
FactoryNoName: TEdit;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBPrintClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure ConNoMChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||||
|
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure Tv3MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure Tv2CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
FInt:Integer;
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitForm();
|
||||||
|
function DelData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmClothContractPay: TfrmClothContractPay;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_ClothContractInPut,U_Fun,U_ProductOrderList;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmClothContractPay:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ScrollBox1.Align:=alClient;
|
||||||
|
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
||||||
|
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('坯布合同对账单',Tv1,'指示单管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec ClothContract_QryPayList :MainId,:WSql');
|
||||||
|
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
|
||||||
|
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.InitForm();
|
||||||
|
begin
|
||||||
|
ReadCxGrid('坯布合同对账单',Tv1,'指示单管理');
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmClothContractPay.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub where SubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
if Trim(Order_Main.fieldbyname('SubId').AsString)='' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('坯布合同对账单',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.TBPrintClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.ConNoMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitForm();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if FInt=2 then
|
||||||
|
begin
|
||||||
|
ClientDataSet2.Append;
|
||||||
|
ClientDataSet2.Post;
|
||||||
|
end else
|
||||||
|
if FInt=3 then
|
||||||
|
begin
|
||||||
|
ClientDataSet3.Append;
|
||||||
|
ClientDataSet3.Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.Tv1FocusedRecordChanged(
|
||||||
|
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||||
|
AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from Contract_Sub_Mx where SubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet2);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet2);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select A.*,B.PRTSpec,B.PRTColor,C.PRTCodeName,C.OrderNo from Contract_Sub_MxTo A inner join Order_Sub B on A.OrdSubId=B.SubId');
|
||||||
|
SQL.Add(' inner join Order_Main C on C.MainId=B.MainId ');
|
||||||
|
sql.Add('where A.MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.Tv2MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
FInt:=2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.Tv1MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
FInt:=1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.Tv3MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
FInt:=3;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.ToolButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
maxno:string;
|
||||||
|
begin
|
||||||
|
if ClientDataSet2.IsEmpty then Exit;
|
||||||
|
if ClientDataSet2.Locate('ComeDate',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('到货日期不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if ClientDataSet2.Locate('BatchNo',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('批号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if ClientDataSet2.Locate('MxQty',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('到货数量不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
//保存明细表
|
||||||
|
with ClientDataSet2 do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not eof do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MXId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxno,'MX','Contract_Sub_Mx',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取明细流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(ClientDataSet2.fieldbyname('MXId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from Contract_Sub_Mx where MxId='''+Trim(ClientDataSet2.fieldbyname('MXId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MXId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('MxId').Value:=Trim(maxno);
|
||||||
|
FieldByName('SubId').Value:=Trim(Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv2,ClientDataSet2,'Contract_Sub_Mx',0);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
with ClientDataSet2 do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('MxId').Value:=Trim(maxno);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('确定成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('确定异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.cxGridDBColumn1PropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductOrderList:=TfrmProductOrderList.Create(Application);
|
||||||
|
with frmProductOrderList do
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
frmProductOrderList.TBAdd.Visible:=False;
|
||||||
|
frmProductOrderList.TBEdit.Visible:=False;
|
||||||
|
frmProductOrderList.TBDel.Visible:=False;
|
||||||
|
frmProductOrderList.TBExport.Visible:=False;
|
||||||
|
frmProductOrderList.TBPrint.Visible:=False;
|
||||||
|
frmProductOrderList.TBTP.Visible:=False;
|
||||||
|
frmProductOrderList.cxGrid2.Visible:=False;
|
||||||
|
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with ClientDataSet3 do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('OrdSubId').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
FieldByName('OrderNo').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('OrderNo').AsString);
|
||||||
|
FieldByName('PRTCodeName').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTCodeName').AsString);
|
||||||
|
FieldByName('PRTSpec').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTSpec').AsString);
|
||||||
|
FieldByName('PRTColor').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTColor').AsString);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductOrderList.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.Tv2CellClick(
|
||||||
|
Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select A.*,B.PRTSpec,B.PRTColor,C.PRTCodeName,C.OrderNo from Contract_Sub_MxTo A inner join Order_Sub B on A.OrdSubId=B.SubId');
|
||||||
|
SQL.Add(' inner join Order_Main C on C.MainId=B.MainId ');
|
||||||
|
sql.Add('where A.MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet3);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothContractPay.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FInt=2 then
|
||||||
|
begin
|
||||||
|
if ClientDataSet2.IsEmpty then Exit;
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('MxId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub_Mx where MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ClientDataSet2.Delete;
|
||||||
|
end else
|
||||||
|
if FInt=3 then
|
||||||
|
begin
|
||||||
|
if ClientDataSet3.IsEmpty then Exit;
|
||||||
|
if Trim(ClientDataSet3.fieldbyname('ToId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Contract_Sub_MxTo where ToId='''+Trim(ClientDataSet3.fieldbyname('ToId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ClientDataSet3.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
467
样品/U_ClothKCQty.dfm
Normal file
467
样品/U_ClothKCQty.dfm
Normal file
|
@ -0,0 +1,467 @@
|
||||||
|
object frmClothKCQty: TfrmClothKCQty
|
||||||
|
Left = 184
|
||||||
|
Top = 155
|
||||||
|
Width = 1014
|
||||||
|
Height = 500
|
||||||
|
Caption = #22383#24067#20986#20837#23384
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1006
|
||||||
|
Height = 33
|
||||||
|
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_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1006
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #26597#35810#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 39
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 574
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object ConNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 323
|
||||||
|
Top = 11
|
||||||
|
Width = 81
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object C_CodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
object C_Spec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 627
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = ConNoMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 24
|
||||||
|
Top = 112
|
||||||
|
Width = 897
|
||||||
|
Height = 200
|
||||||
|
TabOrder = 2
|
||||||
|
object cxGrid1DBTableView1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
end
|
||||||
|
object Tv1: TcxGridDBBandedTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column15
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column14
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column13
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column12
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column11
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column10
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column9
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column8
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Editing = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
Bands = <
|
||||||
|
item
|
||||||
|
Caption = #22522#26412#20449#24687
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Caption = #19978#26399#32467#23384
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Caption = #26412#26399#20837#24211
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Caption = #26412#26399#20986#24211
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Caption = #26412#26399#32467#23384
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end>
|
||||||
|
object v1Column1: TcxGridDBBandedColumn
|
||||||
|
Caption = #35746#21333#21495
|
||||||
|
DataBinding.FieldName = 'ConNoM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 63
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Position.ColIndex = 0
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBBandedColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'C_CodeName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBBandedColumn
|
||||||
|
Caption = #38754#26009#35268#26684
|
||||||
|
DataBinding.FieldName = 'C_Spec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 62
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Position.ColIndex = 2
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBBandedColumn
|
||||||
|
Caption = #22383#24067#21378
|
||||||
|
DataBinding.FieldName = 'FactoryNoName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Position.ColIndex = 3
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBBandedColumn
|
||||||
|
Caption = #25209#21495
|
||||||
|
DataBinding.FieldName = 'BatchNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Position.ColIndex = 4
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBBandedColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'C_Unit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 62
|
||||||
|
Position.BandIndex = 0
|
||||||
|
Position.ColIndex = 5
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBBandedColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'JCS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 62
|
||||||
|
Position.BandIndex = 4
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBBandedColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'PJCS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
Position.BandIndex = 4
|
||||||
|
Position.ColIndex = 0
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBBandedColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'CKS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 60
|
||||||
|
Position.BandIndex = 3
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBBandedColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'PCKS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
Position.BandIndex = 3
|
||||||
|
Position.ColIndex = 0
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBBandedColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'RKS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
Position.BandIndex = 2
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBBandedColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'PRKS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
Position.BandIndex = 2
|
||||||
|
Position.ColIndex = 0
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBBandedColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'QCS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
Position.BandIndex = 1
|
||||||
|
Position.ColIndex = 1
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBBandedColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'PQCS'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Moving = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
Position.BandIndex = 1
|
||||||
|
Position.ColIndex = 0
|
||||||
|
Position.RowIndex = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 648
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 688
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 736
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryMain
|
||||||
|
Left = 584
|
||||||
|
Top = 120
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 544
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
end
|
157
样品/U_ClothKCQty.pas
Normal file
157
样品/U_ClothKCQty.pas
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
unit U_ClothKCQty;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView,
|
||||||
|
cxGridTableView, cxGridBandedTableView, cxGridDBBandedTableView,
|
||||||
|
cxGridLevel, cxClasses, cxControls, cxGridCustomView, cxGridDBTableView,
|
||||||
|
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxGridCustomPopupMenu,
|
||||||
|
cxGridPopupMenu, ADODB;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmClothKCQty = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
ConNoM: TEdit;
|
||||||
|
C_CodeNameM: TEdit;
|
||||||
|
C_Spec: TEdit;
|
||||||
|
cxGrid1DBTableView1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBBandedTableView;
|
||||||
|
v1Column1: TcxGridDBBandedColumn;
|
||||||
|
v1Column2: TcxGridDBBandedColumn;
|
||||||
|
v1Column3: TcxGridDBBandedColumn;
|
||||||
|
v1Column4: TcxGridDBBandedColumn;
|
||||||
|
v1Column5: TcxGridDBBandedColumn;
|
||||||
|
v1Column6: TcxGridDBBandedColumn;
|
||||||
|
v1Column8: TcxGridDBBandedColumn;
|
||||||
|
v1Column9: TcxGridDBBandedColumn;
|
||||||
|
v1Column10: TcxGridDBBandedColumn;
|
||||||
|
v1Column11: TcxGridDBBandedColumn;
|
||||||
|
v1Column12: TcxGridDBBandedColumn;
|
||||||
|
v1Column13: TcxGridDBBandedColumn;
|
||||||
|
v1Column14: TcxGridDBBandedColumn;
|
||||||
|
v1Column15: TcxGridDBBandedColumn;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure ConNoMChange(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmClothKCQty: TfrmClothKCQty;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmClothKCQty:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp)
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec Cloth_KCQty :begdate,:enddate');
|
||||||
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime));
|
||||||
|
Parameters.ParamByName('enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',enddate.DateTime+1));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.ConNoMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxBandedGrid('Å÷²¼¿â´æ',Tv1,'Å÷²¼');
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxBandedGrid('Å÷²¼¿â´æ',Tv1,'Å÷²¼');
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then exit;
|
||||||
|
TcxGridToExcel('Å÷²¼¿â´æ',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmClothKCQty.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
17974
样品/U_DataLink.dfm
Normal file
17974
样品/U_DataLink.dfm
Normal file
File diff suppressed because it is too large
Load Diff
75
样品/U_DataLink.pas
Normal file
75
样品/U_DataLink.pas
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
unit U_DataLink;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, DB, ADODB, ImgList, Controls, cxStyles, cxLookAndFeels,
|
||||||
|
Windows,Messages,forms,OleCtnrs,DateUtils, cxClasses;
|
||||||
|
var
|
||||||
|
DConString:String; {全局连接字符串}
|
||||||
|
server, dtbase, user, pswd: String; {数据库连接参数}
|
||||||
|
DCurHandle:hwnd; //当前窗体句柄
|
||||||
|
PicSvr:string;
|
||||||
|
DName:string ; //#用户名#//
|
||||||
|
DCode:string ; //#用户编号#//
|
||||||
|
Ddatabase:string; //#数据库名称#//
|
||||||
|
DTitCaption:string; //#主窗体名称#//
|
||||||
|
UserDataFlag:string;
|
||||||
|
DParameters1,DParameters2,DParameters3,DParameters4,DParameters5:string;// 外部参数;
|
||||||
|
DParameters6,DParameters7,DParameters8,DParameters9,DParameters10:string;//外部参数;
|
||||||
|
OldDllApp:Tapplication; //保存原有句柄
|
||||||
|
NewDllApp: Tapplication;//当前句柄
|
||||||
|
MainApplication: Tapplication ;
|
||||||
|
DFormCode:integer; //当前窗口号
|
||||||
|
IsDelphiLanguage:integer;
|
||||||
|
DServerDate:TdateTime; //服务器时间
|
||||||
|
DCompany:string; //公司
|
||||||
|
IpCall:Integer;
|
||||||
|
IpWLDZStr:String;
|
||||||
|
type
|
||||||
|
TDataLink_YPGL = class(TDataModule)
|
||||||
|
AdoDataLink: TADOQuery;
|
||||||
|
ADOLink: TADOConnection;
|
||||||
|
ThreeImgList: TImageList;
|
||||||
|
ThreeLookAndFeelCol: TcxLookAndFeelController;
|
||||||
|
ThreeColorBase: TcxStyleRepository;
|
||||||
|
SHuangSe: TcxStyle;
|
||||||
|
SkyBlue: TcxStyle;
|
||||||
|
Default: TcxStyle;
|
||||||
|
QHuangSe: TcxStyle;
|
||||||
|
Red: TcxStyle;
|
||||||
|
FontBlue: TcxStyle;
|
||||||
|
TextSHuangSe: TcxStyle;
|
||||||
|
FonePurple: TcxStyle;
|
||||||
|
FoneClMaroon: TcxStyle;
|
||||||
|
FoneRed: TcxStyle;
|
||||||
|
RowColor: TcxStyle;
|
||||||
|
handBlack: TcxStyle;
|
||||||
|
cxBlue: TcxStyle;
|
||||||
|
procedure DataModuleDestroy(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
TMakebar = procedure(ucData:pchar;nDataLen:integer;nErrLevel:integer;nMask:integer;nBarEdition:integer;szBmpFileName:pchar;nScale:integer);stdcall;
|
||||||
|
TMixtext = procedure( szSrcBmpFileName:PChar;szDstBmpFileName:PChar;sztext:PChar;fontsize,txtheight,hmargin,vmargin,txtcntoneline:integer);stdcall;
|
||||||
|
|
||||||
|
|
||||||
|
var
|
||||||
|
DataLink_YPGL: TDataLink_YPGL;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
procedure TDataLink_YPGL.DataModuleDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DataLink_YPGL:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
188
样品/U_FileUp.dfm
Normal file
188
样品/U_FileUp.dfm
Normal file
|
@ -0,0 +1,188 @@
|
||||||
|
object frmFileUp: TfrmFileUp
|
||||||
|
Left = 247
|
||||||
|
Top = 162
|
||||||
|
Width = 660
|
||||||
|
Height = 441
|
||||||
|
Caption = #19978#20256#25991#20214
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object cxGrid7: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 41
|
||||||
|
Width = 585
|
||||||
|
Height = 361
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 0
|
||||||
|
object TV7: TcxGridDBTableView
|
||||||
|
Navigator.Buttons.CustomButtons = <>
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Editing = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
OptionsView.Indicator = True
|
||||||
|
object FileName: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #25991#20214#21517#31216
|
||||||
|
DataBinding.FieldName = 'FileName'
|
||||||
|
FooterAlignmentHorz = taCenter
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 121
|
||||||
|
end
|
||||||
|
object FileDate: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #19978#20256#26085#26399
|
||||||
|
DataBinding.FieldName = 'FileDate'
|
||||||
|
FooterAlignmentHorz = taCenter
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 104
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridLevel6: TcxGridLevel
|
||||||
|
GridView = TV7
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel16: TPanel
|
||||||
|
Left = 190
|
||||||
|
Top = 126
|
||||||
|
Width = 138
|
||||||
|
Height = 30
|
||||||
|
BevelInner = bvRaised
|
||||||
|
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object ToolBar6: TToolBar
|
||||||
|
Left = 585
|
||||||
|
Top = 41
|
||||||
|
Width = 59
|
||||||
|
Height = 361
|
||||||
|
Align = alRight
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 2
|
||||||
|
object FileUp: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #19978#20256
|
||||||
|
ImageIndex = 109
|
||||||
|
Wrap = True
|
||||||
|
OnClick = FileUpClick
|
||||||
|
end
|
||||||
|
object FileDel: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 30
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
Wrap = True
|
||||||
|
OnClick = FileDelClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 644
|
||||||
|
Height = 41
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
TabOrder = 3
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 8
|
||||||
|
Top = 14
|
||||||
|
Width = 68
|
||||||
|
Height = 16
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -16
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Image2: TImage
|
||||||
|
Left = 445
|
||||||
|
Top = 9
|
||||||
|
Width = 60
|
||||||
|
Height = 28
|
||||||
|
end
|
||||||
|
object Code: TEdit
|
||||||
|
Left = 78
|
||||||
|
Top = 9
|
||||||
|
Width = 211
|
||||||
|
Height = 24
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clBlue
|
||||||
|
Font.Height = -16
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ODPat: TOpenDialog
|
||||||
|
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||||
|
Left = 404
|
||||||
|
Top = 197
|
||||||
|
end
|
||||||
|
object IdFTP1: TIdFTP
|
||||||
|
MaxLineAction = maException
|
||||||
|
ReadTimeout = 0
|
||||||
|
ProxySettings.ProxyType = fpcmNone
|
||||||
|
ProxySettings.Port = 0
|
||||||
|
Left = 405
|
||||||
|
Top = 236
|
||||||
|
end
|
||||||
|
object SaveDialog1: TSaveDialog
|
||||||
|
Left = 409
|
||||||
|
Top = 285
|
||||||
|
end
|
||||||
|
object ADOQueryFile: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 488
|
||||||
|
Top = 144
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryFile
|
||||||
|
Left = 392
|
||||||
|
Top = 168
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 496
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 504
|
||||||
|
Top = 264
|
||||||
|
end
|
||||||
|
end
|
360
样品/U_FileUp.pas
Normal file
360
样品/U_FileUp.pas
Normal file
|
@ -0,0 +1,360 @@
|
||||||
|
unit U_FileUp;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||||
|
cxEdit, DB, cxDBData, ComCtrls, ToolWin, ExtCtrls, cxGridLevel,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||||
|
cxControls, cxGridCustomView, cxGrid, IdBaseComponent, IdComponent,
|
||||||
|
IdTCPConnection, IdTCPClient, IdFTP, StdCtrls, ADODB, jpeg, BtnEdit, IniFiles,
|
||||||
|
strutils, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmFileUp = class(TForm)
|
||||||
|
cxGrid7: TcxGrid;
|
||||||
|
TV7: TcxGridDBTableView;
|
||||||
|
FileName: TcxGridDBColumn;
|
||||||
|
FileDate: TcxGridDBColumn;
|
||||||
|
cxGridLevel6: TcxGridLevel;
|
||||||
|
Panel16: TPanel;
|
||||||
|
ToolBar6: TToolBar;
|
||||||
|
FileUp: TToolButton;
|
||||||
|
FileDel: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Code: TEdit;
|
||||||
|
ODPat: TOpenDialog;
|
||||||
|
IdFTP1: TIdFTP;
|
||||||
|
SaveDialog1: TSaveDialog;
|
||||||
|
ADOQueryFile: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
Image2: TImage;
|
||||||
|
procedure FileUpClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FileDelClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
private
|
||||||
|
lstPat: TStringList;
|
||||||
|
AJpeg: TJPEGImage;
|
||||||
|
procedure CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer);
|
||||||
|
procedure SaveImageOther(FTFID: string);
|
||||||
|
procedure ReadINIFile10();
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
CYID: string;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmFileUp: TfrmFileUp;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
U_DataLink, U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmFileUp.ReadINIFile10();
|
||||||
|
var
|
||||||
|
programIni: Tinifile; //配置文件名
|
||||||
|
FileName: string;
|
||||||
|
begin
|
||||||
|
FileName := ExtractFilePath(Paramstr(0)) + 'SYSTEMSET.INI';
|
||||||
|
programIni := Tinifile.create(FileName);
|
||||||
|
server := programIni.ReadString('SERVER', '服务器地址', '127.0.0.1');
|
||||||
|
programIni.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmFileUp.FileUpClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
i, j: Integer;
|
||||||
|
PatFile: string;
|
||||||
|
FTPPath, FConNo, MaxNo: string;
|
||||||
|
AJpeg: TJPEGImage;
|
||||||
|
myStream: TADOBlobStream;
|
||||||
|
begin
|
||||||
|
if Trim(Code.Text) = '' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('编号不能为空!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
lstPat.Clear;
|
||||||
|
if ODPat.Execute then
|
||||||
|
begin
|
||||||
|
lstPat.AddStrings(ODPat.Files);
|
||||||
|
end;
|
||||||
|
if lstPat.Count > 0 then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
IdFTP1.Host := PicSvr; //PicSvr;
|
||||||
|
IdFTP1.Username := 'three';
|
||||||
|
IdFTP1.Password := '641010';
|
||||||
|
IdFTP1.Connect();
|
||||||
|
except
|
||||||
|
IdFTP1.Quit;
|
||||||
|
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Panel16.Visible := True;
|
||||||
|
Panel16.Refresh;
|
||||||
|
|
||||||
|
try
|
||||||
|
AJpeg := TJpegImage.Create();
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
|
||||||
|
for i := 0 to lstPat.Count - 1 do
|
||||||
|
begin
|
||||||
|
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select isnull(max(abs(cast(right(left(FileName,charindex(''.'',FileName)-1),2) as int))),0)+1 as BH from XD_File');
|
||||||
|
sql.Add('where CYID=''' + trim(CYID) + ''' ');
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
// PatFile:=Copy(ExtractFileName(lstPat[i]),(Pos('.',ExtractFileName(lstPat[i]))+1),(Length(ExtractFileName(lstPat[i]))-Pos('.',ExtractFileName(lstPat[i]))) ) ;
|
||||||
|
PatFile := trim(Code.Text) + '-' + inttostr(ADOQueryTemp.fieldbyname('BH').AsInteger) + '.' + Copy(ExtractFileName(lstPat[i]), (Pos('.', ExtractFileName(lstPat[i])) + 1), (Length(ExtractFileName(lstPat[i])) - Pos('.', ExtractFileName(lstPat[i]))));
|
||||||
|
|
||||||
|
AJpeg.LoadFromFile(ExtractFileName(lstPat[i]));
|
||||||
|
CreThumb(AJpeg, Image2, 160, 120);
|
||||||
|
|
||||||
|
if IdFTP1.Connected then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
// UserDataFlag
|
||||||
|
IdFTP1.Put(lstPat[i], Trim(UserDataFlag + 'YP') + '\' + Trim(PatFile));
|
||||||
|
|
||||||
|
if GetLSNo(ADOQueryCmd, MaxNo, 'YP', 'XD_File', 4, 1) = False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取图片最大号失败!', '提示', 0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from XD_File where 1<>1');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('XFID').Value := Trim(MaxNo);
|
||||||
|
FieldByName('CYID').Value := Trim(CYID);
|
||||||
|
FieldByName('CYNO').Value := Trim(Code.Text);
|
||||||
|
FieldByName('filename').Value := Trim(PatFile);
|
||||||
|
FieldByName('FileDate').Value := SGetServerDate(ADOQueryTemp);
|
||||||
|
fieldbyname('FileType').value := Trim('YP');
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select * from TP_File where TFID=''' + Trim(MaxNo) + '''');
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if ADOQueryCmd.IsEmpty then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('Filler').Value := Trim(DName);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('Editer').Value := Trim(DName);
|
||||||
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
FieldByName('TFID').Value := Trim(MaxNo);
|
||||||
|
FieldByName('WBID').Value := Trim(CYID);
|
||||||
|
FieldByName('TFType').Value := '样品';
|
||||||
|
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||||
|
AJpeg.Assign(Image2.Picture.Graphic);
|
||||||
|
AJpeg.SaveToStream(myStream);
|
||||||
|
myStream.Free;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Update CP_YDang Set TPFlag=1 where CYID=''' + Trim(CYID) + '''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
AJpeg.Free;
|
||||||
|
except
|
||||||
|
AJpeg.Free;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('图片上传失败!', '提示', 0);
|
||||||
|
end;
|
||||||
|
if IdFTP1.Connected then
|
||||||
|
IdFTP1.Quit;
|
||||||
|
with ADOQueryFile do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
{ with ADOQueryFile do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from XD_File where CYID='''+Trim(CYID)+'''');
|
||||||
|
SQL.Add(' and FileType=''YP''');
|
||||||
|
Open;
|
||||||
|
end;}
|
||||||
|
Panel16.Visible := False;
|
||||||
|
if i > 0 then
|
||||||
|
Application.MessageBox(PChar(inttostr(i) + '个文件上传成功!'), '提示', 0);
|
||||||
|
ModalResult := 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmFileUp.CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer);
|
||||||
|
var
|
||||||
|
Bitmap: TBitmap;
|
||||||
|
Ratio: Double;
|
||||||
|
ARect: TRect;
|
||||||
|
AHeight, AHeightOffset: Integer;
|
||||||
|
AWidth, AWidthOffset: Integer;
|
||||||
|
begin
|
||||||
|
Bitmap := TBitmap.Create;
|
||||||
|
try
|
||||||
|
Ratio := AJPeg.Width / AJPeg.Height;
|
||||||
|
if Ratio > 1.333 then
|
||||||
|
begin
|
||||||
|
AHeight := Round(Width / Ratio);
|
||||||
|
AHeightOffset := (Height - AHeight) div 2;
|
||||||
|
AWidth := Width;
|
||||||
|
AWidthOffset := 0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
AWidth := Round(Height * Ratio);
|
||||||
|
AWidthOffset := (Width - AWidth) div 2;
|
||||||
|
AHeight := Height;
|
||||||
|
AHeightOffset := 0;
|
||||||
|
end;
|
||||||
|
Bitmap.Width := Width;
|
||||||
|
Bitmap.Height := Height;
|
||||||
|
Bitmap.Canvas.Brush.Color := clBtnFace;
|
||||||
|
Bitmap.Canvas.FillRect(Rect(0, 0, Width, Height));
|
||||||
|
ARect := Rect(AWidthOffset, AHeightOffset, AWidth + AWidthOffset, AHeight + AHeightOffset);
|
||||||
|
Bitmap.Canvas.StretchDraw(ARect, AJPeg);
|
||||||
|
Image1.Picture.Assign(Bitmap);
|
||||||
|
finally
|
||||||
|
Bitmap.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmFileUp.SaveImageOther(FTFID: string);
|
||||||
|
var
|
||||||
|
AJpeg: TJPEGImage;
|
||||||
|
myStream: TADOBlobStream;
|
||||||
|
ImgMaxNo: string;
|
||||||
|
i, j: Integer;
|
||||||
|
PatFile: string;
|
||||||
|
FConNo, MaxNo: string;
|
||||||
|
begin
|
||||||
|
if Image2.Picture = nil then
|
||||||
|
Exit;
|
||||||
|
AJpeg := TJpegImage.Create();
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select * from TP_File where TFID=''' + Trim(FTFID) + '''');
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(FTFID) = '' then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('Filler').Value := Trim(DName);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('Editer').Value := Trim(DName);
|
||||||
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
FieldByName('TFID').Value := Trim(FTFID);
|
||||||
|
FieldByName('WBID').Value := Trim(CYID);
|
||||||
|
FieldByName('TFType').Value := '样品';
|
||||||
|
AJpeg.Assign(Image2.Picture.Graphic);
|
||||||
|
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||||
|
AJpeg.Assign(Image2.Picture.Graphic);
|
||||||
|
AJpeg.SaveToStream(myStream);
|
||||||
|
myStream.Free;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmFileUp.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
lstPat := TStringList.Create;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmFileUp.FileDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add(' Delete XD_File where XFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||||
|
SQL.Add(' Delete TP_File where TFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
with ADOQueryFile do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||||
|
SQL.Add(' and FileType=''YP''');
|
||||||
|
open;
|
||||||
|
end;
|
||||||
|
if ADOQueryFile.IsEmpty then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Update CP_YDang Set TPFlag=0 where CYID=''' + Trim(CYID) + '''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmFileUp.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with ADOQueryFile do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||||
|
SQL.Add(' and FileType=''YP''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
239
样品/U_GetDllForm.pas
Normal file
239
样品/U_GetDllForm.pas
Normal file
|
@ -0,0 +1,239 @@
|
||||||
|
|
||||||
|
unit U_GetDllForm;
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
Windows, Messages, forms, OleCtnrs, DateUtils, SysUtils, ADODB,IniFiles, dxcore,activeX;
|
||||||
|
function GetDllForm(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;export;stdcall;
|
||||||
|
function ConnData():Boolean;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_CPType,U_CPManage,U_KHGetCPManage,U_iniParam,U_CPManageCX;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
// 功能说明:取Dll中得窗体 //
|
||||||
|
// 参数说明:App>>调用应用程序; //
|
||||||
|
// FormH>>调用窗口句柄 ; //
|
||||||
|
// FormID>>窗口号; //
|
||||||
|
// Language>>语言种类; //
|
||||||
|
// WinStyle>>窗口类型; //
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
function GetDllForm(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;
|
||||||
|
|
||||||
|
var
|
||||||
|
mnewHandle: hwnd;
|
||||||
|
mstyle: TFormStyle; // 0:子窗口; 1:普通窗口
|
||||||
|
mstate: TWindowState;
|
||||||
|
mborderstyle: TFormBorderStyle;
|
||||||
|
begin
|
||||||
|
mNewHandle:=0;
|
||||||
|
DName:=GName;
|
||||||
|
DCode:=GName;
|
||||||
|
DdataBase:=DataBase;
|
||||||
|
DTitCaption:=Title;
|
||||||
|
DParameters1:=Parameters1;
|
||||||
|
DParameters2:=Parameters2;
|
||||||
|
DParameters3:=Parameters3;
|
||||||
|
DParameters4:=Parameters4;
|
||||||
|
DParameters5:=Parameters5;
|
||||||
|
DParameters6:=Parameters6;
|
||||||
|
DParameters7:=Parameters7;
|
||||||
|
DParameters8:=Parameters8;
|
||||||
|
DParameters9:=Parameters9;
|
||||||
|
DParameters10:=Parameters10;
|
||||||
|
|
||||||
|
|
||||||
|
MainApplication:=App;
|
||||||
|
DCurHandle:=FormH;
|
||||||
|
IsDelphiLanguage:= Language;
|
||||||
|
|
||||||
|
Application:=TApplication(App);
|
||||||
|
DCurHandle:=0;
|
||||||
|
|
||||||
|
|
||||||
|
//赋值链接字符串
|
||||||
|
SetLength(server, 255);
|
||||||
|
SetLength(dtbase, 255);
|
||||||
|
SetLength(user, 255);
|
||||||
|
SetLength(pswd, 255);
|
||||||
|
|
||||||
|
server := '101.132.143.144,7781';
|
||||||
|
// server:='.';
|
||||||
|
dtbase := 'huifengdata';
|
||||||
|
user := 'rtsa';
|
||||||
|
pswd := 'rightsoft@5740';
|
||||||
|
DConString := 'Provider=SQLOLEDB.1;Password='+pswd+';Persist Security Info=True;User ID='
|
||||||
|
+user+';Initial Catalog='+dtbase+';Data Source='+server;
|
||||||
|
IF trim(DataBaseStr)<>''then
|
||||||
|
DConString := DataBaseStr;
|
||||||
|
//DParameters1:='英寸';
|
||||||
|
//DParameters2:='门幅无单位';
|
||||||
|
// DParameters5:='工艺';
|
||||||
|
if not ConnData() then
|
||||||
|
begin
|
||||||
|
result:=0;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if IsINIFile() then
|
||||||
|
ReadINIFile()
|
||||||
|
else
|
||||||
|
WriteINIFile ;
|
||||||
|
// 定义窗口类型 、状态
|
||||||
|
if WinStyle=0 then
|
||||||
|
begin
|
||||||
|
mstyle := fsMDIChild ;
|
||||||
|
mstate := wsMaximized ;
|
||||||
|
mborderstyle := bsSizeable;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
mstyle := fsNormal ;
|
||||||
|
mstate := wsNormal ;
|
||||||
|
mborderstyle := bsSizeable;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////
|
||||||
|
//调用子模块窗口
|
||||||
|
case FormId of
|
||||||
|
1: // 样品类别
|
||||||
|
begin
|
||||||
|
if frmCPType=nil then
|
||||||
|
begin
|
||||||
|
frmCPType:= TfrmCPType.Create(application.MainForm);
|
||||||
|
with frmCPType do
|
||||||
|
begin
|
||||||
|
caption:=Trim(Title);
|
||||||
|
FormStyle := mstyle ;
|
||||||
|
windowState := mstate ;
|
||||||
|
BorderStyle := mborderstyle;
|
||||||
|
//show;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
frmCPType.BringToFront;
|
||||||
|
//句柄
|
||||||
|
mNewHandle:=frmCPType.Handle;
|
||||||
|
|
||||||
|
end ;
|
||||||
|
2: // 样品档案
|
||||||
|
begin
|
||||||
|
if frmCPManage=nil then
|
||||||
|
begin
|
||||||
|
frmCPManage:= TfrmCPManage.Create(application.MainForm);
|
||||||
|
with frmCPManage do
|
||||||
|
begin
|
||||||
|
caption:=Trim(Title);
|
||||||
|
FormStyle := mstyle ;
|
||||||
|
windowState := mstate ;
|
||||||
|
BorderStyle := mborderstyle;
|
||||||
|
//show;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
frmCPManage.BringToFront;
|
||||||
|
//句柄
|
||||||
|
mNewHandle:=frmCPManage.Handle;
|
||||||
|
|
||||||
|
end ;
|
||||||
|
3: // 客户取样
|
||||||
|
begin
|
||||||
|
if frmKHGetCPManage=nil then
|
||||||
|
begin
|
||||||
|
frmKHGetCPManage:= TfrmKHGetCPManage.Create(application.MainForm);
|
||||||
|
with frmKHGetCPManage do
|
||||||
|
begin
|
||||||
|
caption:=Trim(Title);
|
||||||
|
FormStyle := mstyle ;
|
||||||
|
windowState := mstate ;
|
||||||
|
BorderStyle := mborderstyle;
|
||||||
|
//show;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
frmKHGetCPManage.BringToFront;
|
||||||
|
//句柄
|
||||||
|
mNewHandle:=frmKHGetCPManage.Handle;
|
||||||
|
|
||||||
|
end ;
|
||||||
|
4: // 样品查询
|
||||||
|
begin
|
||||||
|
if frmCPManageCX=nil then
|
||||||
|
begin
|
||||||
|
frmCPManageCX:= TfrmCPManageCX.Create(application.MainForm);
|
||||||
|
with frmCPManageCX do
|
||||||
|
begin
|
||||||
|
caption:=Trim(Title);
|
||||||
|
FormStyle := mstyle ;
|
||||||
|
windowState := mstate ;
|
||||||
|
BorderStyle := mborderstyle;
|
||||||
|
//show;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
frmCPManageCX.BringToFront;
|
||||||
|
//句柄
|
||||||
|
mNewHandle:=frmCPManageCX.Handle;
|
||||||
|
end ;
|
||||||
|
end ; // end case
|
||||||
|
|
||||||
|
Result:= mnewHandle;
|
||||||
|
// NewDllApp:=Application ;
|
||||||
|
end;
|
||||||
|
//===========================================================
|
||||||
|
//建立数据库连接池
|
||||||
|
//===========================================================
|
||||||
|
function ConnData():Boolean;
|
||||||
|
var
|
||||||
|
IniFile: TIniFile;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
IniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'SYSTEMSET.INI');
|
||||||
|
PicSvr := IniFile.ReadString('SERVER', '服务器地址','127.0.0.1');
|
||||||
|
UserDataFlag:=IniFile.ReadString('SERVER', '服务器地址类型','-1');
|
||||||
|
finally
|
||||||
|
IniFile.Free;
|
||||||
|
end;
|
||||||
|
if not Assigned(DataLink_YPGL) then
|
||||||
|
DataLink_YPGL:=TDataLink_YPGL.Create(Application);
|
||||||
|
Try
|
||||||
|
with DataLink_YPGL.ADOLink do
|
||||||
|
begin
|
||||||
|
if not Connected then
|
||||||
|
begin
|
||||||
|
Connected:=false;
|
||||||
|
ConnectionString:=DConString;
|
||||||
|
LoginPrompt:=false;
|
||||||
|
Connected:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Result:=true;
|
||||||
|
Except
|
||||||
|
Result:=false;
|
||||||
|
application.MessageBox('数据库连接失败!','错误',mb_Ok+ MB_ICONERROR);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
initialization
|
||||||
|
CoInitialize(nil);
|
||||||
|
dxUnitsLoader.Initialize;
|
||||||
|
|
||||||
|
finalization
|
||||||
|
|
||||||
|
DataLink_YPGL.Free;
|
||||||
|
application:=NewDllApp;
|
||||||
|
dxUnitsLoader.Finalize;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
240
样品/U_JWLIn.dfm
Normal file
240
样品/U_JWLIn.dfm
Normal file
|
@ -0,0 +1,240 @@
|
||||||
|
object frmJWLIn: TfrmJWLIn
|
||||||
|
Left = 221
|
||||||
|
Top = 143
|
||||||
|
Width = 910
|
||||||
|
Height = 461
|
||||||
|
Caption = #20837#24211#32534#36753
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 902
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_JWLCK.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
Transparent = True
|
||||||
|
Wrapable = False
|
||||||
|
object BtnSave: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 14
|
||||||
|
OnClick = BtnSaveClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 103
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22797#21046#22686#34892
|
||||||
|
ImageIndex = 105
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 213
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20840#37096#26367#25442
|
||||||
|
ImageIndex = 104
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 300
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 107
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object BtnExit: TToolButton
|
||||||
|
Left = 363
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = BtnExitClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 16
|
||||||
|
Top = 48
|
||||||
|
Width = 857
|
||||||
|
Height = 353
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'DefStr1'
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'GYS'
|
||||||
|
Column = v1ShortName
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = 'YCLCode'
|
||||||
|
Column = v1P_ChnName
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = '1'
|
||||||
|
Position = spFooter
|
||||||
|
Column = v1ShortName
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Quantity
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20837#24211#26102#38388
|
||||||
|
DataBinding.FieldName = 'CRTime'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.Kind = ckDateTime
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 127
|
||||||
|
end
|
||||||
|
object v1DepotClass: TcxGridDBColumn
|
||||||
|
Caption = #20837#24211#31867#22411
|
||||||
|
DataBinding.FieldName = 'CRType'
|
||||||
|
PropertiesClassName = 'TcxComboBoxProperties'
|
||||||
|
Properties.DropDownListStyle = lsFixedList
|
||||||
|
Properties.Items.Strings = (
|
||||||
|
#27491#24120#20837#24211
|
||||||
|
#26399#21021#20837#24211
|
||||||
|
#36710#38388#36864#22238
|
||||||
|
#20854#23427#20837#24211)
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 87
|
||||||
|
end
|
||||||
|
object v1P_ChnName: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #29289#26009#21517#31216
|
||||||
|
DataBinding.FieldName = 'YCLName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1P_ChnNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 92
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'YCLSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 131
|
||||||
|
end
|
||||||
|
object v1ShortName: TcxGridDBColumn
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'GYSName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1ShortNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 85
|
||||||
|
end
|
||||||
|
object v1Quantity: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #20837#24211#25968#37327
|
||||||
|
DataBinding.FieldName = 'CRQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1UnitName: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'CRUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1UnitNamePropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 48
|
||||||
|
end
|
||||||
|
object v1Note: TcxGridDBColumn
|
||||||
|
Tag = 2
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'SNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 108
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = CDS_Sub
|
||||||
|
Left = 192
|
||||||
|
Top = 168
|
||||||
|
end
|
||||||
|
object CDS_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 232
|
||||||
|
Top = 168
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_JWLCK.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 296
|
||||||
|
Top = 200
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_JWLCK.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 264
|
||||||
|
Top = 200
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_JWLCK.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 224
|
||||||
|
Top = 200
|
||||||
|
end
|
||||||
|
end
|
373
样品/U_JWLIn.pas
Normal file
373
样品/U_JWLIn.pas
Normal file
|
@ -0,0 +1,373 @@
|
||||||
|
unit U_JWLIn;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics,
|
||||||
|
cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||||
|
cxClasses, cxControls, cxGridCustomView, cxGrid, ADODB, DBClient,
|
||||||
|
cxButtonEdit, cxDropDownEdit, cxCalendar;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmJWLIn = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
BtnSave: TToolButton;
|
||||||
|
BtnExit: TToolButton;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
v1P_ChnName: TcxGridDBColumn;
|
||||||
|
v1ShortName: TcxGridDBColumn;
|
||||||
|
v1Note: TcxGridDBColumn;
|
||||||
|
v1Quantity: TcxGridDBColumn;
|
||||||
|
v1UnitName: TcxGridDBColumn;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
CDS_Sub: TClientDataSet;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
v1DepotClass: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure BtnExitClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure BtnSaveClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure v1P_ChnNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1ShortNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1UnitNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
FMainID:string;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmJWLIn: TfrmJWLIn;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_ZDYHelp;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.BtnExitClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmJWLIn.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select A.*,B.*,GYSName=C.ZDYName from CK_YCL_Main A inner join CK_YCL_Sub B on A.MainId=B.MainId ');
|
||||||
|
sql.Add(' left join KH_ZDY C on A.GYS=C.ZDYNO');
|
||||||
|
SQL.Add(' where A.MainId='''+Trim(FMainID)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Sub);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Sub);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
if Trim(CDS_Sub.fieldbyname('CRNo').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('不能在此删除已经保存的数据!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.ToolButton4Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
CopyAddRow(tv1,CDS_Sub);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ToolBar1.SetFocus;
|
||||||
|
OneKeyPost(Tv1,CDS_Sub);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmJWLIn.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
MaxNo,SubId,strSQL,LQuantity,LQty:string;
|
||||||
|
KID,i,PStatus,KID1:Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
CDS_Sub.First;
|
||||||
|
while not CDS_Sub.Eof do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.FieldByName('CRQty').AsString)='' then
|
||||||
|
begin
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
CDS_Sub.FieldByName('CRQty').Value:='0';
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end;
|
||||||
|
if Trim(CDS_Sub.fieldbyname('MainId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
MaxNo:=Trim(CDS_Sub.fieldbyname('MainId').AsString);
|
||||||
|
SubId:=Trim(CDS_Sub.fieldbyname('SubId').AsString);
|
||||||
|
KID:=CDS_Sub.fieldbyname('CRID').AsInteger;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,MaxNo,'MR','CK_YCL_Main',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if GetLSNo(ADOQueryCmd,SubId,'SR','CK_YCL_Sub',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('UPDATE CK_CRID SET CRID = CRID+1');
|
||||||
|
SQL.Add('SELECT CRID FROM CK_CRID');
|
||||||
|
Open;
|
||||||
|
KID:=fieldbyname('CRID').AsInteger;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CK_YCL_Sub where MainId='''+Trim(MaxNo)+'''');
|
||||||
|
SQL.Add(' and CRID='+Inttostr(KID));
|
||||||
|
Open;
|
||||||
|
if not ADOQueryTemp.IsEmpty then
|
||||||
|
begin
|
||||||
|
LQuantity:=ADOQueryTemp.fieldbyname('CRQty').AsString;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
LQuantity:='0.00';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
//保存主表
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from CK_YCL_Main where MainId='''+Trim(MaxNo)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('MainId').AsString)<>'' then
|
||||||
|
Edit
|
||||||
|
else
|
||||||
|
Append;
|
||||||
|
FieldByName('MainId').Value:=Trim(MaxNo);
|
||||||
|
FieldByName('CRFlag').Value:='入库';
|
||||||
|
FieldByName('Filler').Value:=Trim(DName);
|
||||||
|
FieldByName('FillTime').Value:=SGetServerDateTime(ADOQueryTemp);
|
||||||
|
FieldByName('CRTime').Value:=Trim(CDS_Sub.fieldbyname('CRTime').AsString);
|
||||||
|
FieldByName('CRType').Value:=Trim(CDS_Sub.fieldbyname('CRType').AsString);
|
||||||
|
FieldByName('GYS').Value:=Trim(CDS_Sub.fieldbyname('GYS').AsString);
|
||||||
|
FieldByName('CKName').Value:=Trim(DParameters1);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//保存从表
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from CK_YCL_Sub where SubId='''+Trim(SubId)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('SubId').AsString)<>'' then
|
||||||
|
Edit
|
||||||
|
else
|
||||||
|
Append;
|
||||||
|
FieldByName('MainId').Value:=Trim(MaxNo);
|
||||||
|
FieldByName('SubId').Value:=Trim(SubId);
|
||||||
|
FieldByName('CRID').Value:=KID;
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv1,CDS_Sub,'CK_YCL_Sub',2);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//保存到库存表
|
||||||
|
if Trim(CDS_Sub.fieldbyname('MainId').AsString)='' then
|
||||||
|
begin
|
||||||
|
strSQL := 'INSERT CK_YCL_KC ('
|
||||||
|
+ 'CRID,'
|
||||||
|
+ 'RKNo,'
|
||||||
|
+ 'KCQty'
|
||||||
|
+ ') VALUES ('
|
||||||
|
+ IntToStr(KID) + ','
|
||||||
|
+ QuotedStr(Trim(SubId)) + ','
|
||||||
|
+ QuotedStr(Trim(CDS_Sub.fieldbyname('CRQty').AsString)) + ''
|
||||||
|
+ ')';
|
||||||
|
|
||||||
|
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
//更新到库存表
|
||||||
|
strSQL := 'UPDATE CK_YCL_KC SET '
|
||||||
|
+ 'RKNo = ' + QuotedStr(Trim(SubId)) + ','
|
||||||
|
+ 'KCQty =KCQty-'+LQuantity+'+'+ CDS_Sub.fieldbyname('CRQty').AsString+ ' '
|
||||||
|
+ 'WHERE CRID = ' + IntToStr(KID);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add(strSQL);
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Next;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
FMainID:=MaxNo;
|
||||||
|
ModalResult:=1;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.BtnSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
if CDS_Sub.Locate('CRTime',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('入库时间不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('YCLName',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('物料名称不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('CRType',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('入库类型不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.Locate('CRQty',Null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('数量不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.v1P_ChnNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='YCL';
|
||||||
|
flagname:='原材料名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('YCLCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
Self.CDS_Sub.FieldByName('YCLName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.v1ShortNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='GYS';
|
||||||
|
flagname:='供应商名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('GYS').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
Self.CDS_Sub.FieldByName('GYSName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLIn.v1UnitNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='DW';
|
||||||
|
flagname:='单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_Sub.Edit;
|
||||||
|
Self.CDS_Sub.FieldByName('CRUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
137
样品/U_JWLInList.dfm
Normal file
137
样品/U_JWLInList.dfm
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
object frmJWLInList: TfrmJWLInList
|
||||||
|
Left = 75
|
||||||
|
Top = 155
|
||||||
|
Width = 1165
|
||||||
|
Height = 618
|
||||||
|
Caption = #20837#24211#21015#34920
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1157
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = TBPrintClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 441
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 496
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 552
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 600
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 672
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 504
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
object CDS_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 588
|
||||||
|
Top = 224
|
||||||
|
end
|
||||||
|
end
|
257
样品/U_JWLInList.pas
Normal file
257
样品/U_JWLInList.pas
Normal file
|
@ -0,0 +1,257 @@
|
||||||
|
unit U_JWLInList;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
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, cxCalendar, cxButtonEdit, cxDropDownEdit,
|
||||||
|
DBClient;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmJWLInList = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
CDS_Main: TClientDataSet;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBPrintClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure YCLNameChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitForm();
|
||||||
|
function DelData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmJWLInList: TfrmJWLInList;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_JWLIn;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmJWLInList:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxgrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('入库列表',Tv1,'贝斯仓库');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select A.*,B.*,GYSName=C.ZDYName from CK_YCL_Main A inner join CK_YCL_Sub B on A.MainId=B.MainId ');
|
||||||
|
sql.Add(' left join KH_ZDY C on A.GYS=C.ZDYNO');
|
||||||
|
SQL.Add(' where CRTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
|
||||||
|
SQL.Add(' and CRTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''');
|
||||||
|
sql.Add(' and CKName='''+Trim(DParameters1)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.InitForm();
|
||||||
|
begin
|
||||||
|
ReadCxGrid('入库列表',Tv1,'原材料仓库');
|
||||||
|
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
BegDate.DateTime:=EndDate.DateTime-7;
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from CK_YCL_Sub where CRID='+Trim(ADOQueryMain.fieldbyname('CRID').AsString));
|
||||||
|
sql.Add(' and MainId like ''MC%'' ');
|
||||||
|
open;
|
||||||
|
if ADOQueryTemp.RecordCount>0 then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('此物品已经有出库记录,不能进行操作!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
try
|
||||||
|
frmJWLIn:=TfrmJWLIn.Create(Application);
|
||||||
|
with frmJWLIn do
|
||||||
|
begin
|
||||||
|
FMainId:=Trim(self.CDS_Main.fieldbyname('MainId').AsString);
|
||||||
|
ToolButton1.Visible:=False;
|
||||||
|
ToolButton2.Visible:=False;
|
||||||
|
ToolButton3.Visible:=False;
|
||||||
|
ToolButton4.Visible:=False;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.TBFind.Click;
|
||||||
|
Self.CDS_Main.Locate('MainId',FMainID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmJWLIn.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from CK_YCL_Sub where CRID='+Trim(ADOQueryMain.fieldbyname('CRID').AsString));
|
||||||
|
sql.Add(' and MainId like ''MC%'' ');
|
||||||
|
open;
|
||||||
|
if ADOQueryTemp.RecordCount>0 then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('此物品已经有出库记录,不能进行操作!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
CDS_Main.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmJWLInList.DelData():Boolean;
|
||||||
|
var
|
||||||
|
FInt:Integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete CK_YCL_Main where MainId='''+Trim(CDS_Main.fieldbyname('MainId').AsString)+'''');
|
||||||
|
sql.Add(' delete CK_YCL_Sub where MainId='''+Trim(CDS_Main.fieldbyname('MainId').AsString)+'''');
|
||||||
|
sql.Add(' delete CK_YCL_KC where CRID='+Trim(CDS_Main.fieldbyname('CRID').AsString));
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('入库列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBPrintClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmJWLIn:=TfrmJWLIn.Create(Application);
|
||||||
|
with frmJWLIn do
|
||||||
|
begin
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.TBFind.Click;
|
||||||
|
Self.CDS_Main.Locate('MainId',FMainID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmJWLIn.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.YCLNameChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmJWLInList.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitForm();
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
450
样品/U_KHGetCPAdd.dfm
Normal file
450
样品/U_KHGetCPAdd.dfm
Normal file
|
@ -0,0 +1,450 @@
|
||||||
|
object frmKHGetCPAdd: TfrmKHGetCPAdd
|
||||||
|
Left = 21
|
||||||
|
Top = 103
|
||||||
|
Width = 1254
|
||||||
|
Height = 625
|
||||||
|
Align = alClient
|
||||||
|
Caption = #25343#26679#30331#35760
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1238
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 14
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 129
|
||||||
|
Width = 1238
|
||||||
|
Height = 458
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellDblClick = Tv1CellDblClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = '0'
|
||||||
|
Position = spFooter
|
||||||
|
Column = v1Column16
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = '0'
|
||||||
|
Position = spFooter
|
||||||
|
Column = v1Column10
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Format = '0'
|
||||||
|
Position = spFooter
|
||||||
|
Column = v1Column12
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
DataBinding.FieldName = 'CYNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 102
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYEName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20013#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYCF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #33521#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYECF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'CYMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'CYKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Tag = 1
|
||||||
|
Caption = #20013#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColorEng'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20215#26684#31867#22411
|
||||||
|
DataBinding.FieldName = 'PriceType'
|
||||||
|
PropertiesClassName = 'TcxComboBoxProperties'
|
||||||
|
Properties.DropDownListStyle = lsFixedList
|
||||||
|
Properties.Items.Strings = (
|
||||||
|
#20844#26020#20215
|
||||||
|
#31859#20215
|
||||||
|
#30721#20215)
|
||||||
|
Properties.OnEditValueChanged = v1Column14PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column16: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
DataBinding.FieldName = 'CIF'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column16PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 50
|
||||||
|
end
|
||||||
|
object v1Column17: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #27719#29575
|
||||||
|
DataBinding.FieldName = 'HuiLv'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column16PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 48
|
||||||
|
end
|
||||||
|
object v1Column18: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #31995#25968
|
||||||
|
DataBinding.FieldName = 'LiRunLv'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = v1Column16PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 51
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20154#27665#24065#20215#26684
|
||||||
|
DataBinding.FieldName = 'RMBPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 82
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #32654#37329#20215#26684
|
||||||
|
DataBinding.FieldName = 'USDPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'CKNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 110
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1238
|
||||||
|
Height = 96
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 2
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 51
|
||||||
|
Top = 16
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #26679#21697#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clBlue
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 288
|
||||||
|
Top = 16
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #23458#25143#21517#31216
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 528
|
||||||
|
Top = 16
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #25343#26679#26102#38388
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 51
|
||||||
|
Top = 48
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = 'CIF'
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 288
|
||||||
|
Top = 48
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #27719' '#29575
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 528
|
||||||
|
Top = 48
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #31995' '#25968
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 776
|
||||||
|
Top = 16
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20215#26684#31867#22411
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 776
|
||||||
|
Top = 48
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #25343#26679#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clRed
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object TLabel
|
||||||
|
Left = 51
|
||||||
|
Top = 72
|
||||||
|
Width = 36
|
||||||
|
Height = 12
|
||||||
|
Caption = #19994#21153#21592
|
||||||
|
end
|
||||||
|
object CYID: TEdit
|
||||||
|
Left = 105
|
||||||
|
Top = 12
|
||||||
|
Width = 131
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnKeyPress = CYIDKeyPress
|
||||||
|
end
|
||||||
|
object KHName: TEdit
|
||||||
|
Left = 340
|
||||||
|
Top = 12
|
||||||
|
Width = 126
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CKDate: TcxDateEdit
|
||||||
|
Left = 578
|
||||||
|
Top = 12
|
||||||
|
Properties.Kind = ckDateTime
|
||||||
|
TabOrder = 2
|
||||||
|
Width = 147
|
||||||
|
end
|
||||||
|
object CIF: TEdit
|
||||||
|
Left = 105
|
||||||
|
Top = 44
|
||||||
|
Width = 131
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object HuiLv: TEdit
|
||||||
|
Left = 340
|
||||||
|
Top = 44
|
||||||
|
Width = 126
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
object LiRunLv: TEdit
|
||||||
|
Left = 578
|
||||||
|
Top = 44
|
||||||
|
Width = 146
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object PriceType: TComboBox
|
||||||
|
Left = 830
|
||||||
|
Top = 12
|
||||||
|
Width = 145
|
||||||
|
Height = 20
|
||||||
|
Style = csDropDownList
|
||||||
|
ItemHeight = 12
|
||||||
|
ItemIndex = 0
|
||||||
|
TabOrder = 6
|
||||||
|
Text = #20844#26020#20215
|
||||||
|
Items.Strings = (
|
||||||
|
#20844#26020#20215
|
||||||
|
#31859#20215
|
||||||
|
#30721#20215)
|
||||||
|
end
|
||||||
|
object CKNO: TEdit
|
||||||
|
Left = 828
|
||||||
|
Top = 44
|
||||||
|
Width = 146
|
||||||
|
Height = 20
|
||||||
|
ReadOnly = True
|
||||||
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 976
|
||||||
|
Top = 12
|
||||||
|
Width = 56
|
||||||
|
Height = 20
|
||||||
|
Caption = #19968#38190#26367#25442
|
||||||
|
TabOrder = 8
|
||||||
|
OnClick = Button1Click
|
||||||
|
end
|
||||||
|
object CKYwy: TEdit
|
||||||
|
Left = 105
|
||||||
|
Top = 72
|
||||||
|
Width = 131
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 9
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CDS_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 416
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 453
|
||||||
|
Top = 193
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = CDS_Sub
|
||||||
|
Left = 491
|
||||||
|
Top = 195
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 389
|
||||||
|
Top = 193
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 565
|
||||||
|
Top = 193
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 528
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
end
|
516
样品/U_KHGetCPAdd.pas
Normal file
516
样品/U_KHGetCPAdd.pas
Normal file
|
@ -0,0 +1,516 @@
|
||||||
|
unit U_KHGetCPAdd;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, ADODB, DBClient, cxGridLevel,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||||
|
cxControls, cxGridCustomView, cxGrid, ComCtrls, ToolWin,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxContainer, cxTextEdit,
|
||||||
|
cxMaskEdit, cxDropDownEdit, cxCalendar, StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmKHGetCPAdd = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
CDS_Sub: TClientDataSet;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
Panel1: TPanel;
|
||||||
|
CYID: TEdit;
|
||||||
|
Label1: TLabel;
|
||||||
|
KHName: TEdit;
|
||||||
|
Label3: TLabel;
|
||||||
|
CKDate: TcxDateEdit;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
CIF: TEdit;
|
||||||
|
HuiLv: TEdit;
|
||||||
|
LiRunLv: TEdit;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
PriceType: TComboBox;
|
||||||
|
v1Column16: TcxGridDBColumn;
|
||||||
|
v1Column17: TcxGridDBColumn;
|
||||||
|
v1Column18: TcxGridDBColumn;
|
||||||
|
CKNO: TEdit;
|
||||||
|
Button1: TButton;
|
||||||
|
CKYwy: TEdit;
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure v1Column14PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure v1Column16PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
Fint:Integer;
|
||||||
|
procedure InitSubGrid();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
FCYID,FCYCode,FCPID,FCPNO:String;
|
||||||
|
CopyInt:Integer;
|
||||||
|
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmKHGetCPAdd: TfrmKHGetCPAdd;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.InitSubGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Select_Get_CP_YDang :CKID,:Begdate,:EndDate,:PState');
|
||||||
|
Parameters.ParamByName('CKID').Value:=Trim(FCYID);
|
||||||
|
Parameters.ParamByName('Begdate').Value:='';
|
||||||
|
Parameters.ParamByName('EndDate').Value:='';
|
||||||
|
Parameters.ParamByName('PState').Value:=3;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Sub);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Sub);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.FormShow(Sender: TObject);
|
||||||
|
var
|
||||||
|
fsj:String;
|
||||||
|
begin
|
||||||
|
|
||||||
|
ReadCxGrid('客户拿样IN',Tv1,'样品管理');
|
||||||
|
InitSubGrid();
|
||||||
|
IF not CDS_Sub.IsEmpty then
|
||||||
|
begin
|
||||||
|
KHName.Text:=Trim(CDS_Sub.fieldbyname('KHName').AsString);
|
||||||
|
CKDate.Date:=CDS_Sub.fieldbyname('CKdate').AsDateTime;
|
||||||
|
CKNO.Text:=Trim(CDS_Sub.fieldbyname('CKNO').AsString);
|
||||||
|
CKYwy.Text:=Trim(CDS_Sub.fieldbyname('CKYwy').AsString);
|
||||||
|
end;
|
||||||
|
if Trim(FCYID)='' then
|
||||||
|
begin
|
||||||
|
CKDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||||
|
CKYwy.Text:=Dname;
|
||||||
|
end;
|
||||||
|
if CopyInt=99 then
|
||||||
|
begin
|
||||||
|
CKNO.Text:='';
|
||||||
|
CDS_Sub.DisableControls;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('CKID').Value:='';
|
||||||
|
Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Sub.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid('客户拿样IN',Tv1,'样品管理');
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
function TfrmKHGetCPAdd.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
maxId,FCKNO:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
if Trim(CKNO.Text)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,FCKNO,'','CP_YDang_KHGet',3,1) =False then
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取拿样编号最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FCKNO:=Trim(CKNO.Text);
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('CKID').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxId,'CK','CP_YDang_KHGet',4,1)=False then
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxId:=Trim(CDS_Sub.fieldbyname('CKID').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from CP_YDang_KHGet where CKID='''+Trim(CDS_Sub.fieldbyname('CKID').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(CDS_Sub.fieldbyname('CKID').AsString)='' then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
end;
|
||||||
|
FieldByName('CKID').Value:=Trim(maxId);
|
||||||
|
FieldByName('CKNO').Value:=Trim(FCKNO);
|
||||||
|
FieldByName('CYID').Value:=Trim(CDS_Sub.fieldbyname('CYID').AsString);
|
||||||
|
FieldByName('KHName').Value:=Trim(KHName.Text);
|
||||||
|
FieldByName('CKYwy').Value:=Trim(CKYwy.Text);
|
||||||
|
FieldByName('CKdate').Value:=CKDate.Date;
|
||||||
|
RTSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_Sub,'CP_YDang_KHGet',3);
|
||||||
|
FieldByName('CostPrice').Value:=CDS_Sub.fieldbyname('CostPrice').Value;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
Result:=True;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Trim(KHName.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('客户不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
ModalResult:=1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
var
|
||||||
|
FReal:Double;
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
if Trim(CIF.Text)<>'' then
|
||||||
|
begin
|
||||||
|
if TryStrToFloat(Trim(CIF.Text),FReal)=False then
|
||||||
|
begin
|
||||||
|
CYID.Text:='';
|
||||||
|
Application.MessageBox('CIF数字非法!','',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if Trim(HuiLv.Text)<>'' then
|
||||||
|
begin
|
||||||
|
if TryStrToFloat(Trim(HuiLv.Text),FReal)=False then
|
||||||
|
begin
|
||||||
|
CYID.Text:='';
|
||||||
|
Application.MessageBox('汇率数字非法!','',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
CYID.Text:='';
|
||||||
|
Application.MessageBox('汇率不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Trim(LiRunLv.Text)<>'' then
|
||||||
|
begin
|
||||||
|
if TryStrToFloat(Trim(LiRunLv.Text),FReal)=False then
|
||||||
|
begin
|
||||||
|
CYID.Text:='';
|
||||||
|
Application.MessageBox('利润率数字非法!','',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
CYID.Text:='';
|
||||||
|
Application.MessageBox('利润率不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select * from CP_YDang where CYID='''+Trim(CYID.Text)+'''');
|
||||||
|
sql.Add(' or CYNo='''+Trim(CYID.Text)+'''');
|
||||||
|
Open;
|
||||||
|
CYID.Text:='';
|
||||||
|
end;
|
||||||
|
if ADOQueryTemp.IsEmpty then Exit;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('CYID').Value:=Trim(ADOQueryTemp.fieldbyname('CYID').AsString);
|
||||||
|
FieldByName('CYNo').Value:=Trim(ADOQueryTemp.fieldbyname('CYNo').AsString);
|
||||||
|
FieldByName('CYName').Value:=Trim(ADOQueryTemp.fieldbyname('CYName').AsString);
|
||||||
|
FieldByName('CYEName').Value:=Trim(ADOQueryTemp.fieldbyname('CYEName').AsString);
|
||||||
|
FieldByName('CYSpec').Value:=Trim(ADOQueryTemp.fieldbyname('CYSpec').AsString);
|
||||||
|
FieldByName('CYCF').Value:=Trim(ADOQueryTemp.fieldbyname('CYCF').AsString);
|
||||||
|
FieldByName('CYECF').Value:=Trim(ADOQueryTemp.fieldbyname('CYECF').AsString);
|
||||||
|
FieldByName('CYMF').Value:=Trim(ADOQueryTemp.fieldbyname('CYMF').AsString);
|
||||||
|
FieldByName('CYKZ').Value:=Trim(ADOQueryTemp.fieldbyname('CYKZ').AsString);
|
||||||
|
FieldByName('CYColor').Value:=Trim(ADOQueryTemp.fieldbyname('CYColor').AsString);
|
||||||
|
FieldByName('PriceType').Value:=Trim(PriceType.Text);
|
||||||
|
FieldByName('CKYwy').Value:=Trim(DName);
|
||||||
|
FieldByName('CYColorEng').Value:=Trim(ADOQueryTemp.fieldbyname('CYColorEng').AsString);
|
||||||
|
{ if Trim(PriceType.Text)='公斤价' then
|
||||||
|
begin
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceKg').Value;
|
||||||
|
end else
|
||||||
|
if Trim(PriceType.Text)='米价' then
|
||||||
|
begin
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceM').Value;
|
||||||
|
end else
|
||||||
|
if Trim(PriceType.Text)='码价' then
|
||||||
|
begin
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceM').Value*1.00/1.0936;
|
||||||
|
end; }
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('price6').AsFloat;
|
||||||
|
if Trim(CIF.Text)='' then
|
||||||
|
begin
|
||||||
|
FieldByName('CIF').Value:=0;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('CIF').Value:=StrToFloat(CIF.Text);
|
||||||
|
end;
|
||||||
|
FieldByName('HuiLv').Value:=StrToFloat(HuiLv.Text);
|
||||||
|
FieldByName('LiRunLv').Value:=StrToFloat(LiRunLv.Text);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
IF FieldByName('LiRunLv').AsFloat=0.0 then
|
||||||
|
begin
|
||||||
|
FieldByName('RMBPrice').Value:=0;
|
||||||
|
FieldByName('USDPrice').Value:=0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
FieldByName('RMBPrice').Value:=FieldByName('CostPrice').AsFloat*1.00/FieldByName('LiRunLv').AsFloat;
|
||||||
|
FieldByName('USDPrice').Value:=FieldByName('CostPrice').AsFloat*1.00/FieldByName('LiRunLv').AsFloat/FieldByName('HuiLv').AsFloat+FieldByName('CIF').AsFloat;
|
||||||
|
end;
|
||||||
|
{
|
||||||
|
FieldByName('RMBPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value;
|
||||||
|
FieldByName('USDPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value*1.00/FieldByName('HuiLv').Value
|
||||||
|
+FieldByName('CIF').Value; }
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
if CDS_Sub.IsEmpty then Exit;
|
||||||
|
if Trim(CDS_Sub.fieldbyname('CKID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除已保存的数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_YDang_KHGet where CKID='''+Trim(CDS_Sub.fieldbyname('CKID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Delete;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.v1Column14PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue:string;
|
||||||
|
begin
|
||||||
|
mvalue:=Trim(TcxComboBox(Sender).EditingText);
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('PriceType').Value:=Trim(mvalue);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select * from CP_YDang where CYID='''+Trim(CDS_Sub.fieldbyname('CYID').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
if ADOQueryTemp.IsEmpty=False then
|
||||||
|
begin
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
if Trim(CDS_Sub.fieldbyname('PriceType').AsString)='公斤价' then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceKg').Value;
|
||||||
|
end else
|
||||||
|
if Trim(CDS_Sub.fieldbyname('PriceType').AsString)='米价' then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceM').Value;
|
||||||
|
end else
|
||||||
|
if Trim(CDS_Sub.fieldbyname('PriceType').AsString)='码价' then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceM').Value*1.00/1.0936;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('RMBPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value;
|
||||||
|
FieldByName('USDPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value*1.00/FieldByName('HuiLv').Value
|
||||||
|
+FieldByName('CIF').Value;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.v1Column16PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,MFieldName:string;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
if Trim(mvalue)='' then
|
||||||
|
begin
|
||||||
|
mvalue:='0';
|
||||||
|
end;
|
||||||
|
MFieldName:=Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(MFieldName).Value:=mvalue;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('RMBPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value;
|
||||||
|
FieldByName('USDPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value*1.00/FieldByName('HuiLv').Value
|
||||||
|
+FieldByName('CIF').Value;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPAdd.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('PriceType').Value:=Trim(PriceType.Text);
|
||||||
|
Post;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select * from CP_YDang where CYID='''+Trim(CDS_Sub.fieldbyname('CYID').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
if ADOQueryTemp.IsEmpty=False then
|
||||||
|
begin
|
||||||
|
CDS_Sub.Edit;
|
||||||
|
if Trim(PriceType.Text)='公斤价' then
|
||||||
|
begin
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceKg').Value;
|
||||||
|
end else
|
||||||
|
if Trim(PriceType.Text)='米价' then
|
||||||
|
begin
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceM').Value;
|
||||||
|
end else
|
||||||
|
if Trim(PriceType.Text)='码价' then
|
||||||
|
begin
|
||||||
|
FieldByName('CostPrice').Value:=ADOQueryTemp.fieldbyname('CYPriceM').Value*1.00/1.0936;
|
||||||
|
end;
|
||||||
|
CDS_Sub.Post;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('RMBPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value;
|
||||||
|
FieldByName('USDPrice').Value:=FieldByName('CostPrice').Value
|
||||||
|
*FieldByName('LiRunLv').Value*1.00/FieldByName('HuiLv').Value
|
||||||
|
+FieldByName('CIF').Value;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
593
样品/U_KHGetCPManage.dfm
Normal file
593
样品/U_KHGetCPManage.dfm
Normal file
|
@ -0,0 +1,593 @@
|
||||||
|
object frmKHGetCPManage: TfrmKHGetCPManage
|
||||||
|
Left = -8
|
||||||
|
Top = 0
|
||||||
|
Width = 1382
|
||||||
|
Height = 754
|
||||||
|
Caption = #25343#26679#21015#34920
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1366
|
||||||
|
Height = 31
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 155
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object ToolButton9: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22797#21046
|
||||||
|
ImageIndex = 58
|
||||||
|
OnClick = ToolButton9Click
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 53
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 441
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26631#31614#25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object ToolButton7: TToolButton
|
||||||
|
Left = 528
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360#25343#26679#28165#21333
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = ToolButton7Click
|
||||||
|
end
|
||||||
|
object ToolButton10: TToolButton
|
||||||
|
Left = 639
|
||||||
|
Top = 0
|
||||||
|
Caption = #25171#21360#25343#26679#28165#21333'('#26080#21333#20215')'
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = ToolButton10Click
|
||||||
|
end
|
||||||
|
object ToolButton8: TToolButton
|
||||||
|
Left = 794
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #31354#30333#20449#31546#32440
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = ToolButton8Click
|
||||||
|
end
|
||||||
|
object ToolButton5: TToolButton
|
||||||
|
Left = 893
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22270#29255#19978#20256
|
||||||
|
ImageIndex = 109
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton5Click
|
||||||
|
end
|
||||||
|
object ToolButton6: TToolButton
|
||||||
|
Left = 980
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22270#29255#19979#36733
|
||||||
|
ImageIndex = 104
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton6Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 1067
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 193
|
||||||
|
Width = 1366
|
||||||
|
Height = 523
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellClick = Tv1CellClick
|
||||||
|
OnCellDblClick = Tv1CellDblClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
object v1Column20: TcxGridDBColumn
|
||||||
|
Caption = #25343#26679#32534#21495
|
||||||
|
DataBinding.FieldName = 'CKNO'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 98
|
||||||
|
end
|
||||||
|
object v1Column19: TcxGridDBColumn
|
||||||
|
Caption = #23458#25143
|
||||||
|
DataBinding.FieldName = 'KHName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 83
|
||||||
|
end
|
||||||
|
object v1Column21: TcxGridDBColumn
|
||||||
|
Caption = #19994#21153#21592
|
||||||
|
DataBinding.FieldName = 'CKYwy'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column18: TcxGridDBColumn
|
||||||
|
Caption = #25343#26679#26102#38388
|
||||||
|
DataBinding.FieldName = 'CKDate'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 106
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Caption = #26679#21697#31867#21035
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
DataBinding.FieldName = 'CYNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYEName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYCF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYECF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'CYMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'CYKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColorEng'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #20154#27665#24065#20215#26684
|
||||||
|
DataBinding.FieldName = 'RMBPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 82
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Caption = #32654#37329#20215#26684
|
||||||
|
DataBinding.FieldName = 'USDPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1Column16: TcxGridDBColumn
|
||||||
|
Caption = #27719#29575
|
||||||
|
DataBinding.FieldName = 'HuiLv'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column17: TcxGridDBColumn
|
||||||
|
Caption = #31995#25968
|
||||||
|
DataBinding.FieldName = 'LiRunLv'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
DataBinding.FieldName = 'CIF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 47
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'CKNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 71
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 31
|
||||||
|
Width = 1366
|
||||||
|
Height = 162
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 2
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 16
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 67
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 92
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 41
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #35268' '#26684
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 118
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #23458' '#25143
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 16
|
||||||
|
Top = 16
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #25343#26679#26085#26399
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 143
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #25343#26679#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clBlue
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Image2: TImage
|
||||||
|
Left = 377
|
||||||
|
Top = 2
|
||||||
|
Width = 192
|
||||||
|
Height = 159
|
||||||
|
end
|
||||||
|
object CYNo: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 235
|
||||||
|
Top = 12
|
||||||
|
Width = 101
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnChange = CYNoChange
|
||||||
|
OnKeyPress = CYNoKeyPress
|
||||||
|
end
|
||||||
|
object CYName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 235
|
||||||
|
Top = 63
|
||||||
|
Width = 101
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object CYEName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 235
|
||||||
|
Top = 88
|
||||||
|
Width = 101
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object CYSpec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 235
|
||||||
|
Top = 37
|
||||||
|
Width = 101
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object KHName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 235
|
||||||
|
Top = 114
|
||||||
|
Width = 101
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = CYNoChange
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 64
|
||||||
|
Top = 12
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
Date = 40970.965677256940000000
|
||||||
|
Time = 40970.965677256940000000
|
||||||
|
TabOrder = 5
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 64
|
||||||
|
Top = 35
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
Date = 40970.965677256940000000
|
||||||
|
Time = 40970.965677256940000000
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
object CKNO: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 235
|
||||||
|
Top = 139
|
||||||
|
Width = 101
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 7
|
||||||
|
OnKeyPress = CKNOKeyPress
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = ADOQueryPrint
|
||||||
|
Left = 395
|
||||||
|
Top = 91
|
||||||
|
end
|
||||||
|
object ADOQueryPrint: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 341
|
||||||
|
Top = 265
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 933
|
||||||
|
Top = 73
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 965
|
||||||
|
Top = 81
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 528
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 491
|
||||||
|
Top = 211
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 453
|
||||||
|
Top = 209
|
||||||
|
end
|
||||||
|
object CDS_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 416
|
||||||
|
Top = 208
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDB_Main
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 368
|
||||||
|
Top = 256
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDB_Main: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 424
|
||||||
|
Top = 296
|
||||||
|
end
|
||||||
|
object ODPat: TOpenDialog
|
||||||
|
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||||
|
Left = 896
|
||||||
|
Top = 109
|
||||||
|
end
|
||||||
|
object IdFTP1: TIdFTP
|
||||||
|
MaxLineAction = maException
|
||||||
|
ReadTimeout = 0
|
||||||
|
ProxySettings.ProxyType = fpcmNone
|
||||||
|
ProxySettings.Port = 0
|
||||||
|
Left = 893
|
||||||
|
Top = 240
|
||||||
|
end
|
||||||
|
object SaveDialog1: TSaveDialog
|
||||||
|
Left = 893
|
||||||
|
Top = 277
|
||||||
|
end
|
||||||
|
object RM2: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDBDataSet1
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 488
|
||||||
|
Top = 312
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDBDataSet1: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = ADOQueryPrint
|
||||||
|
Left = 528
|
||||||
|
Top = 304
|
||||||
|
end
|
||||||
|
object RMXLSExport1: TRMXLSExport
|
||||||
|
ShowAfterExport = True
|
||||||
|
ExportPrecision = 1
|
||||||
|
PagesOfSheet = 1
|
||||||
|
ExportImages = True
|
||||||
|
ExportFrames = True
|
||||||
|
ExportImageFormat = ifBMP
|
||||||
|
JPEGQuality = 0
|
||||||
|
ScaleX = 1.000000000000000000
|
||||||
|
ScaleY = 1.000000000000000000
|
||||||
|
CompressFile = False
|
||||||
|
Left = 640
|
||||||
|
Top = 216
|
||||||
|
end
|
||||||
|
end
|
585
样品/U_KHGetCPManage.pas
Normal file
585
样品/U_KHGetCPManage.pas
Normal file
|
@ -0,0 +1,585 @@
|
||||||
|
unit U_KHGetCPManage;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||||
|
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||||||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||||||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||||
|
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox, RM_e_Xls,jpeg;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmKHGetCPManage = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
ADOQueryPrint: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label2: TLabel;
|
||||||
|
CYNo: TEdit;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
Label1: TLabel;
|
||||||
|
CYName: TEdit;
|
||||||
|
Label4: TLabel;
|
||||||
|
CYEName: TEdit;
|
||||||
|
Label5: TLabel;
|
||||||
|
CYSpec: TEdit;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
CDS_Main: TClientDataSet;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDB_Main: TRMDBDataSet;
|
||||||
|
ODPat: TOpenDialog;
|
||||||
|
IdFTP1: TIdFTP;
|
||||||
|
SaveDialog1: TSaveDialog;
|
||||||
|
ToolButton5: TToolButton;
|
||||||
|
ToolButton6: TToolButton;
|
||||||
|
v1Column18: TcxGridDBColumn;
|
||||||
|
v1Column19: TcxGridDBColumn;
|
||||||
|
Label3: TLabel;
|
||||||
|
KHName: TEdit;
|
||||||
|
Label6: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
v1Column16: TcxGridDBColumn;
|
||||||
|
v1Column17: TcxGridDBColumn;
|
||||||
|
v1Column20: TcxGridDBColumn;
|
||||||
|
Label7: TLabel;
|
||||||
|
CKNO: TEdit;
|
||||||
|
ToolButton7: TToolButton;
|
||||||
|
RM2: TRMGridReport;
|
||||||
|
RMDBDataSet1: TRMDBDataSet;
|
||||||
|
RMXLSExport1: TRMXLSExport;
|
||||||
|
ToolButton8: TToolButton;
|
||||||
|
Image2: TImage;
|
||||||
|
ToolButton9: TToolButton;
|
||||||
|
ToolButton10: TToolButton;
|
||||||
|
v1Column21: TcxGridDBColumn;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure CYNoKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure CYNoChange(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure ToolButton5Click(Sender: TObject);
|
||||||
|
procedure ToolButton6Click(Sender: TObject);
|
||||||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure CKNOKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure ToolButton7Click(Sender: TObject);
|
||||||
|
procedure ToolButton8Click(Sender: TObject);
|
||||||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure ToolButton9Click(Sender: TObject);
|
||||||
|
procedure ToolButton10Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
PState:Integer;
|
||||||
|
FCPID,FTopID:String;
|
||||||
|
procedure InitTree();
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure ReadINIFile();
|
||||||
|
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmKHGetCPManage: TfrmKHGetCPManage;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_CPAdd,U_FileUp,U_KHGetCPAdd;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.InitTree();
|
||||||
|
var
|
||||||
|
i:Integer;
|
||||||
|
begin
|
||||||
|
{with ADOQueryTree do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from CP_Type order by CPlevel,CPName');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
cxDBTreeList1.Items[0].Expand(false); }
|
||||||
|
//cxDBTreeList1.Items[1].Expand(False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Select_Get_CP_YDang :CKID,:Begdate,:EndDate,:PState');
|
||||||
|
Parameters.ParamByName('CKID').Value:='';
|
||||||
|
Parameters.ParamByName('Begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime));
|
||||||
|
Parameters.ParamByName('EndDate').Value:=Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1));
|
||||||
|
Parameters.ParamByName('PState').Value:=0;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmKHGetCPManage:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid('客户拿样',Tv1,'样品管理');
|
||||||
|
if DirectoryExists(ExtractFileDir('E:\Right1209')) then
|
||||||
|
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmKHGetCPManage.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CP_YDang_KHGet where CKID='''+Trim(CDS_Main.fieldbyname('CKID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
CDS_Main.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
//InitTree();
|
||||||
|
ReadCxGrid('样品列表',Tv1,'样品管理');
|
||||||
|
|
||||||
|
EndDate.DateTime:=SGetServerDate(ADOQueryTemp);
|
||||||
|
BegDate.DateTime:=EndDate.DateTime-7;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.cxDBTreeList1DblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmKHGetCPAdd:=TfrmKHGetCPAdd.Create(Application);
|
||||||
|
with frmKHGetCPAdd do
|
||||||
|
begin
|
||||||
|
FCYID:='';
|
||||||
|
//FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
//FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmKHGetCPAdd.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
try
|
||||||
|
frmKHGetCPAdd:=TfrmKHGetCPAdd.Create(Application);
|
||||||
|
with frmKHGetCPAdd do
|
||||||
|
begin
|
||||||
|
FCYID:=Trim(Self.CDS_Main.fieldbyname('CKNO').AsString);
|
||||||
|
//FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
//FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmKHGetCPAdd.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.CYNoKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from CP_YDang where CYID='''+Trim(CYNo.Text)+'''');
|
||||||
|
Open;
|
||||||
|
CYNo.Text:=Trim(fieldbyname('CYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.CYNoChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ToolButton2.Click;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('客户拿样',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile:string;
|
||||||
|
Txt,fImagePath:string;
|
||||||
|
Moudle: THandle;
|
||||||
|
Makebar:TMakebar;
|
||||||
|
Mixtext:TMixtext;
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\样品标签.rmf' ;
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||||
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||||
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||||
|
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
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;
|
||||||
|
RMVariables['QRBARCODE']:=fImagePath;
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton5Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmFileUp:=TfrmFileUp.Create(Application);
|
||||||
|
with frmFileUp do
|
||||||
|
begin
|
||||||
|
Code.Text:=Trim(Self.CDS_Main.fieldbyname('CYNO').AsString);
|
||||||
|
CYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.CDS_Main.Locate('CYID',CYID,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmFileUp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton6Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fHandle:THandle;
|
||||||
|
FInt:Integer;
|
||||||
|
FFName,FPath:String;
|
||||||
|
begin
|
||||||
|
{FPath:='C:\HTTP1209\';
|
||||||
|
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||||
|
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from XD_File where CYNO='''+Trim(CDS_Main.fieldbyname('CYNO').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if IsEmpty then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('样品图片未上传!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
try
|
||||||
|
ReadINIFile();
|
||||||
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||||
|
if Length(server)<6 then
|
||||||
|
begin
|
||||||
|
server:='127.0.0.1';
|
||||||
|
end;
|
||||||
|
IdFTP1.Host :=server;//PicSvr;
|
||||||
|
IdFTP1.Username := 'three';
|
||||||
|
IdFTP1.Password := '641010';
|
||||||
|
IdFTP1.Connect();
|
||||||
|
except
|
||||||
|
IdFTP1.Quit;
|
||||||
|
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
FPath:='D:\Right1209\';
|
||||||
|
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||||
|
CreateDir(ExtractFileDir(FPath));
|
||||||
|
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||||
|
FFName:=FPath+FFName;
|
||||||
|
if FileExists(FFName) then
|
||||||
|
begin
|
||||||
|
FInt:=1;
|
||||||
|
end;
|
||||||
|
if FInt<>1 then
|
||||||
|
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||||
|
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||||
|
);
|
||||||
|
if IdFTP1.Connected then IdFTP1.Quit;
|
||||||
|
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
end;
|
||||||
|
procedure TfrmKHGetCPManage.ReadINIFile();
|
||||||
|
var
|
||||||
|
programIni:Tinifile; //配置文件名
|
||||||
|
FileName:string;
|
||||||
|
begin
|
||||||
|
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
||||||
|
programIni:=Tinifile.create(FileName);
|
||||||
|
server:=programIni.ReadString('SERVER','服务器地址','127.0.0.1');
|
||||||
|
programIni.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
// ToolButton6.Click;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.CKNOKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
if Trim(CKNO.Text)='' then Exit;
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('exec P_Select_Get_CP_YDang :CKID,:Begdate,:EndDate,:PState');
|
||||||
|
Parameters.ParamByName('CKID').Value:=Trim(CKNO.Text);
|
||||||
|
Parameters.ParamByName('Begdate').Value:='';
|
||||||
|
Parameters.ParamByName('EndDate').Value:='';
|
||||||
|
Parameters.ParamByName('PState').Value:=3;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
CKNO.Text:='';
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton7Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile:string;
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
with ADOQueryPrint do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('exec P_Select_Get_CP_YDang :CKID,:Begdate,:EndDate,:PState');
|
||||||
|
Parameters.ParamByName('CKID').Value:=Trim(CDS_Main.fieldbyname('CKNO').AsString);
|
||||||
|
Parameters.ParamByName('Begdate').Value:='';
|
||||||
|
Parameters.ParamByName('EndDate').Value:='';
|
||||||
|
Parameters.ParamByName('PState').Value:=3;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\拿样清单.rmf' ;
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM2.LoadFromFile(fPrintFile);
|
||||||
|
RMVariables['printer']:=Trim(DName);
|
||||||
|
RM2.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\拿样清单.rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton8Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile:string;
|
||||||
|
begin
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\空白信笺纸.rmf' ;
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM2.LoadFromFile(fPrintFile);
|
||||||
|
RM2.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\空白信笺纸.rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
var
|
||||||
|
jpg:TJpegImage;
|
||||||
|
myStream:TADOBlobStream;
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
if Trim(CDS_Main.fieldbyname('CYID').AsString)='' then Exit;
|
||||||
|
// if cxPageControl1.ActivePageIndex=6 then
|
||||||
|
begin
|
||||||
|
Image2.Picture.Assign(nil);
|
||||||
|
try
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add(' select * from TP_File A where A.WBID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||||
|
sql.Add(' and TFType=''样品'' ');
|
||||||
|
open;
|
||||||
|
if RecordCount>0 then
|
||||||
|
begin
|
||||||
|
if trim(ADOQueryTemp.fieldbyname('FilesOther').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
myStream:=tadoblobstream.Create(tblobfield(ADOQueryTemp.fieldbyname('FilesOther')),bmread);
|
||||||
|
if myStream=nil then exit;
|
||||||
|
jpg:=TJPEGImage.Create;
|
||||||
|
jpg.LoadFromStream(myStream);
|
||||||
|
Image2.Picture.Assign(jpg);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
jpg.Free;
|
||||||
|
myStream.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton9Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
try
|
||||||
|
frmKHGetCPAdd:=TfrmKHGetCPAdd.Create(Application);
|
||||||
|
with frmKHGetCPAdd do
|
||||||
|
begin
|
||||||
|
FCYID:=Trim(Self.CDS_Main.fieldbyname('CKNO').AsString);
|
||||||
|
CopyInt:=99;
|
||||||
|
//FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||||
|
//FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmKHGetCPAdd.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetCPManage.ToolButton10Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile:string;
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
with ADOQueryPrint do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('exec P_Select_Get_CP_YDang :CKID,:Begdate,:EndDate,:PState');
|
||||||
|
Parameters.ParamByName('CKID').Value:=Trim(CDS_Main.fieldbyname('CKNO').AsString);
|
||||||
|
Parameters.ParamByName('Begdate').Value:='';
|
||||||
|
Parameters.ParamByName('EndDate').Value:='';
|
||||||
|
Parameters.ParamByName('PState').Value:=3;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\拿样清单(无单价).rmf' ;
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM2.LoadFromFile(fPrintFile);
|
||||||
|
RMVariables['printer']:=Trim(DName);
|
||||||
|
RM2.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\拿样清单(无单价).rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
293
样品/U_KHGetY.dfm
Normal file
293
样品/U_KHGetY.dfm
Normal file
|
@ -0,0 +1,293 @@
|
||||||
|
object frmKHGetY: TfrmKHGetY
|
||||||
|
Left = 68
|
||||||
|
Top = 115
|
||||||
|
Width = 1182
|
||||||
|
Height = 724
|
||||||
|
Caption = #23458#25143#25343#26679
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 31
|
||||||
|
Width = 1174
|
||||||
|
Height = 41
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 0
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 16
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 13
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 184
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 13
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 368
|
||||||
|
Top = 15
|
||||||
|
Width = 48
|
||||||
|
Height = 13
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 544
|
||||||
|
Top = 15
|
||||||
|
Width = 24
|
||||||
|
Height = 13
|
||||||
|
Caption = #35268#26684
|
||||||
|
end
|
||||||
|
object CYNo: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 72
|
||||||
|
Top = 11
|
||||||
|
Width = 89
|
||||||
|
Height = 21
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object CYName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 241
|
||||||
|
Top = 11
|
||||||
|
Width = 89
|
||||||
|
Height = 21
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object CYEName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 425
|
||||||
|
Top = 11
|
||||||
|
Width = 89
|
||||||
|
Height = 21
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object CYSpec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 573
|
||||||
|
Top = 11
|
||||||
|
Width = 89
|
||||||
|
Height = 21
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1174
|
||||||
|
Height = 31
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 1
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 53
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26631#31614#25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
end
|
||||||
|
object ToolButton5: TToolButton
|
||||||
|
Left = 465
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22270#29255#19978#20256
|
||||||
|
ImageIndex = 109
|
||||||
|
end
|
||||||
|
object ToolButton6: TToolButton
|
||||||
|
Left = 552
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22270#29255#19979#36733
|
||||||
|
ImageIndex = 104
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 639
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 72
|
||||||
|
Width = 1174
|
||||||
|
Height = 615
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #23458#25143
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 71
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Caption = #25343#26679#26085#26399
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 74
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Caption = #21333#20215
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 74
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Caption = #24065#31181
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 75
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Caption = #31867#21035
|
||||||
|
DataBinding.FieldName = 'CPName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #20135#21697#32534#21495
|
||||||
|
DataBinding.FieldName = 'CYNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 68
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYEName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYCF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #33521#25991#25104#20998
|
||||||
|
DataBinding.FieldName = 'CYECF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 69
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'CYMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'CYKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'CYColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'CYNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
77
样品/U_KHGetY.pas
Normal file
77
样品/U_KHGetY.pas
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
unit U_KHGetY;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
||||||
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
||||||
|
cxGridCustomView, cxGrid, ComCtrls, ToolWin, StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmKHGetY = class(TForm)
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label4: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
CYNo: TEdit;
|
||||||
|
CYName: TEdit;
|
||||||
|
CYEName: TEdit;
|
||||||
|
CYSpec: TEdit;
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
ToolButton5: TToolButton;
|
||||||
|
ToolButton6: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmKHGetY: TfrmKHGetY;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmKHGetY.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmKHGetY:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmKHGetY.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
653
样品/U_OrderInPut.dfm
Normal file
653
样品/U_OrderInPut.dfm
Normal file
|
@ -0,0 +1,653 @@
|
||||||
|
object frmOrderInPut: TfrmOrderInPut
|
||||||
|
Left = 229
|
||||||
|
Top = 132
|
||||||
|
Width = 835
|
||||||
|
Height = 575
|
||||||
|
Caption = #25351#31034#21333#24405#20837
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 827
|
||||||
|
Height = 29
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clBtnFace
|
||||||
|
EdgeInner = esNone
|
||||||
|
EdgeOuter = esNone
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBSave: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20445#23384
|
||||||
|
ImageIndex = 14
|
||||||
|
OnClick = TBSaveClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = 0
|
||||||
|
Top = 29
|
||||||
|
Width = 827
|
||||||
|
Height = 218
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvNone
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Color = clBtnFace
|
||||||
|
Ctl3D = False
|
||||||
|
ParentColor = False
|
||||||
|
ParentCtl3D = False
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 24
|
||||||
|
Top = 15
|
||||||
|
Width = 65
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#32534#21495#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 214
|
||||||
|
Top = 15
|
||||||
|
Width = 67
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697' '#21517#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 409
|
||||||
|
Top = 15
|
||||||
|
Width = 65
|
||||||
|
Height = 12
|
||||||
|
Caption = #19979#21333#26085#26399#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 601
|
||||||
|
Top = 15
|
||||||
|
Width = 65
|
||||||
|
Height = 12
|
||||||
|
Caption = #20132#36135#26085#26399#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 24
|
||||||
|
Top = 48
|
||||||
|
Width = 66
|
||||||
|
Height = 12
|
||||||
|
Caption = #22383' '#24067' '#21378#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 214
|
||||||
|
Top = 48
|
||||||
|
Width = 66
|
||||||
|
Height = 12
|
||||||
|
Caption = #21360' '#26579' '#21378#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label7: TLabel
|
||||||
|
Left = 409
|
||||||
|
Top = 48
|
||||||
|
Width = 66
|
||||||
|
Height = 12
|
||||||
|
Caption = #21152' '#24037' '#21378#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label8: TLabel
|
||||||
|
Left = 56
|
||||||
|
Top = 86
|
||||||
|
Width = 15
|
||||||
|
Height = 98
|
||||||
|
Caption = #27880#13#10#13#10#24847#13#10#13#10#20107#13#10#13#10#39033
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -14
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label12: TLabel
|
||||||
|
Left = 601
|
||||||
|
Top = 48
|
||||||
|
Width = 67
|
||||||
|
Height = 12
|
||||||
|
Caption = #23458' '#25143#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object OrderNo: TEdit
|
||||||
|
Left = 86
|
||||||
|
Top = 13
|
||||||
|
Width = 100
|
||||||
|
Height = 18
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object OrderDate: TDateTimePicker
|
||||||
|
Left = 470
|
||||||
|
Top = 11
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
BevelInner = bvNone
|
||||||
|
Date = 40916.670856296290000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40916.670856296290000000
|
||||||
|
ShowCheckbox = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object DeliveryDate: TDateTimePicker
|
||||||
|
Left = 663
|
||||||
|
Top = 11
|
||||||
|
Width = 100
|
||||||
|
Height = 20
|
||||||
|
BevelInner = bvNone
|
||||||
|
Date = 40916.670856296290000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40916.670856296290000000
|
||||||
|
ShowCheckbox = True
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object PRTCodeName: TcxButtonEdit
|
||||||
|
Left = 279
|
||||||
|
Top = 11
|
||||||
|
ParentShowHint = False
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = PRTCodeNamePropertiesButtonClick
|
||||||
|
Properties.OnChange = PRTCodeNamePropertiesChange
|
||||||
|
ShowHint = False
|
||||||
|
TabOrder = 3
|
||||||
|
OnKeyDown = PRTCodeNameKeyDown
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object FactoryNo1Name: TcxButtonEdit
|
||||||
|
Left = 87
|
||||||
|
Top = 42
|
||||||
|
Hint = 'FactoryNo1'
|
||||||
|
BeepOnEnter = False
|
||||||
|
ParentShowHint = False
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = FactoryNo1NamePropertiesButtonClick
|
||||||
|
Properties.OnChange = FactoryNo1NamePropertiesChange
|
||||||
|
ShowHint = False
|
||||||
|
TabOrder = 4
|
||||||
|
OnKeyDown = PRTCodeNameKeyDown
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object FactoryNo2Name: TcxButtonEdit
|
||||||
|
Left = 279
|
||||||
|
Top = 42
|
||||||
|
Hint = 'FactoryNo2'
|
||||||
|
BeepOnEnter = False
|
||||||
|
ParentShowHint = False
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = FactoryNo2NamePropertiesButtonClick
|
||||||
|
Properties.OnChange = FactoryNo2NamePropertiesChange
|
||||||
|
ShowHint = False
|
||||||
|
TabOrder = 5
|
||||||
|
OnKeyDown = PRTCodeNameKeyDown
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object FactoryNo3Name: TcxButtonEdit
|
||||||
|
Left = 471
|
||||||
|
Top = 42
|
||||||
|
Hint = 'FactoryNo3'
|
||||||
|
BeepOnEnter = False
|
||||||
|
ParentShowHint = False
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = FactoryNo3NamePropertiesButtonClick
|
||||||
|
Properties.OnChange = FactoryNo3NamePropertiesChange
|
||||||
|
ShowHint = False
|
||||||
|
TabOrder = 6
|
||||||
|
OnKeyDown = PRTCodeNameKeyDown
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object PanZDY: TPanel
|
||||||
|
Left = 664
|
||||||
|
Top = 64
|
||||||
|
Width = 151
|
||||||
|
Height = 153
|
||||||
|
TabOrder = 7
|
||||||
|
Visible = False
|
||||||
|
object CXGridZDY: TcxGrid
|
||||||
|
Left = 3
|
||||||
|
Top = 4
|
||||||
|
Width = 142
|
||||||
|
Height = 113
|
||||||
|
TabOrder = 0
|
||||||
|
object TVZDY: TcxGridDBTableView
|
||||||
|
OnKeyPress = TVZDYKeyPress
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellDblClick = TVZDYCellDblClick
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object VHelpZDYName: TcxGridDBColumn
|
||||||
|
DataBinding.FieldName = 'ZDYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 129
|
||||||
|
IsCaptionAssigned = True
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CXGridZDYLevel1: TcxGridLevel
|
||||||
|
GridView = TVZDY
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 40
|
||||||
|
Top = 120
|
||||||
|
Width = 65
|
||||||
|
Height = 25
|
||||||
|
Caption = #20851#38381
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = Button1Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object CustomerNoName: TcxButtonEdit
|
||||||
|
Left = 663
|
||||||
|
Top = 42
|
||||||
|
Hint = 'CustomerNo'
|
||||||
|
BeepOnEnter = False
|
||||||
|
ParentShowHint = False
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = CustomNoNamePropertiesButtonClick
|
||||||
|
Properties.OnChange = CustomNoNamePropertiesChange
|
||||||
|
ShowHint = False
|
||||||
|
TabOrder = 8
|
||||||
|
OnKeyDown = PRTCodeNameKeyDown
|
||||||
|
Width = 100
|
||||||
|
end
|
||||||
|
object Note: TRichEdit
|
||||||
|
Left = 83
|
||||||
|
Top = 80
|
||||||
|
Width = 483
|
||||||
|
Height = 113
|
||||||
|
TabOrder = 9
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ScrollBox2: TScrollBox
|
||||||
|
Left = 0
|
||||||
|
Top = 483
|
||||||
|
Width = 827
|
||||||
|
Height = 55
|
||||||
|
Align = alBottom
|
||||||
|
BevelInner = bvNone
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Ctl3D = False
|
||||||
|
ParentCtl3D = False
|
||||||
|
TabOrder = 2
|
||||||
|
Visible = False
|
||||||
|
object Label9: TLabel
|
||||||
|
Left = 40
|
||||||
|
Top = 19
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #23457#26680#20154#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label10: TLabel
|
||||||
|
Left = 240
|
||||||
|
Top = 19
|
||||||
|
Width = 60
|
||||||
|
Height = 12
|
||||||
|
Caption = #20027' '#31649#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label11: TLabel
|
||||||
|
Left = 451
|
||||||
|
Top = 19
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #36319#21333#21592#65306
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Chker: TEdit
|
||||||
|
Left = 89
|
||||||
|
Top = 16
|
||||||
|
Width = 121
|
||||||
|
Height = 18
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Person1: TEdit
|
||||||
|
Left = 297
|
||||||
|
Top = 16
|
||||||
|
Width = 121
|
||||||
|
Height = 18
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object Person2: TEdit
|
||||||
|
Left = 500
|
||||||
|
Top = 16
|
||||||
|
Width = 121
|
||||||
|
Height = 18
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ToolBar2: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 247
|
||||||
|
Width = 827
|
||||||
|
Height = 29
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clBtnFace
|
||||||
|
EdgeInner = esNone
|
||||||
|
EdgeOuter = esNone
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 3
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #22686#34892
|
||||||
|
ImageIndex = 103
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#34892
|
||||||
|
ImageIndex = 107
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 276
|
||||||
|
Width = 827
|
||||||
|
Height = 207
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 4
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object v1XHNO: TcxGridDBColumn
|
||||||
|
Caption = #24207#21495
|
||||||
|
DataBinding.FieldName = 'XHNO'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 51
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517'/'#35268#26684
|
||||||
|
DataBinding.FieldName = 'PRTSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 78
|
||||||
|
end
|
||||||
|
object v1PRTColor: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'PRTColor'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1PRTColorPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'PRTMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'PRTKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 67
|
||||||
|
end
|
||||||
|
object v1OrderQty: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#25968
|
||||||
|
DataBinding.FieldName = 'PRTOrderQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21333#20301
|
||||||
|
DataBinding.FieldName = 'OrderUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1OrderUnitPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#26085#26399
|
||||||
|
DataBinding.FieldName = 'PRTDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.ShowTime = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1PRTQty: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#25968
|
||||||
|
DataBinding.FieldName = 'PRTQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Sorting = False
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v1PRTUnit: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#21333#20301
|
||||||
|
DataBinding.FieldName = 'PRTUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1PRTUnitPropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.handBlack
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ADOTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 608
|
||||||
|
Top = 125
|
||||||
|
end
|
||||||
|
object ADOCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 624
|
||||||
|
Top = 157
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Sub
|
||||||
|
Left = 344
|
||||||
|
Top = 376
|
||||||
|
end
|
||||||
|
object Order_Sub: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 384
|
||||||
|
Top = 376
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = ADOZDY
|
||||||
|
Left = 336
|
||||||
|
Top = 120
|
||||||
|
end
|
||||||
|
object ADOZDY: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 368
|
||||||
|
Top = 117
|
||||||
|
end
|
||||||
|
object CDS_ZDY: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 304
|
||||||
|
Top = 120
|
||||||
|
end
|
||||||
|
object ADOQuery1: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 576
|
||||||
|
Top = 173
|
||||||
|
end
|
||||||
|
end
|
602
样品/U_OrderInPut.pas
Normal file
602
样品/U_OrderInPut.pas
Normal file
|
@ -0,0 +1,602 @@
|
||||||
|
unit U_OrderInPut;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
||||||
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
||||||
|
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
||||||
|
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
||||||
|
ExtCtrls, BtnEdit, cxCalendar;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmOrderInPut = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBSave: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
OrderNo: TEdit;
|
||||||
|
OrderDate: TDateTimePicker;
|
||||||
|
Label4: TLabel;
|
||||||
|
DeliveryDate: TDateTimePicker;
|
||||||
|
Label5: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
Label7: TLabel;
|
||||||
|
Label8: TLabel;
|
||||||
|
ScrollBox2: TScrollBox;
|
||||||
|
ToolBar2: TToolBar;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1XHNO: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTColor: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1OrderQty: TcxGridDBColumn;
|
||||||
|
v1PRTQty: TcxGridDBColumn;
|
||||||
|
Label9: TLabel;
|
||||||
|
Chker: TEdit;
|
||||||
|
Label10: TLabel;
|
||||||
|
Person1: TEdit;
|
||||||
|
Label11: TLabel;
|
||||||
|
Person2: TEdit;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
v1PRTUnit: TcxGridDBColumn;
|
||||||
|
ADOTemp: TADOQuery;
|
||||||
|
ADOCmd: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Order_Sub: TClientDataSet;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOZDY: TADOQuery;
|
||||||
|
CDS_ZDY: TClientDataSet;
|
||||||
|
PRTCodeName: TcxButtonEdit;
|
||||||
|
FactoryNo1Name: TcxButtonEdit;
|
||||||
|
FactoryNo2Name: TcxButtonEdit;
|
||||||
|
FactoryNo3Name: TcxButtonEdit;
|
||||||
|
ADOQuery1: TADOQuery;
|
||||||
|
PanZDY: TPanel;
|
||||||
|
CXGridZDY: TcxGrid;
|
||||||
|
TVZDY: TcxGridDBTableView;
|
||||||
|
VHelpZDYName: TcxGridDBColumn;
|
||||||
|
CXGridZDYLevel1: TcxGridLevel;
|
||||||
|
Button1: TButton;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
Label12: TLabel;
|
||||||
|
CustomerNoName: TcxButtonEdit;
|
||||||
|
Note: TRichEdit;
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure PRTCodeNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure PRTCodeNamePropertiesChange(Sender: TObject);
|
||||||
|
procedure FactoryNo1NamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure FactoryNo1NamePropertiesChange(Sender: TObject);
|
||||||
|
procedure FactoryNo2NamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure FactoryNo2NamePropertiesChange(Sender: TObject);
|
||||||
|
procedure FactoryNo3NamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure FactoryNo3NamePropertiesChange(Sender: TObject);
|
||||||
|
procedure PRTCodeNameKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
procedure TVZDYKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBSaveClick(Sender: TObject);
|
||||||
|
procedure v1OrderUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PRTUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure v1PRTColorPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure CustomNoNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure CustomNoNamePropertiesChange(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure InitData();
|
||||||
|
procedure ZDYHelp(FButn:TcxButtonEdit;LType:string);
|
||||||
|
function SaveData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
PState:Integer;
|
||||||
|
FMainId:String;
|
||||||
|
FXS:Integer;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmOrderInPut: TfrmOrderInPut;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_ZDYHelp,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.InitData();
|
||||||
|
begin
|
||||||
|
with ADOQuery1 do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add(' exec Order_QryList :MainId,:WSql');
|
||||||
|
if PState=1 then
|
||||||
|
begin
|
||||||
|
ADOQuery1.Parameters.ParamByName('MainId').Value:=Trim(FMainId);
|
||||||
|
ADOQuery1.Parameters.ParamByName('WSQl').Value:='';
|
||||||
|
end;
|
||||||
|
if PState=0 then
|
||||||
|
begin
|
||||||
|
ADOQuery1.Parameters.ParamByName('MainId').Value:=Trim(FMainId);
|
||||||
|
ADOQuery1.Parameters.ParamByName('WSql').Value:=' and 1<>1 ';
|
||||||
|
end;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQuery1,Order_Sub);
|
||||||
|
SInitCDSData20(ADOQuery1,Order_Sub);
|
||||||
|
SCSHData(ADOQuery1,ScrollBox1,0);
|
||||||
|
if PState=0 then
|
||||||
|
begin
|
||||||
|
OrderDate.DateTime:=SGetServerDateTime(ADOTemp);
|
||||||
|
DeliveryDate.DateTime:=SGetServerDateTime(ADOTemp);
|
||||||
|
end;
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.ZDYHelp(FButn:TcxButtonEdit;LType:string);
|
||||||
|
var
|
||||||
|
FType,ZDYName,FText:String;
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=True;
|
||||||
|
PanZDY.Left:=FButn.Left;
|
||||||
|
PanZDY.Top:=FButn.Top+FButn.Height;
|
||||||
|
with ADOZDY do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type='''+Trim(LType)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
FText:=Trim(FButn.Text);
|
||||||
|
if FText<>'' then
|
||||||
|
SDofilter(ADOZDY,' ZDYName like '+QuotedStr('%'+Trim(FText)+'%'))
|
||||||
|
else
|
||||||
|
SDofilter(ADOZDY,'');
|
||||||
|
VHelpZDYName.Summary.GroupFormat:=Trim(FButn.Name);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.TVZDYCellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
var
|
||||||
|
FName:string;
|
||||||
|
begin
|
||||||
|
if ADOZDY.IsEmpty then Exit;
|
||||||
|
FName:=Trim(VHelpZDYName.Summary.GroupFormat);
|
||||||
|
TcxButtonEdit(FindComponent(FName)).Text:=Trim(ADOZDY.fieldbyname('ZDYName').AsString);
|
||||||
|
TcxButtonEdit(FindComponent(FName)).Hint:=Trim(ADOZDY.fieldbyname('ZDYNO').AsString);
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.PRTCodeNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:=Trim(PRTCodeName.Name);
|
||||||
|
flagname:='产品名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.FXS:=99;
|
||||||
|
PRTCodeName.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
PRTCodeName.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.PRTCodeNamePropertiesChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FXS=99 then
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
FXS:=0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
ZDYHelp(PRTCodeName,Trim(PRTCodeName.Name));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FactoryNo1NamePropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:=Trim(FactoryNo1Name.Name);
|
||||||
|
flagname:='坯布厂名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.FXS:=99;
|
||||||
|
FactoryNo1Name.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
FactoryNo1Name.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
// VHelpZDYName.Visible:=False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FactoryNo1NamePropertiesChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FXS=99 then
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
FXS:=0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
ZDYHelp(FactoryNo1Name,Trim(FactoryNo1Name.Name));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FactoryNo2NamePropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:=Trim(FactoryNo2Name.Name);
|
||||||
|
flagname:='印染厂名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.FXS:=99;
|
||||||
|
FactoryNo2Name.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
FactoryNo2Name.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FactoryNo2NamePropertiesChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FXS=99 then
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
FXS:=0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
ZDYHelp(FactoryNo2Name,Trim(FactoryNo2Name.Name));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FactoryNo3NamePropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:=Trim(FactoryNo3Name.Name);
|
||||||
|
flagname:='加工厂名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.FXS:=99;
|
||||||
|
FactoryNo3Name.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
FactoryNo3Name.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FactoryNo3NamePropertiesChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FXS=99 then
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
FXS:=0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
ZDYHelp(FactoryNo3Name,Trim(FactoryNo3Name.Name));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.PRTCodeNameKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if (key=vk_return) or (Key=vk_Down) then
|
||||||
|
begin
|
||||||
|
if ADOZDY.Active then
|
||||||
|
CXGridZDY.SetFocus;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.TVZDYKeyPress(Sender: TObject; var Key: Char);
|
||||||
|
begin
|
||||||
|
if Key=#13 then
|
||||||
|
begin
|
||||||
|
if ADOZDY.IsEmpty then Exit;
|
||||||
|
TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text:=Trim(ADOZDY.fieldbyname('ZDYName').AsString);
|
||||||
|
TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint:=Trim(ADOZDY.fieldbyname('ZDYNO').AsString);
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
ADOZDY.Active:=False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Trim(DParameters1)='1' then
|
||||||
|
begin
|
||||||
|
Label12.Visible:=False;
|
||||||
|
CustomerNoName.Visible:=False;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Label12.Visible:=True;
|
||||||
|
CustomerNoName.Visible:=True;
|
||||||
|
end;
|
||||||
|
InitData();
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmOrderInPut.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
maxno:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOCmd.Connection.BeginTrans;
|
||||||
|
///保存主表
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select * from Order_Main where MainId='''+Trim(FMainId)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
if Trim(FMainId)='' then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
if GetLSNo(ADOTemp,maxno,'OM','Order_Main',2,1)=False then
|
||||||
|
begin
|
||||||
|
ADOCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('生成流水号异常!','提示',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
maxno:=Trim(FMainId);
|
||||||
|
Edit;
|
||||||
|
end;
|
||||||
|
FieldByName('MainId').Value:=Trim(maxno);
|
||||||
|
SSetsaveSql(ADOCmd,'Order_Main',ScrollBox1,0);
|
||||||
|
if Trim(FMainId)='' then
|
||||||
|
begin
|
||||||
|
FieldByName('Filler').Value:=Trim(DName);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('Editer').Value:=Trim(DName);
|
||||||
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
FMainId:=Trim(maxno);
|
||||||
|
///保存子表
|
||||||
|
with Order_Sub do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOTemp,maxno,'OS','Order_Sub',3,1)=False then
|
||||||
|
begin
|
||||||
|
ADOCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取子流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(Order_Sub.fieldbyname('SubId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from Order_Sub where MainId='''+Trim(FMainId)+'''');
|
||||||
|
sql.Add(' and SubId='''+Trim(maxno)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOCmd do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('MainId').Value:=Trim(FMainId);
|
||||||
|
FieldByName('SubId').Value:=Trim(maxno);
|
||||||
|
SSetSaveDataCDSNew(ADOCmd,Tv1,Order_Sub,'Order_Sub',0);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Order_Sub.Edit;
|
||||||
|
Order_Sub.FieldByName('SubId').Value:=Trim(maxno);
|
||||||
|
//Order_Sub.Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
Result:=False;
|
||||||
|
ADOCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('保存失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.TBSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
OrderDate.SetFocus;
|
||||||
|
if Trim(OrderNo.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('订单编号不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Trim(PRTCodeName.Text)='' then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('品名不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if SaveData() then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('保存成功!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.v1OrderUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdUnit';
|
||||||
|
flagname:='单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('OrderUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.v1PRTUnitPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdUnit';
|
||||||
|
flagname:='单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('PRTUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.v1PRTColorPropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='OrdColor';
|
||||||
|
flagname:='颜色';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Sub.Edit;
|
||||||
|
Self.Order_Sub.FieldByName('PRTColor').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.ToolButton1Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
i:Integer;
|
||||||
|
begin
|
||||||
|
i:=Order_Sub.RecordCount;
|
||||||
|
i:=i+1;
|
||||||
|
with Order_Sub do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('XHNO').Value:=IntToStr(i);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Sub.IsEmpty then Exit;
|
||||||
|
if Trim(Order_Sub.fieldbyname('SubId').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
end;
|
||||||
|
Order_Sub.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.CustomNoNamePropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:=Trim('CustomNoName');
|
||||||
|
flagname:='客户名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.FXS:=99;
|
||||||
|
CustomerNoName.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
CustomerNoName.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderInPut.CustomNoNamePropertiesChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FXS=99 then
|
||||||
|
begin
|
||||||
|
PanZDY.Visible:=False;
|
||||||
|
FXS:=0;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
ZDYHelp(CustomerNoName,'CustomNoName');
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
479
样品/U_OrderSubFH.dfm
Normal file
479
样品/U_OrderSubFH.dfm
Normal file
|
@ -0,0 +1,479 @@
|
||||||
|
object frmOrderSubFH: TfrmOrderSubFH
|
||||||
|
Left = 40
|
||||||
|
Top = 97
|
||||||
|
Width = 1154
|
||||||
|
Height = 577
|
||||||
|
Caption = #25104#21697#21457#36135
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1146
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21457#36135
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20840#36873
|
||||||
|
ImageIndex = 106
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 441
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20840#24323
|
||||||
|
ImageIndex = 107
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 504
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #19968#38190#26367#25442
|
||||||
|
ImageIndex = 51
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object TBTP: TToolButton
|
||||||
|
Left = 591
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #30830#23450#21457#36135
|
||||||
|
ImageIndex = 52
|
||||||
|
OnClick = TBTPClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 678
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1146
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #21457#36135#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OrderNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 336
|
||||||
|
Top = 11
|
||||||
|
Width = 77
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
object PRTCodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 8
|
||||||
|
Top = 80
|
||||||
|
Width = 1009
|
||||||
|
Height = 369
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'CustomNo'
|
||||||
|
Column = v1Column5
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTOrderQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Caption = #36873#20013
|
||||||
|
DataBinding.FieldName = 'SSel'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.ImmediatePost = True
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 43
|
||||||
|
end
|
||||||
|
object v1OrderNo: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
DataBinding.FieldName = 'OrderNoM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'PRTCodeNameM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517'/'#35268#26684
|
||||||
|
DataBinding.FieldName = 'PRTSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1PRTColor: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'PRTColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 41
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'PRTMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 33
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'PRTKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 39
|
||||||
|
end
|
||||||
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#25968#37327
|
||||||
|
DataBinding.FieldName = 'PRTOrderQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21333#20301
|
||||||
|
DataBinding.FieldName = 'OrderUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#25968#37327
|
||||||
|
DataBinding.FieldName = 'PRTQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#21333#20301
|
||||||
|
DataBinding.FieldName = 'PRTUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#21305#25968
|
||||||
|
DataBinding.FieldName = 'CQty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21457#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'FHDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21457#36135#22320#22336
|
||||||
|
DataBinding.FieldName = 'FHAddress'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #23458#25143
|
||||||
|
DataBinding.FieldName = 'CustomNoName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1Column5PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21457#36135#21333#20215
|
||||||
|
DataBinding.FieldName = 'FHPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'JJUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1Column9PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21457#36135#25968#37327
|
||||||
|
DataBinding.FieldName = 'FHQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21457#36135#21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21457#36135#22791#27880
|
||||||
|
DataBinding.FieldName = 'FHNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 544
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 584
|
||||||
|
Top = 120
|
||||||
|
end
|
||||||
|
object Order_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 624
|
||||||
|
Top = 112
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 648
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 688
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 736
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
end
|
467
样品/U_OrderSubFH.pas
Normal file
467
样品/U_OrderSubFH.pas
Normal file
|
@ -0,0 +1,467 @@
|
||||||
|
unit U_OrderSubFH;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, ADODB, DBClient,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||||
|
cxControls, cxGridCustomView, cxGrid, StdCtrls, ComCtrls, ExtCtrls,
|
||||||
|
ToolWin, cxCalendar, cxButtonEdit, cxCheckBox;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmOrderSubFH = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
TBTP: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
OrderNoM: TEdit;
|
||||||
|
PRTCodeNameM: TEdit;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1OrderNo: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTColor: TcxGridDBColumn;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Order_Main: TClientDataSet;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure PRTCodeNameMChange(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure v1Column5PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure TBTPClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure v1Column9PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InitGrid();
|
||||||
|
function DelData():Boolean;
|
||||||
|
procedure OneKeyPostHD(Tv1:TcxGridDBTableView;CDS_Sub:TClientDataSet);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmOrderSubFH: TfrmOrderSubFH;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_ProductOrderList,U_ZDYHelp;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmOrderSubFH:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
procedure TfrmOrderSubFH.InitGrid();
|
||||||
|
var
|
||||||
|
fsj:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec Order_FHQryList :WSQl');
|
||||||
|
fsj:=' and OT.FHDate>='+QuotedStr(Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime)))
|
||||||
|
+' and OT.FHDate<'+QuotedStr(Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1)));
|
||||||
|
Parameters.ParamByName('WSQl').Value:=fsj;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxGrid('发货列表',Tv1,'指示单管理');
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.PRTCodeNameMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('发货列表',Tv1,'指示单管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductOrderList:=TfrmProductOrderList.Create(Application);
|
||||||
|
with frmProductOrderList do
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
frmProductOrderList.TBAdd.Visible:=False;
|
||||||
|
frmProductOrderList.TBEdit.Visible:=False;
|
||||||
|
frmProductOrderList.TBDel.Visible:=False;
|
||||||
|
frmProductOrderList.TBExport.Visible:=False;
|
||||||
|
frmProductOrderList.TBPrint.Visible:=False;
|
||||||
|
frmProductOrderList.TBTP.Visible:=False;
|
||||||
|
frmProductOrderList.cxGrid2.Visible:=False;
|
||||||
|
frmProductOrderList.ToolButton1.Visible:=True;
|
||||||
|
frmProductOrderList.ToolButton2.Visible:=True;
|
||||||
|
frmProductOrderList.ToolButton3.Visible:=True;
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with frmProductOrderList.Order_Main do
|
||||||
|
begin
|
||||||
|
frmProductOrderList.Order_Main.First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if frmProductOrderList.Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||||
|
begin
|
||||||
|
with Self.Order_Main do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
Self.Order_Main.FieldByName('SubId').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
Self.Order_Main.FieldByName('OrderNoM').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('OrderNo').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTCodeNameM').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTCodeName').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTSpec').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTSpec').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTMF').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTColor').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTKZ').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTColor').AsString);
|
||||||
|
if Trim(frmProductOrderList.Order_Main.fieldbyname('PRTOrderQty').AsString)<>'' then
|
||||||
|
Self.Order_Main.FieldByName('PRTOrderQty').Value:=frmProductOrderList.Order_Main.fieldbyname('PRTOrderQty').AsFloat;
|
||||||
|
Self.Order_Main.FieldByName('OrderUnit').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('OrderUnit').AsString);
|
||||||
|
Self.Order_Main.FieldByName('SSel').Value:=1;
|
||||||
|
if Trim(frmProductOrderList.Order_Main.fieldbyname('PRTQty').AsString)<>'' then
|
||||||
|
Self.Order_Main.FieldByName('PRTQty').Value:=frmProductOrderList.Order_Main.fieldbyname('PRTQty').AsFloat;
|
||||||
|
if Trim(frmProductOrderList.Order_Main.fieldbyname('Qty1').AsString)<>'' then
|
||||||
|
Self.Order_Main.FieldByName('CQty1').Value:=frmProductOrderList.Order_Main.fieldbyname('Qty1').AsFloat;
|
||||||
|
Self.Order_Main.FieldByName('PRTUnit').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTUnit').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
frmProductOrderList.Order_Main.Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductOrderList.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.v1Column5PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='CustomNoName';
|
||||||
|
flagname:='客户';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Main.Edit;
|
||||||
|
Self.Order_Main.FieldByName('CustomNoName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
Self.Order_Main.FieldByName('CustomNo').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.TBTPClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
FQty,FQty1,MaxNo:String;
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if Order_Main.Locate('SSel',True,[])=false then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('未选择记录!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
{if Trim(Order_Main.fieldbyname('FHQty').AsString)='' then
|
||||||
|
FQty:='0.0'
|
||||||
|
else
|
||||||
|
FQty:=Trim(Order_Main.fieldbyname('FHQty').AsString);
|
||||||
|
if Trim(Order_Main.fieldbyname('Qty1').AsString)='' then
|
||||||
|
FQty1:='0.0'
|
||||||
|
else
|
||||||
|
FQty1:=Trim(Order_Main.fieldbyname('Qty1').AsString); }
|
||||||
|
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||||
|
begin
|
||||||
|
if Trim(Order_Main.fieldbyname('ToId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxno,'To','Order_Sub_To',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取发货流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(Order_Main.fieldbyname('ToId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from Order_Sub_To where ToId='''+Trim(Order_Main.fieldbyname('ToId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Main.fieldbyname('ToId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('ToId').Value:=Trim(maxno);
|
||||||
|
FieldByName('SubId').Value:=Trim(Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv1,Order_Main,'Order_Sub_To',3);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('ToId').Value:=Trim(maxno);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('发货成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('发货失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
//TBRafresh.Click;
|
||||||
|
//TBFind.Click;
|
||||||
|
Order_Main.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmOrderSubFH.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Order_Sub_To where ToId='''+Trim(Order_Main.fieldbyname('ToId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('发货列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.v1Column9PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='PriceUnit';
|
||||||
|
flagname:='计价单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Main.Edit;
|
||||||
|
Self.Order_Main.FieldByName('JJUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
//Self.Order_Main.FieldByName('CustomNo').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Order_Main.DisableControls;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('SSel').Value:=1;
|
||||||
|
Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Order_Main.EnableControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Order_Main.DisableControls;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('SSel').Value:=0;
|
||||||
|
Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Order_Main.EnableControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.OneKeyPostHD(Tv1:TcxGridDBTableView;CDS_Sub:TClientDataSet);
|
||||||
|
var
|
||||||
|
FValue,FFValue,FColumn,FFColumn:String;
|
||||||
|
begin
|
||||||
|
FColumn:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||||
|
FFColumn:=Tv1.Controller.FocusedColumn.Summary.GroupFormat;
|
||||||
|
FValue:=Trim(CDS_Sub.fieldbyname(FColumn).AsString);
|
||||||
|
if Trim(FFColumn)<>'' then
|
||||||
|
begin
|
||||||
|
FFValue:=Trim(CDS_Sub.fieldbyname(FFColumn).AsString);
|
||||||
|
end;
|
||||||
|
with CDS_Sub do
|
||||||
|
begin
|
||||||
|
DisableControls;
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
if CDS_Sub.FieldByName('Ssel').AsBoolean=True then
|
||||||
|
begin
|
||||||
|
if FValue='' then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName(FColumn).Value:=null;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName(FColumn).Value:=FValue;
|
||||||
|
end;
|
||||||
|
if Trim(FFColumn)<>'' then
|
||||||
|
begin
|
||||||
|
if FFValue='' then
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName(FFColumn).Value:=null;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
CDS_Sub.FieldByName(FFColumn).Value:=FFValue;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFH.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
OneKeyPostHD(Tv1,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
511
样品/U_OrderSubFHOK.dfm
Normal file
511
样品/U_OrderSubFHOK.dfm
Normal file
|
@ -0,0 +1,511 @@
|
||||||
|
object frmOrderSubFHOK: TfrmOrderSubFHOK
|
||||||
|
Left = 69
|
||||||
|
Top = 113
|
||||||
|
Width = 1154
|
||||||
|
Height = 577
|
||||||
|
Caption = #25104#21697#21457#36135#23545#36134#21333
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1146
|
||||||
|
Height = 33
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36873#25321
|
||||||
|
ImageIndex = 3
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
Visible = False
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object TBTP: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
Caption = #30830#35748#25910#27454
|
||||||
|
ImageIndex = 52
|
||||||
|
OnClick = TBTPClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 461
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1146
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #21457#36135#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 574
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #23458#25143
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OrderNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 336
|
||||||
|
Top = 11
|
||||||
|
Width = 77
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
object PRTCodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
object CustomNoName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 603
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 16
|
||||||
|
Top = 80
|
||||||
|
Width = 1009
|
||||||
|
Height = 369
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'CustomNo'
|
||||||
|
Column = v1Column5
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTOrderQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column6
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column7
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column11
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column13
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column15
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
object v1OrderNo: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
DataBinding.FieldName = 'OrderNoM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'PRTCodeNameM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517'/'#35268#26684
|
||||||
|
DataBinding.FieldName = 'PRTSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1PRTColor: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'PRTColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 41
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'PRTMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 33
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'PRTKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 39
|
||||||
|
end
|
||||||
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#25968#37327
|
||||||
|
DataBinding.FieldName = 'PRTOrderQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21333#20301
|
||||||
|
DataBinding.FieldName = 'OrderUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'FHDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#22320#22336
|
||||||
|
DataBinding.FieldName = 'FHAddress'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #23458#25143
|
||||||
|
DataBinding.FieldName = 'CustomNoName'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = v1Column5PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#21333#20215
|
||||||
|
DataBinding.FieldName = 'FHPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 64
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #35745#20215#21333#20301
|
||||||
|
DataBinding.FieldName = 'JJUnit'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = v1Column9PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#25968#37327
|
||||||
|
DataBinding.FieldName = 'FHQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#22791#27880
|
||||||
|
DataBinding.FieldName = 'FHNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #37329#39069
|
||||||
|
DataBinding.FieldName = 'FHMoney'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 50
|
||||||
|
end
|
||||||
|
object v1KHConNo: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #23458#25143#21512#21516#21495
|
||||||
|
DataBinding.FieldName = 'KHConNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 77
|
||||||
|
end
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #25910#36135#20154
|
||||||
|
DataBinding.FieldName = 'SKPerson'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 50
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #25910#27454
|
||||||
|
DataBinding.FieldName = 'SKMoney'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 49
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'SKNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 53
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Caption = #27424#27454
|
||||||
|
DataBinding.FieldName = 'QKMoney'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.FoneRed
|
||||||
|
Width = 54
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 880
|
||||||
|
Top = 32
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 872
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object Order_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 840
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 792
|
||||||
|
Top = 32
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 800
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 824
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
end
|
359
样品/U_OrderSubFHOK.pas
Normal file
359
样品/U_OrderSubFHOK.pas
Normal file
|
@ -0,0 +1,359 @@
|
||||||
|
unit U_OrderSubFHOK;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, ADODB, DBClient,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||||
|
cxControls, cxGridCustomView, cxGrid, StdCtrls, ComCtrls, ExtCtrls,
|
||||||
|
ToolWin, cxCalendar, cxButtonEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmOrderSubFHOK = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
TBTP: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
OrderNoM: TEdit;
|
||||||
|
PRTCodeNameM: TEdit;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1OrderNo: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTColor: TcxGridDBColumn;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Order_Main: TClientDataSet;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1KHConNo: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
Label4: TLabel;
|
||||||
|
CustomNoName: TEdit;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure PRTCodeNameMChange(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure v1Column5PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure TBTPClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure v1Column9PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InitGrid();
|
||||||
|
function DelData():Boolean;
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmOrderSubFHOK: TfrmOrderSubFHOK;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_ProductOrderList,U_ZDYHelp;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmOrderSubFHOK:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
procedure TfrmOrderSubFHOK.InitGrid();
|
||||||
|
var
|
||||||
|
fsj:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec Order_SKQryList :WSQl');
|
||||||
|
fsj:=' and OT.FHDate>='+QuotedStr(Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime)))
|
||||||
|
+' and OT.FHDate<'+QuotedStr(Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1)));
|
||||||
|
Parameters.ParamByName('WSQl').Value:=fsj;
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxGrid('收款列表',Tv1,'指示单管理');
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.PRTCodeNameMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('收款列表',Tv1,'指示单管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmProductOrderList:=TfrmProductOrderList.Create(Application);
|
||||||
|
with frmProductOrderList do
|
||||||
|
begin
|
||||||
|
FFInt:=1;
|
||||||
|
frmProductOrderList.TBAdd.Visible:=False;
|
||||||
|
frmProductOrderList.TBEdit.Visible:=False;
|
||||||
|
frmProductOrderList.TBDel.Visible:=False;
|
||||||
|
frmProductOrderList.TBExport.Visible:=False;
|
||||||
|
frmProductOrderList.TBPrint.Visible:=False;
|
||||||
|
frmProductOrderList.TBTP.Visible:=False;
|
||||||
|
frmProductOrderList.cxGrid2.Visible:=False;
|
||||||
|
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
with Self.Order_Main do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
Self.Order_Main.FieldByName('SubId').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
Self.Order_Main.FieldByName('OrderNoM').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('OrderNo').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTCodeNameM').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTCodeName').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTSpec').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTSpec').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTMF').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTColor').AsString);
|
||||||
|
Self.Order_Main.FieldByName('PRTKZ').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('PRTColor').AsString);
|
||||||
|
if Trim(frmProductOrderList.Order_Main.fieldbyname('PRTOrderQty').AsString)<>'' then
|
||||||
|
Self.Order_Main.FieldByName('PRTOrderQty').Value:=frmProductOrderList.Order_Main.fieldbyname('PRTOrderQty').AsFloat;
|
||||||
|
Self.Order_Main.FieldByName('OrderUnit').Value:=Trim(frmProductOrderList.Order_Main.fieldbyname('OrderUnit').AsString);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmProductOrderList.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.v1Column5PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='CustomNoName';
|
||||||
|
flagname:='客户';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Main.Edit;
|
||||||
|
Self.Order_Main.FieldByName('CustomNoName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
Self.Order_Main.FieldByName('CustomNo').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.TBTPClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
FQty,FQty1,MaxNo,FHMoney,SKMoney,QKMoney:String;
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
// with Order_Main do
|
||||||
|
//begin
|
||||||
|
//First;
|
||||||
|
// while not Eof do
|
||||||
|
//begin
|
||||||
|
{if Trim(Order_Main.fieldbyname('FHQty').AsString)='' then
|
||||||
|
FQty:='0.0'
|
||||||
|
else
|
||||||
|
FQty:=Trim(Order_Main.fieldbyname('FHQty').AsString);
|
||||||
|
if Trim(Order_Main.fieldbyname('Qty1').AsString)='' then
|
||||||
|
FQty1:='0.0'
|
||||||
|
else
|
||||||
|
FQty1:=Trim(Order_Main.fieldbyname('Qty1').AsString); }
|
||||||
|
if Trim(Order_Main.fieldbyname('SKId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxno,'SK','Order_Sub_ToSk',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取发货流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(Order_Main.fieldbyname('SKId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from Order_Sub_ToSk where SKId='''+Trim(Order_Main.fieldbyname('SKId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Main.fieldbyname('SKId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('SKId').Value:=Trim(maxno);
|
||||||
|
FieldByName('ToId').Value:=Trim(Order_Main.fieldbyname('ToId').AsString);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv1,Order_Main,'Order_Sub_ToSk',3);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//Next;
|
||||||
|
//end;
|
||||||
|
|
||||||
|
FHMoney:=Trim(Order_Main.fieldbyname('FHMoney').AsString);
|
||||||
|
SKMoney:=Trim(Order_Main.fieldbyname('SKMoney').AsString);
|
||||||
|
if Trim(FHMoney)='' then FHMoney:='0.0';
|
||||||
|
if Trim(SKMoney)='' then SKMoney:='0.0';
|
||||||
|
QKMoney:=FloatToStr(StrToFloat(FHMoney)-StrToFloat(SKMoney));
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('SKId').Value:=Trim(maxno);
|
||||||
|
FieldByName('QKMoney').Value:=Trim(QKMoney);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('收款成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('收款失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
//TBRafresh.Click;
|
||||||
|
//TBFind.Click;
|
||||||
|
Order_Main.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmOrderSubFHOK.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Order_Sub_To where ToId='''+Trim(Order_Main.fieldbyname('ToId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('收款列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubFHOK.v1Column9PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='PriceUnit';
|
||||||
|
flagname:='计价单位';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.Order_Main.Edit;
|
||||||
|
Self.Order_Main.FieldByName('JJUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
//Self.Order_Main.FieldByName('CustomNo').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
402
样品/U_OrderSubKC.dfm
Normal file
402
样品/U_OrderSubKC.dfm
Normal file
|
@ -0,0 +1,402 @@
|
||||||
|
object frmOrderSubKC: TfrmOrderSubKC
|
||||||
|
Left = 69
|
||||||
|
Top = 113
|
||||||
|
Width = 1154
|
||||||
|
Height = 577
|
||||||
|
Caption = #25104#21697#24211#23384
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1146
|
||||||
|
Height = 33
|
||||||
|
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_OrderManage.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object TBTP: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
Caption = #26356#26032
|
||||||
|
ImageIndex = 106
|
||||||
|
OnClick = TBTPClick
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 311
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 33
|
||||||
|
Width = 1146
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #26597#35810#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OrderNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 336
|
||||||
|
Top = 11
|
||||||
|
Width = 77
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
object PRTCodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = PRTCodeNameMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 8
|
||||||
|
Top = 80
|
||||||
|
Width = 1009
|
||||||
|
Height = 369
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <
|
||||||
|
item
|
||||||
|
Format = 'CustomNo'
|
||||||
|
end>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTOrderQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_OrderManage.cxBlue
|
||||||
|
Styles.Selection = DataLink_OrderManage.cxBlue
|
||||||
|
object v1OrderNo: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
DataBinding.FieldName = 'OrderNoM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'PRTCodeNameM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517'/'#35268#26684
|
||||||
|
DataBinding.FieldName = 'PRTSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1PRTColor: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'PRTColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 41
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'PRTMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 33
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'PRTKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 39
|
||||||
|
end
|
||||||
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#25968#37327
|
||||||
|
DataBinding.FieldName = 'PRTOrderQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21333#20301
|
||||||
|
DataBinding.FieldName = 'OrderUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#25968
|
||||||
|
DataBinding.FieldName = 'PRTQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 62
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#25968#37327
|
||||||
|
DataBinding.FieldName = 'FHQtyM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #21457#36135#21305#25968
|
||||||
|
DataBinding.FieldName = 'FHQty1M'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #21333#20215
|
||||||
|
DataBinding.FieldName = 'FHPrice'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 54
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #24211#23384#25968#37327
|
||||||
|
DataBinding.FieldName = 'KCQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #24211#23384#21305#25968
|
||||||
|
DataBinding.FieldName = 'KCQty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_OrderManage.Default
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #24211#23384#22320#28857
|
||||||
|
DataBinding.FieldName = 'KCPlace'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #24211#23384#21407#22240
|
||||||
|
DataBinding.FieldName = 'KCReason'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #24211#23384#22791#27880
|
||||||
|
DataBinding.FieldName = 'KCNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_OrderManage.FontBlue
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 544
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 584
|
||||||
|
Top = 120
|
||||||
|
end
|
||||||
|
object Order_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 624
|
||||||
|
Top = 112
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 648
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 688
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_OrderManage.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 736
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
end
|
245
样品/U_OrderSubKC.pas
Normal file
245
样品/U_OrderSubKC.pas
Normal file
|
@ -0,0 +1,245 @@
|
||||||
|
unit U_OrderSubKC;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||||
|
cxDataStorage, cxEdit, DB, cxDBData, ADODB, DBClient,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||||
|
cxControls, cxGridCustomView, cxGrid, StdCtrls, ComCtrls, ExtCtrls,
|
||||||
|
ToolWin, cxCalendar, cxButtonEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmOrderSubKC = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
TBTP: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label3: TLabel;
|
||||||
|
Label5: TLabel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
OrderNoM: TEdit;
|
||||||
|
PRTCodeNameM: TEdit;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
v1OrderNo: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTColor: TcxGridDBColumn;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Order_Main: TClientDataSet;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure PRTCodeNameMChange(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBTPClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InitGrid();
|
||||||
|
function DelData():Boolean;
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmOrderSubKC: TfrmOrderSubKC;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_ProductOrderList,U_ZDYHelp;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmOrderSubKC:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
procedure TfrmOrderSubKC.InitGrid();
|
||||||
|
var
|
||||||
|
fsj:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec Order_PRTKCQryList :Begdate,:EndDate ');
|
||||||
|
Parameters.ParamByName('Begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime));
|
||||||
|
Parameters.ParamByName('EndDate').Value:=Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxGrid('成品列表',Tv1,'指示单管理');
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.PRTCodeNameMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('成品列表',Tv1,'指示单管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxGrid1.Align:=alClient;
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.TBTPClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
FQty,FQty1,MaxNo:String;
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
// with Order_Main do
|
||||||
|
//begin
|
||||||
|
//First;
|
||||||
|
// while not Eof do
|
||||||
|
//begin
|
||||||
|
{if Trim(Order_Main.fieldbyname('FHQty').AsString)='' then
|
||||||
|
FQty:='0.0'
|
||||||
|
else
|
||||||
|
FQty:=Trim(Order_Main.fieldbyname('FHQty').AsString);
|
||||||
|
if Trim(Order_Main.fieldbyname('Qty1').AsString)='' then
|
||||||
|
FQty1:='0.0'
|
||||||
|
else
|
||||||
|
FQty1:=Trim(Order_Main.fieldbyname('Qty1').AsString); }
|
||||||
|
if Trim(Order_Main.fieldbyname('KCId').AsString)='' then
|
||||||
|
begin
|
||||||
|
if GetLSNo(ADOQueryCmd,maxno,'KC','Order_Sub_To',4,1)=False then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取库存流水号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
maxno:=Trim(Order_Main.fieldbyname('KCId').AsString);
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from Order_Sub_KC where KCId='''+Trim(Order_Main.fieldbyname('KCId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
if Trim(Order_Main.fieldbyname('KCId').AsString)='' then
|
||||||
|
Append
|
||||||
|
else
|
||||||
|
Edit;
|
||||||
|
FieldByName('KCId').Value:=Trim(maxno);
|
||||||
|
FieldByName('SubId').Value:=Trim(Order_Main.fieldbyname('SubId').AsString);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv1,Order_Main,'Order_Sub_To',3);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//Next;
|
||||||
|
//end;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('KCId').Value:=Trim(maxno);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
//end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('更新成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('更新失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmOrderSubKC.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Order_Sub_KC where KCId='''+Trim(Order_Main.fieldbyname('KCId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmOrderSubKC.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('成品库存列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
614
样品/U_ProductOrderList.dfm
Normal file
614
样品/U_ProductOrderList.dfm
Normal file
|
@ -0,0 +1,614 @@
|
||||||
|
object frmProductOrderList: TfrmProductOrderList
|
||||||
|
Left = 114
|
||||||
|
Top = 133
|
||||||
|
Width = 1013
|
||||||
|
Height = 554
|
||||||
|
Caption = #29983#20135#25351#31034#21333
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1214
|
||||||
|
AutoSize = True
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
Flat = True
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
Images = DataLink_JWLCK.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 2
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object TBFind: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = TBFindClick
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object TBExport: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 75
|
||||||
|
OnClick = TBExportClick
|
||||||
|
end
|
||||||
|
object TBPrint: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
OnClick = TBPrintClick
|
||||||
|
end
|
||||||
|
object TBTP: TToolButton
|
||||||
|
Left = 441
|
||||||
|
Top = 0
|
||||||
|
Caption = #25237#22383#30830#23450
|
||||||
|
ImageIndex = 52
|
||||||
|
OnClick = TBTPClick
|
||||||
|
end
|
||||||
|
object ToolButton3: TToolButton
|
||||||
|
Left = 524
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #30830#23450
|
||||||
|
ImageIndex = 134
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton3Click
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 587
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20840#36873
|
||||||
|
ImageIndex = 106
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 650
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20840#24323
|
||||||
|
ImageIndex = 107
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 713
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 32
|
||||||
|
Width = 1214
|
||||||
|
Height = 42
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 23
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #30331#35760#26085#26399
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 161
|
||||||
|
Top = 15
|
||||||
|
Width = 18
|
||||||
|
Height = 12
|
||||||
|
Caption = '---'
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 283
|
||||||
|
Top = 15
|
||||||
|
Width = 52
|
||||||
|
Height = 12
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label5: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #21697#21517
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 566
|
||||||
|
Top = 15
|
||||||
|
Width = 26
|
||||||
|
Height = 12
|
||||||
|
Caption = #23458#25143
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
end
|
||||||
|
object BegDate: TDateTimePicker
|
||||||
|
Left = 76
|
||||||
|
Top = 11
|
||||||
|
Width = 85
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464742650460000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464742650460000000
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object EndDate: TDateTimePicker
|
||||||
|
Left = 179
|
||||||
|
Top = 11
|
||||||
|
Width = 86
|
||||||
|
Height = 20
|
||||||
|
Date = 40675.464761099540000000
|
||||||
|
Format = 'yyyy-MM-dd'
|
||||||
|
Time = 40675.464761099540000000
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object OrderNoM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 336
|
||||||
|
Top = 11
|
||||||
|
Width = 77
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 2
|
||||||
|
OnChange = OrderNoMChange
|
||||||
|
end
|
||||||
|
object PRTCodeNameM: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 459
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 3
|
||||||
|
OnChange = OrderNoMChange
|
||||||
|
end
|
||||||
|
object CustomerNoName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 595
|
||||||
|
Top = 11
|
||||||
|
Width = 83
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = OrderNoMChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 168
|
||||||
|
Top = 88
|
||||||
|
Width = 729
|
||||||
|
Height = 369
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
OnCellDblClick = Tv1CellDblClick
|
||||||
|
OnFocusedRecordChanged = Tv1FocusedRecordChanged
|
||||||
|
DataController.DataSource = DataSource1
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTOrderQty
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column1
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1PRTQty
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_JWLCK.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_JWLCK.cxBlue
|
||||||
|
Styles.Selection = DataLink_JWLCK.cxBlue
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #36873#25321
|
||||||
|
DataBinding.FieldName = 'SSel'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.ImmediatePost = True
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 39
|
||||||
|
end
|
||||||
|
object v1OrderNo: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#32534#21495
|
||||||
|
DataBinding.FieldName = 'OrderNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517
|
||||||
|
DataBinding.FieldName = 'PRTCodeName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
end
|
||||||
|
object v1OrderDate: TcxGridDBColumn
|
||||||
|
Caption = #19979#21333#26085#26399
|
||||||
|
DataBinding.FieldName = 'OrderDate'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 70
|
||||||
|
end
|
||||||
|
object v1DeliveryDate: TcxGridDBColumn
|
||||||
|
Caption = #20132#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'DeliveryDate'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 63
|
||||||
|
end
|
||||||
|
object v1FactoryNo1Name: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#21378
|
||||||
|
DataBinding.FieldName = 'FactoryNo1Name'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1FactoryNo2Name: TcxGridDBColumn
|
||||||
|
Caption = #21360#26579#21378
|
||||||
|
DataBinding.FieldName = 'FactoryNo2Name'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1FactoryNo3Name: TcxGridDBColumn
|
||||||
|
Caption = #21152#24037#21378
|
||||||
|
DataBinding.FieldName = 'FactoryNo3Name'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1CustomerNoName: TcxGridDBColumn
|
||||||
|
Caption = #23458#25143
|
||||||
|
DataBinding.FieldName = 'CustomerNoName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Note: TcxGridDBColumn
|
||||||
|
Caption = #27880#24847#20107#39033
|
||||||
|
DataBinding.FieldName = 'Note'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
object v1PRTSpec: TcxGridDBColumn
|
||||||
|
Caption = #21697#21517'/'#35268#26684
|
||||||
|
DataBinding.FieldName = 'PRTSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v1PRTColor: TcxGridDBColumn
|
||||||
|
Caption = #39068#33394
|
||||||
|
DataBinding.FieldName = 'PRTColor'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 41
|
||||||
|
end
|
||||||
|
object v1PRTMF: TcxGridDBColumn
|
||||||
|
Caption = #38376#24133
|
||||||
|
DataBinding.FieldName = 'PRTMF'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 33
|
||||||
|
end
|
||||||
|
object v1PRTKZ: TcxGridDBColumn
|
||||||
|
Caption = #20811#37325
|
||||||
|
DataBinding.FieldName = 'PRTKZ'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 39
|
||||||
|
end
|
||||||
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#25968#37327
|
||||||
|
DataBinding.FieldName = 'PRTOrderQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1OrderUnit: TcxGridDBColumn
|
||||||
|
Caption = #35746#21333#21333#20301
|
||||||
|
DataBinding.FieldName = 'OrderUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #25237#22383#25968#37327
|
||||||
|
DataBinding.FieldName = 'TPQtyM'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 57
|
||||||
|
end
|
||||||
|
object v1PRTQty: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#25968#37327
|
||||||
|
DataBinding.FieldName = 'PRTQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1PRTUnit: TcxGridDBColumn
|
||||||
|
Caption = #25104#21697#21333#20301
|
||||||
|
DataBinding.FieldName = 'PRTUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 61
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2: TcxGrid
|
||||||
|
Left = 905
|
||||||
|
Top = 74
|
||||||
|
Width = 309
|
||||||
|
Height = 424
|
||||||
|
Align = alRight
|
||||||
|
TabOrder = 3
|
||||||
|
object Tv2: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v2MxQty
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsBehavior.FocusCellOnTab = True
|
||||||
|
OptionsBehavior.GoToNextCellOnEnter = True
|
||||||
|
OptionsBehavior.FocusCellOnCycle = True
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_JWLCK.cxBlue
|
||||||
|
Styles.IncSearch = DataLink_JWLCK.cxBlue
|
||||||
|
Styles.Selection = DataLink_JWLCK.cxBlue
|
||||||
|
object v2ComeDate: TcxGridDBColumn
|
||||||
|
Caption = #25237#22383#26085#26399
|
||||||
|
DataBinding.FieldName = 'TPDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 65
|
||||||
|
end
|
||||||
|
object v2BatchNo: TcxGridDBColumn
|
||||||
|
Caption = #22383#24067#25209#21495
|
||||||
|
DataBinding.FieldName = 'BatchNo'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 66
|
||||||
|
end
|
||||||
|
object v2Qty1: TcxGridDBColumn
|
||||||
|
Caption = #21305#25968
|
||||||
|
DataBinding.FieldName = 'Qty1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 45
|
||||||
|
end
|
||||||
|
object v2MxQty: TcxGridDBColumn
|
||||||
|
Caption = #25968#37327
|
||||||
|
DataBinding.FieldName = 'TPQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 47
|
||||||
|
end
|
||||||
|
object v2MxNote: TcxGridDBColumn
|
||||||
|
Caption = #22791#27880
|
||||||
|
DataBinding.FieldName = 'TPNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_JWLCK.Default
|
||||||
|
Width = 72
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2Level1: TcxGridLevel
|
||||||
|
GridView = Tv2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxSplitter1: TcxSplitter
|
||||||
|
Left = 897
|
||||||
|
Top = 74
|
||||||
|
Width = 8
|
||||||
|
Height = 424
|
||||||
|
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||||
|
AlignSplitter = salRight
|
||||||
|
Control = cxGrid2
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 544
|
||||||
|
Top = 176
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_JWLCK.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 648
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_JWLCK.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 688
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_JWLCK.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 736
|
||||||
|
Top = 40
|
||||||
|
end
|
||||||
|
object DataSource1: TDataSource
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 584
|
||||||
|
Top = 120
|
||||||
|
end
|
||||||
|
object Order_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 624
|
||||||
|
Top = 112
|
||||||
|
end
|
||||||
|
object ClientDataSet2: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 848
|
||||||
|
Top = 208
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = ClientDataSet2
|
||||||
|
Left = 816
|
||||||
|
Top = 208
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDBMain
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 352
|
||||||
|
Top = 192
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDBMain: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = Order_Main
|
||||||
|
Left = 400
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
object RMXLSExport1: TRMXLSExport
|
||||||
|
ShowAfterExport = True
|
||||||
|
ExportPrecision = 1
|
||||||
|
PagesOfSheet = 1
|
||||||
|
ExportImages = True
|
||||||
|
ExportFrames = True
|
||||||
|
ExportImageFormat = ifBMP
|
||||||
|
JPEGQuality = 0
|
||||||
|
ScaleX = 1.000000000000000000
|
||||||
|
ScaleY = 1.000000000000000000
|
||||||
|
CompressFile = False
|
||||||
|
Left = 576
|
||||||
|
Top = 248
|
||||||
|
end
|
||||||
|
end
|
527
样品/U_ProductOrderList.pas
Normal file
527
样品/U_ProductOrderList.pas
Normal file
|
@ -0,0 +1,527 @@
|
||||||
|
unit U_ProductOrderList;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmProductOrderList = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBFind: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBPrint: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
Panel1: TPanel;
|
||||||
|
BegDate: TDateTimePicker;
|
||||||
|
EndDate: TDateTimePicker;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
DataSource1: TDataSource;
|
||||||
|
Label3: TLabel;
|
||||||
|
OrderNoM: TEdit;
|
||||||
|
Label5: TLabel;
|
||||||
|
PRTCodeNameM: TEdit;
|
||||||
|
TBExport: TToolButton;
|
||||||
|
v1OrderNo: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1OrderDate: TcxGridDBColumn;
|
||||||
|
v1DeliveryDate: TcxGridDBColumn;
|
||||||
|
v1FactoryNo1Name: TcxGridDBColumn;
|
||||||
|
v1FactoryNo2Name: TcxGridDBColumn;
|
||||||
|
v1FactoryNo3Name: TcxGridDBColumn;
|
||||||
|
v1Note: TcxGridDBColumn;
|
||||||
|
v1PRTSpec: TcxGridDBColumn;
|
||||||
|
v1PRTColor: TcxGridDBColumn;
|
||||||
|
v1PRTMF: TcxGridDBColumn;
|
||||||
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1PRTQty: TcxGridDBColumn;
|
||||||
|
v1PRTUnit: TcxGridDBColumn;
|
||||||
|
Order_Main: TClientDataSet;
|
||||||
|
cxGrid2: TcxGrid;
|
||||||
|
Tv2: TcxGridDBTableView;
|
||||||
|
v2ComeDate: TcxGridDBColumn;
|
||||||
|
v2BatchNo: TcxGridDBColumn;
|
||||||
|
v2MxQty: TcxGridDBColumn;
|
||||||
|
v2MxNote: TcxGridDBColumn;
|
||||||
|
cxGrid2Level1: TcxGridLevel;
|
||||||
|
TBTP: TToolButton;
|
||||||
|
ClientDataSet2: TClientDataSet;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
cxSplitter1: TcxSplitter;
|
||||||
|
v2Qty1: TcxGridDBColumn;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDBMain: TRMDBDataSet;
|
||||||
|
RMXLSExport1: TRMXLSExport;
|
||||||
|
v1CustomerNoName: TcxGridDBColumn;
|
||||||
|
Label4: TLabel;
|
||||||
|
CustomerNoName: TEdit;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
ToolButton3: TToolButton;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBFindClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure TBViewClick(Sender: TObject);
|
||||||
|
procedure TBExportClick(Sender: TObject);
|
||||||
|
procedure TBPrintClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure OrderNoMChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||||
|
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
procedure TBTPClick(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitForm();
|
||||||
|
function DelData():Boolean;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
FFInt:Integer;
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmProductOrderList: TfrmProductOrderList;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_OrderInPut,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmProductOrderList:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.FormClose(Sender: TObject;
|
||||||
|
var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
cxgrid1.Align:=alClient;
|
||||||
|
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
||||||
|
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
WriteCxGrid('指示单列表',Tv1,'指示单管理');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('exec Order_QryList :MainId,:WSql');
|
||||||
|
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
|
||||||
|
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.InitForm();
|
||||||
|
begin
|
||||||
|
ReadCxGrid('指示单列表',Tv1,'指示单管理');
|
||||||
|
if FFInt=1 then
|
||||||
|
begin
|
||||||
|
v1Column3.Hidden:=False;
|
||||||
|
v1Column3.Visible:=True;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
v1Column3.Hidden:=True;
|
||||||
|
v1Column3.Visible:=False;
|
||||||
|
end;
|
||||||
|
if Trim(DParameters1)='1' then
|
||||||
|
begin
|
||||||
|
v1CustomerNoName.Visible:=False;
|
||||||
|
v1CustomerNoName.Hidden:=True;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
v1CustomerNoName.Visible:=True;
|
||||||
|
v1CustomerNoName.Hidden:=False;
|
||||||
|
end;
|
||||||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-7;
|
||||||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBFindClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
try
|
||||||
|
frmOrderInPut:=TfrmOrderInPut.Create(Application);
|
||||||
|
with frmOrderInPut do
|
||||||
|
begin
|
||||||
|
PState:=1;
|
||||||
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmOrderInPut.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if DelData() then
|
||||||
|
begin
|
||||||
|
//TBRafresh.Click;
|
||||||
|
//TBFind.Click;
|
||||||
|
Order_Main.Delete;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmProductOrderList.DelData():Boolean;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=false;
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Order_Sub where SubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
if Trim(Order_Main.fieldbyname('SubId').AsString)='' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('delete Order_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Result:=False;
|
||||||
|
Application.MessageBox('数据删除异常!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBViewClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
ShowMessage(DCode);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBExportClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('指示单列表',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBPrintClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile:string;
|
||||||
|
Porderno:string;
|
||||||
|
begin
|
||||||
|
if Order_Main.IsEmpty then Exit;
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\生产指示单.rmf' ;
|
||||||
|
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
//RMVariables['begindate']:=begindate.DateTime;
|
||||||
|
//RMVariables['enddate']:=enddate.DateTime;
|
||||||
|
//RMVariables['printtime']:=Now;
|
||||||
|
//RMVariables['printer']:=Trim(gUserName);
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\生产指示单.rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
SDofilter(ADOQueryMain,'');
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
Order_Main.Locate('ordernoM',Porderno,[]);
|
||||||
|
//SelPrintData(TV4,ADOQueryMain,'合同查询报表');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmOrderInPut:=TfrmOrderInPut.Create(Application);
|
||||||
|
with frmOrderInPut do
|
||||||
|
begin
|
||||||
|
PState:=0;
|
||||||
|
FMainId:='';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmOrderInPut.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.OrderNoMChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active=False then Exit;
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitForm();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.Tv1CellDblClick(
|
||||||
|
Sender: TcxCustomGridTableView;
|
||||||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||||
|
AShift: TShiftState; var AHandled: Boolean);
|
||||||
|
begin
|
||||||
|
if FFInt=1 then
|
||||||
|
ModalResult:=1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.Tv1FocusedRecordChanged(
|
||||||
|
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||||
|
AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
begin
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select A.*,C.BatchNo from Contract_Sub_MxTo A ');
|
||||||
|
sql.Add(' inner join Contract_Sub_Mx C on A.MxId=C.MxId');
|
||||||
|
SQL.Add(' where A.OrdSubId='''+Trim(Order_Main.fieldbyname('SubId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet2);
|
||||||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.TBTPClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
FQty,FQty1,FMxQty,FPQty,FMxQtyS,FPQtyS:String;
|
||||||
|
begin
|
||||||
|
{if ClientDataSet2.Locate('TPDate',null,[]) then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('投坯日期不能为空!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if ClientDataSet2.FieldByName('TPQty').AsFloat=0 then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('投坯数量不能为0!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
if ClientDataSet2.IsEmpty then Exit;
|
||||||
|
BegDate.SetFocus;
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
with ClientDataSet2 do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('TPQty').AsString)='' then
|
||||||
|
FQty:='0.0'
|
||||||
|
else
|
||||||
|
FQty:=Trim(ClientDataSet2.fieldbyname('TPQty').AsString);
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('Qty1').AsString)='' then
|
||||||
|
FQty1:='0.0'
|
||||||
|
else
|
||||||
|
FQty1:=Trim(ClientDataSet2.fieldbyname('Qty1').AsString);
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select MxQty,Qty1 from Contract_Sub_Mx where MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
FMxQty:=Trim(fieldbyname('MxQty').AsString);
|
||||||
|
FPQty:=Trim(fieldbyname('Qty1').AsString);
|
||||||
|
if Trim(FMxQty)='' then FMxQty:='0.0';
|
||||||
|
if Trim(FPQty)='' then FPQty:='0.0';
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FMxQty:='0.0';
|
||||||
|
FPQty:='0.0';
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
SQL.Add('select Sum(isnull(TPQty,0)) TPQty,Sum(isnull(Qty1,0)) Qty1 from Contract_Sub_Mxto where MxId='''+Trim(ClientDataSet2.fieldbyname('MxId').AsString)+'''');
|
||||||
|
sql.Add(' and ToId<>'''+Trim(ClientDataSet2.fieldbyname('ToId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
if not IsEmpty then
|
||||||
|
begin
|
||||||
|
FMxQtyS:=Trim(fieldbyname('TPQty').AsString);
|
||||||
|
FPQtyS:=Trim(fieldbyname('Qty1').AsString);
|
||||||
|
if Trim(FMxQtyS)='' then FMxQtyS:='0.0';
|
||||||
|
if Trim(FPQtyS)='' then FPQtyS:='0.0';
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FMxQtyS:='0.0';
|
||||||
|
FPQtyS:='0.0';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if StrToFloat(FQty)+StrToFloat(FMxQtyS)-StrToFloat(FMxQty)>0 then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox(PChar('批号为:'+Trim(ClientDataSet2.fieldbyname('BatchNo').AsString)+
|
||||||
|
'的数量是'+FMxQty+'投坯总数量为'+FloatToStr(StrToFloat(FQty)+StrToFloat(FMxQtyS))
|
||||||
|
+',数量不足,确定要投坯吗?'),'提示',32+4)<>IDYES then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if StrToFloat(FQty1)+StrToFloat(FPQtyS)-StrToFloat(FPQty)>0 then
|
||||||
|
begin
|
||||||
|
if Application.MessageBox(PChar('批号为:'+Trim(ClientDataSet2.fieldbyname('BatchNo').AsString)+
|
||||||
|
'的匹数是'+FPQty+'投坯总匹数为'+FloatToStr(StrToFloat(FQty1)+StrToFloat(FPQtyS))
|
||||||
|
+',匹数不足,确定要投坯吗?'),'提示',32+4)<>IDYES then
|
||||||
|
begin
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('Update Contract_Sub_Mxto Set TPQty='+FQty);
|
||||||
|
sql.Add(',Qty1='+FQty1);
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('TPDate').AsString)<>'' then
|
||||||
|
sql.Add(',TPDate='''+Trim(ClientDataSet2.fieldbyname('TPDate').AsString)+'''');
|
||||||
|
if Trim(ClientDataSet2.fieldbyname('TPNote').AsString)<>'' then
|
||||||
|
sql.Add(',TPNote='''+Trim(ClientDataSet2.fieldbyname('TPNote').AsString)+'''');
|
||||||
|
SQL.Add(' where ToId='''+Trim(ClientDataSet2.fieldbyname('ToId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Application.MessageBox('投坯成功!','提示',0);
|
||||||
|
except
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('投坯失败!','提示',0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Order_Main.DisableControls;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('SSel').Value:=1;
|
||||||
|
Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Order_Main.EnableControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Order_Main.DisableControls;
|
||||||
|
with Order_Main do
|
||||||
|
begin
|
||||||
|
First;
|
||||||
|
while not Eof do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('SSel').Value:=0;
|
||||||
|
Post;
|
||||||
|
Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Order_Main.EnableControls;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmProductOrderList.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ModalResult:=1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
602
样品/U_SGManage.dfm
Normal file
602
样品/U_SGManage.dfm
Normal file
|
@ -0,0 +1,602 @@
|
||||||
|
object frmSGManage: TfrmSGManage
|
||||||
|
Left = 188
|
||||||
|
Top = 79
|
||||||
|
Width = 1038
|
||||||
|
Height = 618
|
||||||
|
Caption = #30003#36141#21333#31649#29702
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1030
|
||||||
|
Height = 31
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 83
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_WFBSG.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_WFBSG.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object TBAdd: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26032#22686
|
||||||
|
ImageIndex = 3
|
||||||
|
OnClick = TBAddClick
|
||||||
|
end
|
||||||
|
object TBEdit: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20462#25913
|
||||||
|
ImageIndex = 54
|
||||||
|
OnClick = TBEditClick
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 315
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 53
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object ToolButton4: TToolButton
|
||||||
|
Left = 378
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #26631#31614#25171#21360
|
||||||
|
ImageIndex = 12
|
||||||
|
Visible = False
|
||||||
|
OnClick = ToolButton4Click
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 465
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 70
|
||||||
|
Width = 1030
|
||||||
|
Height = 249
|
||||||
|
Align = alTop
|
||||||
|
TabOrder = 1
|
||||||
|
object Tv1: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
NavigatorButtons.Delete.Enabled = False
|
||||||
|
NavigatorButtons.Delete.Visible = False
|
||||||
|
OnFocusedRecordChanged = Tv1FocusedRecordChanged
|
||||||
|
DataController.DataSource = DataSource2
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column3
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column10
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = v1Column11
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Deleting = False
|
||||||
|
OptionsData.DeletingConfirmation = False
|
||||||
|
OptionsSelection.CellSelect = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
Styles.Inactive = DataLink_WFBSG.SHuangSe
|
||||||
|
Styles.IncSearch = DataLink_WFBSG.SHuangSe
|
||||||
|
Styles.Selection = DataLink_WFBSG.SHuangSe
|
||||||
|
object v1Column12: TcxGridDBColumn
|
||||||
|
Caption = #20998#31867
|
||||||
|
DataBinding.FieldName = 'YCLType'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 58
|
||||||
|
end
|
||||||
|
object v1Column15: TcxGridDBColumn
|
||||||
|
Caption = #35831#36141#26085#26399
|
||||||
|
DataBinding.FieldName = 'SGDate'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 85
|
||||||
|
end
|
||||||
|
object v1Column1: TcxGridDBColumn
|
||||||
|
Caption = #29289#26009#21517#31216
|
||||||
|
DataBinding.FieldName = 'YCLName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 82
|
||||||
|
end
|
||||||
|
object v1Column2: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684#22411#21495
|
||||||
|
DataBinding.FieldName = 'YCLSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 78
|
||||||
|
end
|
||||||
|
object v1Column3: TcxGridDBColumn
|
||||||
|
Caption = #35831#36141#25968#37327
|
||||||
|
DataBinding.FieldName = 'SGQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 83
|
||||||
|
end
|
||||||
|
object v1Column4: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'SGUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 79
|
||||||
|
end
|
||||||
|
object v1Column5: TcxGridDBColumn
|
||||||
|
Caption = #38656#27714#26085#26399
|
||||||
|
DataBinding.FieldName = 'XQDate'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 76
|
||||||
|
end
|
||||||
|
object v1Column6: TcxGridDBColumn
|
||||||
|
Caption = #38656#27714#21407#22240#21450#29992#36884
|
||||||
|
DataBinding.FieldName = 'SGNote'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 105
|
||||||
|
end
|
||||||
|
object v1Column7: TcxGridDBColumn
|
||||||
|
Caption = #29616#26377#24211#23384
|
||||||
|
DataBinding.FieldName = 'NowKC'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 85
|
||||||
|
end
|
||||||
|
object v1Column14: TcxGridDBColumn
|
||||||
|
Caption = #24211#23384#21333#20301
|
||||||
|
DataBinding.FieldName = 'ZDYStr1'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
|
object v1Column8: TcxGridDBColumn
|
||||||
|
Caption = #30003#35831#20154
|
||||||
|
DataBinding.FieldName = 'SGPerson'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 87
|
||||||
|
end
|
||||||
|
object v1Column9: TcxGridDBColumn
|
||||||
|
Caption = #24050#19979#21333
|
||||||
|
DataBinding.FieldName = 'YXD'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 49
|
||||||
|
end
|
||||||
|
object v1Column10: TcxGridDBColumn
|
||||||
|
Caption = #19979#21333#25968#37327
|
||||||
|
DataBinding.FieldName = 'XDQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 59
|
||||||
|
end
|
||||||
|
object v1Column13: TcxGridDBColumn
|
||||||
|
Caption = #24050#20132#36135
|
||||||
|
DataBinding.FieldName = 'YJH'
|
||||||
|
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||||
|
Properties.NullStyle = nssUnchecked
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 46
|
||||||
|
end
|
||||||
|
object v1Column11: TcxGridDBColumn
|
||||||
|
Caption = #20132#36135#25968#37327
|
||||||
|
DataBinding.FieldName = 'JHQty'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 56
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid1Level1: TcxGridLevel
|
||||||
|
GridView = Tv1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 31
|
||||||
|
Width = 1030
|
||||||
|
Height = 39
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 2
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 594
|
||||||
|
Top = 13
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #35268#26684#22411#21495
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 430
|
||||||
|
Top = 13
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #29289#26009#21517#31216
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 22
|
||||||
|
Top = 13
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #35831#36141#26085#26399
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 164
|
||||||
|
Top = 13
|
||||||
|
Width = 30
|
||||||
|
Height = 12
|
||||||
|
Caption = '-----'
|
||||||
|
end
|
||||||
|
object Label4: TLabel
|
||||||
|
Left = 297
|
||||||
|
Top = 13
|
||||||
|
Width = 24
|
||||||
|
Height = 12
|
||||||
|
Caption = #20998#31867
|
||||||
|
end
|
||||||
|
object YCLSpec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 643
|
||||||
|
Top = 9
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnChange = YCLNameChange
|
||||||
|
end
|
||||||
|
object YCLName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 478
|
||||||
|
Top = 9
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnChange = YCLNameChange
|
||||||
|
end
|
||||||
|
object begdate: TDateTimePicker
|
||||||
|
Left = 72
|
||||||
|
Top = 9
|
||||||
|
Width = 97
|
||||||
|
Height = 20
|
||||||
|
Date = 41256.918237847230000000
|
||||||
|
Time = 41256.918237847230000000
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object Enddate: TDateTimePicker
|
||||||
|
Left = 182
|
||||||
|
Top = 9
|
||||||
|
Width = 97
|
||||||
|
Height = 20
|
||||||
|
Date = 41256.918237847230000000
|
||||||
|
Time = 41256.918237847230000000
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object YCLType: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 323
|
||||||
|
Top = 9
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = YCLNameChange
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel2: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 319
|
||||||
|
Width = 1030
|
||||||
|
Height = 41
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Caption = #37319#36141#22238#25191
|
||||||
|
Color = clSkyBlue
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = [fsBold]
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 3
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 24
|
||||||
|
Top = 8
|
||||||
|
Width = 75
|
||||||
|
Height = 25
|
||||||
|
Caption = #22686#34892
|
||||||
|
TabOrder = 0
|
||||||
|
OnClick = Button1Click
|
||||||
|
end
|
||||||
|
object Button2: TButton
|
||||||
|
Left = 112
|
||||||
|
Top = 8
|
||||||
|
Width = 75
|
||||||
|
Height = 25
|
||||||
|
Caption = #21024#34892
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = Button2Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 360
|
||||||
|
Width = 1030
|
||||||
|
Height = 221
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 4
|
||||||
|
object Tv2: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
NavigatorButtons.Delete.Enabled = False
|
||||||
|
NavigatorButtons.Delete.Visible = False
|
||||||
|
DataController.DataSource = DS_HZ
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = cxGridDBColumn5
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = cxGridDBColumn9
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Deleting = False
|
||||||
|
OptionsData.DeletingConfirmation = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object cxGridDBColumn1: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #32463#21150#26085#26399
|
||||||
|
DataBinding.FieldName = 'JBDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.SaveTime = False
|
||||||
|
Properties.ShowTime = False
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn8PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 73
|
||||||
|
end
|
||||||
|
object cxGridDBColumn2: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20379#24212#21830
|
||||||
|
DataBinding.FieldName = 'GYS'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
|
Properties.OnButtonClick = cxGridDBColumn2PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 85
|
||||||
|
end
|
||||||
|
object cxGridDBColumn3: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #29289#26009#21517#31216
|
||||||
|
DataBinding.FieldName = 'YCLName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 86
|
||||||
|
end
|
||||||
|
object cxGridDBColumn4: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #35268#26684#22411#21495
|
||||||
|
DataBinding.FieldName = 'YCLSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 78
|
||||||
|
end
|
||||||
|
object cxGridDBColumn5: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #19979#21333#25968#37327
|
||||||
|
DataBinding.FieldName = 'OrdQty'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn5PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 83
|
||||||
|
end
|
||||||
|
object cxGridDBColumn6: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'SGUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 79
|
||||||
|
end
|
||||||
|
object cxGridDBColumn7: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #39044#35745#20132#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'YJJHDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.SaveTime = False
|
||||||
|
Properties.ShowTime = False
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn8PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 94
|
||||||
|
end
|
||||||
|
object cxGridDBColumn8: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #23454#38469#20132#36135#26085#26399
|
||||||
|
DataBinding.FieldName = 'JHDate'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.SaveTime = False
|
||||||
|
Properties.ShowTime = False
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn8PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 105
|
||||||
|
end
|
||||||
|
object cxGridDBColumn9: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #23454#38469#20132#36135#25968#37327
|
||||||
|
DataBinding.FieldName = 'SJQty'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn5PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 85
|
||||||
|
end
|
||||||
|
object cxGridDBColumn10: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #37319#36141#20154
|
||||||
|
DataBinding.FieldName = 'CGPerson'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn8PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_WFBSG.Default
|
||||||
|
Width = 87
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridLevel1: TcxGridLevel
|
||||||
|
GridView = Tv2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_WFBSG.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 789
|
||||||
|
Top = 9
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_WFBSG.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 829
|
||||||
|
Top = 1
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid1
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 512
|
||||||
|
Top = 152
|
||||||
|
end
|
||||||
|
object DataSource2: TDataSource
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 451
|
||||||
|
Top = 155
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_WFBSG.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 397
|
||||||
|
Top = 153
|
||||||
|
end
|
||||||
|
object CDS_Main: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 368
|
||||||
|
Top = 152
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDB_Main
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 480
|
||||||
|
Top = 152
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDB_Main: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
DataSet = CDS_Main
|
||||||
|
Left = 424
|
||||||
|
Top = 152
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid2
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 560
|
||||||
|
Top = 456
|
||||||
|
end
|
||||||
|
object DS_HZ: TDataSource
|
||||||
|
DataSet = CDS_HZ
|
||||||
|
Left = 403
|
||||||
|
Top = 451
|
||||||
|
end
|
||||||
|
object CDS_HZ: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 368
|
||||||
|
Top = 448
|
||||||
|
end
|
||||||
|
end
|
539
样品/U_SGManage.pas
Normal file
539
样品/U_SGManage.pas
Normal file
|
@ -0,0 +1,539 @@
|
||||||
|
unit U_SGManage;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||||
|
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||||||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||||||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||||
|
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox, cxCalendar,
|
||||||
|
cxButtonEdit, cxTextEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmSGManage = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBAdd: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||||
|
Tv1: TcxGridDBTableView;
|
||||||
|
cxGrid1Level1: TcxGridLevel;
|
||||||
|
cxGrid1: TcxGrid;
|
||||||
|
Panel1: TPanel;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
TBEdit: TToolButton;
|
||||||
|
Label1: TLabel;
|
||||||
|
YCLSpec: TEdit;
|
||||||
|
v1Column1: TcxGridDBColumn;
|
||||||
|
v1Column2: TcxGridDBColumn;
|
||||||
|
v1Column3: TcxGridDBColumn;
|
||||||
|
v1Column4: TcxGridDBColumn;
|
||||||
|
v1Column5: TcxGridDBColumn;
|
||||||
|
v1Column6: TcxGridDBColumn;
|
||||||
|
v1Column7: TcxGridDBColumn;
|
||||||
|
v1Column8: TcxGridDBColumn;
|
||||||
|
DataSource2: TDataSource;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
CDS_Main: TClientDataSet;
|
||||||
|
v1Column12: TcxGridDBColumn;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ToolButton4: TToolButton;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDB_Main: TRMDBDataSet;
|
||||||
|
v1Column15: TcxGridDBColumn;
|
||||||
|
Label3: TLabel;
|
||||||
|
YCLName: TEdit;
|
||||||
|
Panel2: TPanel;
|
||||||
|
cxGrid2: TcxGrid;
|
||||||
|
Tv2: TcxGridDBTableView;
|
||||||
|
cxGridDBColumn1: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn2: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn3: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn4: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn5: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn6: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn7: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn8: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn9: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn10: TcxGridDBColumn;
|
||||||
|
cxGridLevel1: TcxGridLevel;
|
||||||
|
Button1: TButton;
|
||||||
|
Button2: TButton;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
begdate: TDateTimePicker;
|
||||||
|
Enddate: TDateTimePicker;
|
||||||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||||
|
DS_HZ: TDataSource;
|
||||||
|
CDS_HZ: TClientDataSet;
|
||||||
|
Label4: TLabel;
|
||||||
|
YCLType: TEdit;
|
||||||
|
v1Column9: TcxGridDBColumn;
|
||||||
|
v1Column10: TcxGridDBColumn;
|
||||||
|
v1Column11: TcxGridDBColumn;
|
||||||
|
v1Column13: TcxGridDBColumn;
|
||||||
|
v1Column14: TcxGridDBColumn;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBAddClick(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure TBEditClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure YCLNameChange(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton4Click(Sender: TObject);
|
||||||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||||
|
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn2PropertiesButtonClick(Sender: TObject;
|
||||||
|
AButtonIndex: Integer);
|
||||||
|
procedure cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InitGrid();
|
||||||
|
procedure InitGridHZ();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmSGManage: TfrmSGManage;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun,U_SGInput,U_FileUp, U_ZDYHelp;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TfrmSGManage.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select AA.*,Case when XDQty>0 then cast(1 as bit) else cast(0 as bit) end as YXD ');
|
||||||
|
sql.Add(',Case when JHQty>0 then cast(1 as bit) else cast(0 as bit) end as YJH ');
|
||||||
|
SQL.Add('from(select A.*,XDQty=(select isnull(sum(isnull(OrdQty,0)),0) from YCL_SG_HZ where MainId=A.MainId )');
|
||||||
|
SQL.Add(',JHQty=(select isnull(sum(isnull(SJQty,0)),0) from YCL_SG_HZ where MainId=A.MainId )');
|
||||||
|
sql.Add('from YCL_SG A where A.SGDate>=:begdate and A.SGDate<:Enddate) AA');
|
||||||
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',begdate.DateTime));
|
||||||
|
Parameters.ParamByName('Enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',Enddate.DateTime+1));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
procedure TfrmSGManage.InitGridHZ();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryTemp.DisableControls;
|
||||||
|
with ADOQueryTemp do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
SQL.Add('select * from YCL_SG_HZ where MainId='''+Trim(CDS_Main.fieldbyname('MainId').AsString)+'''');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryTemp,CDS_HZ);
|
||||||
|
SInitCDSData20(ADOQueryTemp,CDS_HZ);
|
||||||
|
finally
|
||||||
|
ADOQueryTemp.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmSGManage:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid('申购列表',Tv1,'申购管理');
|
||||||
|
WriteCxGrid('申购回执',Tv2,'申购管理');
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmSGManage.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
if CDS_HZ.IsEmpty=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('已有回执数据,不能删除数据!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_Main.fieldbyname('MainID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete YCL_SG where MainID='''+Trim(CDS_Main.fieldbyname('MainID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_Main.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxGrid('申购列表',Tv1,'申购管理');
|
||||||
|
ReadCxGrid('申购回执',Tv2,'申购管理');
|
||||||
|
Enddate.DateTime:=SGetServerDate(ADOQueryTemp);
|
||||||
|
begdate.DateTime:=Enddate.DateTime-7;
|
||||||
|
InitGrid();
|
||||||
|
if Trim(DParameters1)='申购' then
|
||||||
|
begin
|
||||||
|
Button1.Visible:=False;
|
||||||
|
Button2.Visible:=False;
|
||||||
|
Tv2.OptionsSelection.CellSelect:=False;
|
||||||
|
end;
|
||||||
|
if Trim(DParameters1)='回执' then
|
||||||
|
begin
|
||||||
|
TBAdd.Visible:=False;
|
||||||
|
TBDel.Visible:=False;
|
||||||
|
TBEdit.Visible:=False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.TBAddClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmSGInput:=TfrmSGInput.Create(Application);
|
||||||
|
with frmSGInput do
|
||||||
|
begin
|
||||||
|
FMainId:='';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmSGInput.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.TBEditClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_HZ.IsEmpty=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('已有回执数据,不能修改数据!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
try
|
||||||
|
frmSGInput:=TfrmSGInput.Create(Application);
|
||||||
|
with frmSGInput do
|
||||||
|
begin
|
||||||
|
FMainId:=Trim(Self.CDS_Main.fieldbyname('MainID').AsString);
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.InitGrid();
|
||||||
|
Self.CDS_Main.Locate('MainID',FMainId,[]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmSGInput.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.YCLNameChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ToolButton2.Click;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
TcxGridToExcel('样品档案',cxGrid1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.ToolButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
fPrintFile:string;
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\样品标签.rmf' ;
|
||||||
|
if FileExists(fPrintFile) then
|
||||||
|
begin
|
||||||
|
RM1.LoadFromFile(fPrintFile);
|
||||||
|
RM1.ShowReport;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TfrmSGManage.Tv1FocusedRecordChanged(
|
||||||
|
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||||
|
AFocusedRecord: TcxCustomGridRecord;
|
||||||
|
ANewItemRecordFocusingChanged: Boolean);
|
||||||
|
begin
|
||||||
|
InitGridHZ();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_Main.IsEmpty then Exit;
|
||||||
|
CDS_HZ.Append;
|
||||||
|
CDS_HZ.FieldByName('JBDate').Value:=SGetServerDate(ADOQueryTemp);
|
||||||
|
CDS_HZ.FieldByName('CGPerson').Value:=Trim(DName);
|
||||||
|
CDS_HZ.FieldByName('YCLName').Value:=Trim(CDS_Main.fieldbyname('YCLName').AsString);
|
||||||
|
CDS_HZ.FieldByName('YCLCode').Value:=Trim(CDS_Main.fieldbyname('YCLCode').AsString);
|
||||||
|
CDS_HZ.FieldByName('SGUnit').Value:=Trim(CDS_Main.fieldbyname('SGUnit').AsString);
|
||||||
|
CDS_HZ.FieldByName('YCLSpec').Value:=Trim(CDS_Main.fieldbyname('YCLSpec').AsString);
|
||||||
|
CDS_HZ.FieldByName('YCLTypeCode').Value:=Trim(CDS_Main.fieldbyname('YCLTypeCode').AsString);
|
||||||
|
CDS_HZ.Post;
|
||||||
|
|
||||||
|
SaveData();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.Button2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_HZ.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_HZ.fieldbyname('SubID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete YCL_SG_HZ where SubID='''+Trim(CDS_HZ.fieldbyname('SubID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_HZ.Delete;
|
||||||
|
if CDS_HZ.IsEmpty then
|
||||||
|
begin
|
||||||
|
with CDS_Main do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('YXD').Value:=false;
|
||||||
|
FieldByName('YJH').Value:=false;
|
||||||
|
FieldByName('XDQty').Value:=0;
|
||||||
|
FieldByName('JHQty').Value:=0;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
with CDS_Main do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('XDQty').Value:=Tv2.DataController.Summary.FooterSummaryValues[0];
|
||||||
|
FieldByName('JHQty').Value:=Tv2.DataController.Summary.FooterSummaryValues[1];
|
||||||
|
if Tv2.DataController.Summary.FooterSummaryValues[1]>0 then
|
||||||
|
begin
|
||||||
|
FieldByName('YJH').Value:=True;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('YJH').Value:=False;
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.cxGridDBColumn2PropertiesButtonClick(
|
||||||
|
Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||||
|
with frmZDYHelp do
|
||||||
|
begin
|
||||||
|
flag:='GYS';
|
||||||
|
flagname:='供应商名称';
|
||||||
|
if ShowModal=1 then
|
||||||
|
begin
|
||||||
|
Self.CDS_HZ.Edit;
|
||||||
|
Self.CDS_HZ.FieldByName('GYSCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||||
|
Self.CDS_HZ.FieldByName('GYS').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('UPdate YCL_SG_HZ ');
|
||||||
|
sql.Add(' Set GYS='''+Trim(ClientDataSet1.fieldbyname('ZDYName').AsString)+'''');
|
||||||
|
sql.Add(' ,GYSCode='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||||
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
||||||
|
SQL.Add(',Edittime=getdate() ');
|
||||||
|
SQL.Add(' where SubId='''+Trim(CDS_HZ.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
frmZDYHelp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
function TfrmSGManage.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
maxId:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
if GetLSNo(ADOQueryCmd,maxId,'HZ','YCL_SG_HZ',4,1)=False then
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from YCL_SG_HZ where 1<>1');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('MainId').Value:=Trim(CDS_Main.fieldbyname('MainId').AsString);
|
||||||
|
FieldByName('SubId').Value:=Trim(maxId);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv2,CDS_HZ,'YCL_SG_HZ',3);
|
||||||
|
FieldByName('Filler').Value:=Trim(DName);
|
||||||
|
FieldByName('YCLTypeCode').Value:=Trim(CDS_HZ.fieldbyname('YCLTypeCode').AsString);
|
||||||
|
FieldByName('YCLCode').Value:=Trim(CDS_HZ.fieldbyname('YCLCode').AsString);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('SubId').Value:=Trim(maxId);
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
Result:=True;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('增行失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.cxGridDBColumn8PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FFieldName:String;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
FFieldName:=Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('UPdate YCL_SG_HZ ');
|
||||||
|
if Trim(mvalue)<>'' then
|
||||||
|
begin
|
||||||
|
sql.Add(' Set '+FFieldName+'='''+Trim(mvalue)+'''');
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
sql.Add(' Set '+FFieldName+'=NULL');
|
||||||
|
end;
|
||||||
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
||||||
|
SQL.Add(',Edittime=getdate() ');
|
||||||
|
SQL.Add(' where SubId='''+Trim(CDS_HZ.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSGManage.cxGridDBColumn5PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FFieldName:String;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
if Trim(mvalue)='' then
|
||||||
|
begin
|
||||||
|
mvalue:='0';
|
||||||
|
end;
|
||||||
|
FFieldName:=Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('UPdate YCL_SG_HZ ');
|
||||||
|
sql.Add(' Set '+FFieldName+'='+Trim(mvalue));
|
||||||
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
||||||
|
SQL.Add(',Edittime=getdate() ');
|
||||||
|
SQL.Add(' where SubId='''+Trim(CDS_HZ.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
with CDS_Main do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('XDQty').Value:=Tv2.DataController.Summary.FooterSummaryValues[0];
|
||||||
|
FieldByName('JHQty').Value:=Tv2.DataController.Summary.FooterSummaryValues[1];
|
||||||
|
if Tv2.DataController.Summary.FooterSummaryValues[1]>0 then
|
||||||
|
begin
|
||||||
|
FieldByName('YJH').Value:=True;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('YJH').Value:=False;
|
||||||
|
end;
|
||||||
|
if Tv2.DataController.Summary.FooterSummaryValues[0]>0 then
|
||||||
|
begin
|
||||||
|
FieldByName('YXD').Value:=True;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('YXD').Value:=False;
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
35
样品/U_SLT.dfm
Normal file
35
样品/U_SLT.dfm
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
object frmSLT: TfrmSLT
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 161
|
||||||
|
Height = 138
|
||||||
|
TabOrder = 0
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 121
|
||||||
|
Width = 161
|
||||||
|
Height = 17
|
||||||
|
Align = alClient
|
||||||
|
BevelOuter = bvNone
|
||||||
|
Caption = 'Panel1'
|
||||||
|
Color = clWindow
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clBlue
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object cxImage1: TcxImage
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Align = alTop
|
||||||
|
Style.BorderStyle = ebsOffice11
|
||||||
|
StyleHot.TextStyle = []
|
||||||
|
TabOrder = 1
|
||||||
|
OnDblClick = cxImage1DblClick
|
||||||
|
Height = 121
|
||||||
|
Width = 161
|
||||||
|
end
|
||||||
|
end
|
74
样品/U_SLT.pas
Normal file
74
样品/U_SLT.pas
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
unit U_SLT;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ExtCtrls,jpeg, cxControls, cxContainer, cxEdit, cxImage,IdFTP,ShellAPI,
|
||||||
|
cxGraphics, cxLookAndFeels, cxLookAndFeelPainters;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmSLT = class(TFrame)
|
||||||
|
cxImage1: TcxImage;
|
||||||
|
Panel1: TPanel;
|
||||||
|
procedure cxImage1DblClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
CYID,FileName:string;
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
procedure Init(fCYID:string;fFileName:string;fPicture:TJpegImage);
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink;
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
procedure TfrmSLT.Init(fCYID:string;fFileName:string;fPicture:TJpegImage);
|
||||||
|
begin
|
||||||
|
CYID:=trim(fCYID);
|
||||||
|
FileName:=trim(fFileName);
|
||||||
|
Panel1.Caption:=FileName;
|
||||||
|
cxImage1.Picture.Assign(fPicture);
|
||||||
|
end;
|
||||||
|
procedure TfrmSLT.cxImage1DblClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
IdFTP1: TIdFTP;
|
||||||
|
FPath,FFName:string;
|
||||||
|
FInt:integer;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
IdFTP1:=TIdFTP.Create(self);
|
||||||
|
IdFTP1.Host :=PicSvr;
|
||||||
|
IdFTP1.Username := 'three';
|
||||||
|
IdFTP1.Password := '641010';
|
||||||
|
IdFTP1.Connect();
|
||||||
|
except
|
||||||
|
IdFTP1.Quit;
|
||||||
|
IdFTP1.Free;
|
||||||
|
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
FPath:='D:\Right1209\';
|
||||||
|
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||||
|
CreateDir(ExtractFileDir(FPath));
|
||||||
|
FFName:=Trim(FileName);
|
||||||
|
FFName:=FPath+FFName;
|
||||||
|
if FileExists(FFName) then
|
||||||
|
begin
|
||||||
|
FInt:=1;
|
||||||
|
end;
|
||||||
|
if FInt<>1 then
|
||||||
|
IdFTP1.Get(UserDataFlag+'YP\'+FileName,FFName);
|
||||||
|
if IdFTP1.Connected then
|
||||||
|
begin
|
||||||
|
IdFTP1.Quit;
|
||||||
|
IdFTP1.Free;
|
||||||
|
end;
|
||||||
|
ShellExecute(Handle, 'open',PChar(FFName),'', '', SW_SHOWNORMAL);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
294
样品/U_YPCR.dfm
Normal file
294
样品/U_YPCR.dfm
Normal file
|
@ -0,0 +1,294 @@
|
||||||
|
object frmYPCR: TfrmYPCR
|
||||||
|
Left = 188
|
||||||
|
Top = 79
|
||||||
|
Width = 1038
|
||||||
|
Height = 618
|
||||||
|
Caption = #20837#24211#31649#29702
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
OnClose = FormClose
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 1030
|
||||||
|
Height = 31
|
||||||
|
ButtonHeight = 30
|
||||||
|
ButtonWidth = 59
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Color = clSkyBlue
|
||||||
|
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||||
|
Flat = True
|
||||||
|
Images = DataLink_YPGL.ThreeImgList
|
||||||
|
List = True
|
||||||
|
ParentColor = False
|
||||||
|
ShowCaptions = True
|
||||||
|
TabOrder = 0
|
||||||
|
object TBRafresh: TToolButton
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21047#26032
|
||||||
|
ImageIndex = 9
|
||||||
|
OnClick = TBRafreshClick
|
||||||
|
end
|
||||||
|
object ToolButton2: TToolButton
|
||||||
|
Left = 63
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #36807#28388
|
||||||
|
ImageIndex = 59
|
||||||
|
OnClick = ToolButton2Click
|
||||||
|
end
|
||||||
|
object TBDel: TToolButton
|
||||||
|
Left = 126
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #21024#38500
|
||||||
|
ImageIndex = 17
|
||||||
|
OnClick = TBDelClick
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 189
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #23548#20986
|
||||||
|
ImageIndex = 53
|
||||||
|
Visible = False
|
||||||
|
end
|
||||||
|
object TBClose: TToolButton
|
||||||
|
Left = 252
|
||||||
|
Top = 0
|
||||||
|
AutoSize = True
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 55
|
||||||
|
OnClick = TBCloseClick
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Top = 31
|
||||||
|
Width = 1030
|
||||||
|
Height = 39
|
||||||
|
Align = alTop
|
||||||
|
BevelInner = bvRaised
|
||||||
|
BevelOuter = bvLowered
|
||||||
|
Color = clSkyBlue
|
||||||
|
TabOrder = 1
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 466
|
||||||
|
Top = 13
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #35268' '#26684
|
||||||
|
end
|
||||||
|
object Label3: TLabel
|
||||||
|
Left = 302
|
||||||
|
Top = 13
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
end
|
||||||
|
object Label2: TLabel
|
||||||
|
Left = 22
|
||||||
|
Top = 13
|
||||||
|
Width = 48
|
||||||
|
Height = 12
|
||||||
|
Caption = #26597#35810#26085#26399
|
||||||
|
end
|
||||||
|
object Label6: TLabel
|
||||||
|
Left = 164
|
||||||
|
Top = 13
|
||||||
|
Width = 30
|
||||||
|
Height = 12
|
||||||
|
Caption = '-----'
|
||||||
|
end
|
||||||
|
object CYSpec: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 515
|
||||||
|
Top = 9
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 0
|
||||||
|
OnChange = CYNameChange
|
||||||
|
end
|
||||||
|
object CYName: TEdit
|
||||||
|
Tag = 2
|
||||||
|
Left = 350
|
||||||
|
Top = 9
|
||||||
|
Width = 89
|
||||||
|
Height = 20
|
||||||
|
TabOrder = 1
|
||||||
|
OnChange = CYNameChange
|
||||||
|
end
|
||||||
|
object begdate: TDateTimePicker
|
||||||
|
Left = 72
|
||||||
|
Top = 9
|
||||||
|
Width = 97
|
||||||
|
Height = 20
|
||||||
|
Date = 41256.918237847230000000
|
||||||
|
Time = 41256.918237847230000000
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object Enddate: TDateTimePicker
|
||||||
|
Left = 182
|
||||||
|
Top = 9
|
||||||
|
Width = 97
|
||||||
|
Height = 20
|
||||||
|
Date = 41256.918237847230000000
|
||||||
|
Time = 41256.918237847230000000
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGrid2: TcxGrid
|
||||||
|
Left = 0
|
||||||
|
Top = 70
|
||||||
|
Width = 1030
|
||||||
|
Height = 511
|
||||||
|
Align = alClient
|
||||||
|
TabOrder = 2
|
||||||
|
object Tv2: TcxGridDBTableView
|
||||||
|
NavigatorButtons.ConfirmDelete = False
|
||||||
|
NavigatorButtons.Delete.Enabled = False
|
||||||
|
NavigatorButtons.Delete.Visible = False
|
||||||
|
DataController.DataSource = DS_HZ
|
||||||
|
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||||
|
DataController.Summary.FooterSummaryItems = <
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
Column = cxGridDBColumn5
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Kind = skSum
|
||||||
|
end>
|
||||||
|
DataController.Summary.SummaryGroups = <>
|
||||||
|
OptionsCustomize.ColumnFiltering = False
|
||||||
|
OptionsData.Deleting = False
|
||||||
|
OptionsData.DeletingConfirmation = False
|
||||||
|
OptionsView.Footer = True
|
||||||
|
OptionsView.GroupByBox = False
|
||||||
|
object cxGridDBColumn1: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20837#24211#26085#26399
|
||||||
|
DataBinding.FieldName = 'CRTime'
|
||||||
|
PropertiesClassName = 'TcxDateEditProperties'
|
||||||
|
Properties.SaveTime = False
|
||||||
|
Properties.ShowTime = False
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn1PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 129
|
||||||
|
end
|
||||||
|
object cxGridDBColumn3: TcxGridDBColumn
|
||||||
|
Caption = #20013#25991#21517#31216
|
||||||
|
DataBinding.FieldName = 'CYName'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 140
|
||||||
|
end
|
||||||
|
object cxGridDBColumn4: TcxGridDBColumn
|
||||||
|
Caption = #35268#26684
|
||||||
|
DataBinding.FieldName = 'CYSpec'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 110
|
||||||
|
end
|
||||||
|
object cxGridDBColumn5: TcxGridDBColumn
|
||||||
|
Tag = 3
|
||||||
|
Caption = #20837#24211#25968#37327
|
||||||
|
DataBinding.FieldName = 'CRQty'
|
||||||
|
PropertiesClassName = 'TcxTextEditProperties'
|
||||||
|
Properties.OnEditValueChanged = cxGridDBColumn5PropertiesEditValueChanged
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 117
|
||||||
|
end
|
||||||
|
object cxGridDBColumn6: TcxGridDBColumn
|
||||||
|
Caption = #21333#20301
|
||||||
|
DataBinding.FieldName = 'KCUnit'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Options.Editing = False
|
||||||
|
Options.Focusing = False
|
||||||
|
Styles.Header = DataLink_YPGL.Default
|
||||||
|
Width = 105
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object cxGridLevel1: TcxGridLevel
|
||||||
|
GridView = Tv2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ADOQueryTemp: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 789
|
||||||
|
Top = 9
|
||||||
|
end
|
||||||
|
object ADOQueryCmd: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 829
|
||||||
|
Top = 1
|
||||||
|
end
|
||||||
|
object ADOQueryMain: TADOQuery
|
||||||
|
Connection = DataLink_YPGL.ADOLink
|
||||||
|
LockType = ltReadOnly
|
||||||
|
Parameters = <>
|
||||||
|
Left = 309
|
||||||
|
Top = 193
|
||||||
|
end
|
||||||
|
object RM1: TRMGridReport
|
||||||
|
ThreadPrepareReport = True
|
||||||
|
InitialZoom = pzDefault
|
||||||
|
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||||
|
DefaultCollate = False
|
||||||
|
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||||
|
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||||
|
PreviewOptions.RulerVisible = False
|
||||||
|
PreviewOptions.DrawBorder = False
|
||||||
|
PreviewOptions.BorderPen.Color = clGray
|
||||||
|
PreviewOptions.BorderPen.Style = psDash
|
||||||
|
Dataset = RMDB_Main
|
||||||
|
CompressLevel = rmzcFastest
|
||||||
|
CompressThread = False
|
||||||
|
LaterBuildEvents = True
|
||||||
|
OnlyOwnerDataSet = False
|
||||||
|
Left = 448
|
||||||
|
Top = 208
|
||||||
|
ReportData = {}
|
||||||
|
end
|
||||||
|
object RMDB_Main: TRMDBDataSet
|
||||||
|
Visible = True
|
||||||
|
Left = 376
|
||||||
|
Top = 208
|
||||||
|
end
|
||||||
|
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||||
|
Grid = cxGrid2
|
||||||
|
PopupMenus = <>
|
||||||
|
Left = 472
|
||||||
|
Top = 248
|
||||||
|
end
|
||||||
|
object DS_HZ: TDataSource
|
||||||
|
DataSet = CDS_HZ
|
||||||
|
Left = 443
|
||||||
|
Top = 243
|
||||||
|
end
|
||||||
|
object CDS_HZ: TClientDataSet
|
||||||
|
Aggregates = <>
|
||||||
|
Params = <>
|
||||||
|
Left = 472
|
||||||
|
Top = 192
|
||||||
|
end
|
||||||
|
end
|
346
样品/U_YPCR.pas
Normal file
346
样品/U_YPCR.pas
Normal file
|
@ -0,0 +1,346 @@
|
||||||
|
unit U_YPCR;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||||
|
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||||||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||||||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||||||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||||||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||||
|
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox, cxCalendar,
|
||||||
|
cxButtonEdit, cxTextEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmYPCR = class(TForm)
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
TBRafresh: TToolButton;
|
||||||
|
TBDel: TToolButton;
|
||||||
|
TBClose: TToolButton;
|
||||||
|
ADOQueryTemp: TADOQuery;
|
||||||
|
ADOQueryCmd: TADOQuery;
|
||||||
|
Panel1: TPanel;
|
||||||
|
ToolButton2: TToolButton;
|
||||||
|
Label1: TLabel;
|
||||||
|
CYSpec: TEdit;
|
||||||
|
ADOQueryMain: TADOQuery;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
RM1: TRMGridReport;
|
||||||
|
RMDB_Main: TRMDBDataSet;
|
||||||
|
Label3: TLabel;
|
||||||
|
CYName: TEdit;
|
||||||
|
cxGrid2: TcxGrid;
|
||||||
|
Tv2: TcxGridDBTableView;
|
||||||
|
cxGridDBColumn1: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn3: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn4: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn5: TcxGridDBColumn;
|
||||||
|
cxGridDBColumn6: TcxGridDBColumn;
|
||||||
|
cxGridLevel1: TcxGridLevel;
|
||||||
|
Label2: TLabel;
|
||||||
|
Label6: TLabel;
|
||||||
|
begdate: TDateTimePicker;
|
||||||
|
Enddate: TDateTimePicker;
|
||||||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||||
|
DS_HZ: TDataSource;
|
||||||
|
CDS_HZ: TClientDataSet;
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
procedure TBDelClick(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure TBRafreshClick(Sender: TObject);
|
||||||
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
|
procedure CYNameChange(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
procedure cxGridDBColumn1PropertiesEditValueChanged(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
|
||||||
|
procedure InitGridHZ();
|
||||||
|
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
RKFlag,FCYID:String;
|
||||||
|
procedure InitGrid();
|
||||||
|
function SaveData():Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmYPCR: TfrmYPCR;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses
|
||||||
|
U_DataLink,U_Fun;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TfrmYPCR.InitGrid();
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryMain.DisableControls;
|
||||||
|
with ADOQueryMain do
|
||||||
|
begin
|
||||||
|
Filtered:=False;
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add(' select A.*,B.CYName,B.CYSpec,B.KCUnit from CK_YP_CR A');
|
||||||
|
sql.Add(' inner join CP_YDang B on A.CYID=B.CYID');
|
||||||
|
SQL.Add(' where A.CYID='''+Trim(FCYID)+'''');
|
||||||
|
sql.Add(' and A.CRType='''+Trim(RKFlag)+'''');
|
||||||
|
sql.Add('and A.CRTime>=:begdate and A.CRTime<:Enddate');
|
||||||
|
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',begdate.DateTime));
|
||||||
|
Parameters.ParamByName('Enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',Enddate.DateTime+1));
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
||||||
|
finally
|
||||||
|
ADOQueryMain.EnableControls;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
procedure TfrmYPCR.InitGridHZ();
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmYPCR:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action:=caFree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.TBCloseClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
WriteCxGrid('样品入库',Tv2,'样品管理');
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CK_YP_CR where isnull(CRTime,'''')='''' and CYID='''+Trim(FCYID)+''' and CRType='''+Trim(RKFlag)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
procedure TfrmYPCR.TBDelClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_HZ.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_HZ.fieldbyname('CRID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete CK_YP_CR where CRID='''+Trim(CDS_HZ.fieldbyname('CRID').AsString)+'''');
|
||||||
|
SQL.Add('Update CP_YDang Set KCQty=(select isnull(Sum(CRQty*CRFlag),0) from CK_YP_CR A where A.CYID=CP_YDang.CYID )');
|
||||||
|
sql.Add(' where CYID='''+Trim(CDS_HZ.fieldbyname('CYID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_HZ.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ReadCxGrid('样品入库',Tv2,'样品管理');
|
||||||
|
Enddate.DateTime:=SGetServerDate(ADOQueryTemp);
|
||||||
|
begdate.DateTime:=Enddate.DateTime-7;
|
||||||
|
//InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.TBRafreshClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InitGrid();
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.ToolButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if ADOQueryMain.Active then
|
||||||
|
begin
|
||||||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||||
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
||||||
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.CYNameChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ToolButton2.Click;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.Button2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if CDS_HZ.IsEmpty then Exit;
|
||||||
|
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||||
|
if Trim(CDS_HZ.fieldbyname('SubID').AsString)<>'' then
|
||||||
|
begin
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('delete YCL_SG_HZ where SubID='''+Trim(CDS_HZ.fieldbyname('SubID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
CDS_HZ.Delete;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TfrmYPCR.SaveData():Boolean;
|
||||||
|
var
|
||||||
|
maxId:String;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
ADOQueryCmd.Connection.BeginTrans;
|
||||||
|
if GetLSNo(ADOQueryCmd,maxId,'RK','CK_YP_CR',4,1)=False then
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
SQL.Clear;
|
||||||
|
sql.Add('select * from CK_YP_CR where 1<>1');
|
||||||
|
Open;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
FieldByName('CYId').Value:=Trim(FCYID);
|
||||||
|
FieldByName('CRId').Value:=Trim(maxId);
|
||||||
|
SSetSaveDataCDSNew(ADOQueryCmd,Tv2,CDS_HZ,'CK_YP_CR',3);
|
||||||
|
FieldByName('Filler').Value:=Trim(DName);
|
||||||
|
FieldByName('CRType').Value:=Trim(RKFlag);
|
||||||
|
if Trim(RKFlag)='入库' then
|
||||||
|
begin
|
||||||
|
FieldByName('CRFlag').Value:=1;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
FieldByName('CRFlag').Value:=-1;
|
||||||
|
end;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName('CRId').Value:=Trim(maxId);
|
||||||
|
end;
|
||||||
|
ADOQueryCmd.Connection.CommitTrans;
|
||||||
|
Result:=True;
|
||||||
|
except
|
||||||
|
Result:=True;
|
||||||
|
ADOQueryCmd.Connection.RollbackTrans;
|
||||||
|
Application.MessageBox('增行失败!','提示',0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.cxGridDBColumn8PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FFieldName:String;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
FFieldName:=Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('UPdate YCL_SG_HZ ');
|
||||||
|
if Trim(mvalue)<>'' then
|
||||||
|
begin
|
||||||
|
sql.Add(' Set '+FFieldName+'='''+Trim(mvalue)+'''');
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
sql.Add(' Set '+FFieldName+'=NULL');
|
||||||
|
end;
|
||||||
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
||||||
|
SQL.Add(',Edittime=getdate() ');
|
||||||
|
SQL.Add(' where SubId='''+Trim(CDS_HZ.fieldbyname('SubId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.cxGridDBColumn5PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FFieldName:String;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
if Trim(mvalue)='' then
|
||||||
|
begin
|
||||||
|
mvalue:='0';
|
||||||
|
end;
|
||||||
|
FFieldName:=Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('UPdate CK_YP_CR ');
|
||||||
|
sql.Add(' Set '+FFieldName+'='+Trim(mvalue));
|
||||||
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
||||||
|
SQL.Add(',Edittime=getdate() ');
|
||||||
|
SQL.Add(' where CRId='''+Trim(CDS_HZ.fieldbyname('CRId').AsString)+'''');
|
||||||
|
SQL.Add('Update CP_YDang Set KCQty=(select isnull(Sum(CRQty*CRFlag),0) from CK_YP_CR A where A.CYID=CP_YDang.CYID )');
|
||||||
|
sql.Add(' where CYID='''+Trim(CDS_HZ.fieldbyname('CYID').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmYPCR.cxGridDBColumn1PropertiesEditValueChanged(
|
||||||
|
Sender: TObject);
|
||||||
|
var
|
||||||
|
mvalue,FFieldName:String;
|
||||||
|
begin
|
||||||
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||||
|
FFieldName:=Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||||
|
with CDS_HZ do
|
||||||
|
begin
|
||||||
|
Edit;
|
||||||
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
with ADOQueryCmd do
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('UPdate CK_YP_CR ');
|
||||||
|
if Trim(mvalue)<>'' then
|
||||||
|
begin
|
||||||
|
sql.Add(' Set '+FFieldName+'='''+Trim(mvalue)+'''');
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
sql.Add(' Set '+FFieldName+'=NULL');
|
||||||
|
end;
|
||||||
|
SQL.Add(',Editer='''+Trim(DName)+'''');
|
||||||
|
SQL.Add(',Edittime=getdate() ');
|
||||||
|
SQL.Add(' where CRId='''+Trim(CDS_HZ.fieldbyname('CRId').AsString)+'''');
|
||||||
|
ExecSQL;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
58
样品/U_iniParam.pas
Normal file
58
样品/U_iniParam.pas
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//配置个别机子参数
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
unit U_iniParam;
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses
|
||||||
|
IniFiles,SysUtils;
|
||||||
|
var
|
||||||
|
Filename:string; //文件名
|
||||||
|
iParam2:integer;
|
||||||
|
bParam1:Boolean;
|
||||||
|
bParam2:Boolean;
|
||||||
|
YPCodeType:string; //样品编号类型
|
||||||
|
Function IsINIFile():Boolean; //判断InI配置文件是否存在
|
||||||
|
procedure ReadINIFile();
|
||||||
|
procedure WriteINIFile();
|
||||||
|
implementation
|
||||||
|
///////////////////////////////////////////////////////////////////
|
||||||
|
//读取ini文件设置参数
|
||||||
|
//参数:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
procedure ReadINIFile();
|
||||||
|
var
|
||||||
|
programIni:Tinifile; //配置文件名
|
||||||
|
begin
|
||||||
|
FileName:=ExtractFilePath(Paramstr(0))+'YPFile.INI';
|
||||||
|
programIni:=Tinifile.create(FileName);
|
||||||
|
YPCodeType:=programIni.ReadString('样品编号','编号类型','');
|
||||||
|
|
||||||
|
programIni.Free;
|
||||||
|
end;
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
//写设置信息到INI文件
|
||||||
|
//参数
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
procedure WriteINIFile();
|
||||||
|
var
|
||||||
|
programIni:Tinifile; //配置文件名
|
||||||
|
begin
|
||||||
|
FileName:=ExtractFilePath(Paramstr(0))+'YPFile.INI';
|
||||||
|
programIni:=Tinifile.create(FileName);
|
||||||
|
programIni.WriteString('样品编号','编号类型',YPCodeType);
|
||||||
|
programIni.Free;
|
||||||
|
end;
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
//判断InI文件是否存在
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
Function IsINIFile():Boolean;
|
||||||
|
begin
|
||||||
|
FileName:=ExtractFilePath(Paramstr(0))+'YPFile.INI';
|
||||||
|
if FileExists(FileName) then
|
||||||
|
Result:=true
|
||||||
|
else
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
221
样品/U_testdll.dfm
Normal file
221
样品/U_testdll.dfm
Normal file
|
@ -0,0 +1,221 @@
|
||||||
|
object Form1: TForm1
|
||||||
|
Left = 97
|
||||||
|
Top = 122
|
||||||
|
Width = 791
|
||||||
|
Height = 554
|
||||||
|
Caption = 'Form1'
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Style = []
|
||||||
|
FormStyle = fsMDIForm
|
||||||
|
Menu = MainMenu1
|
||||||
|
OldCreateOrder = False
|
||||||
|
WindowState = wsMaximized
|
||||||
|
OnClose = FormClose
|
||||||
|
OnResize = FormResize
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 13
|
||||||
|
object ToolBar1: TToolBar
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 783
|
||||||
|
Height = 25
|
||||||
|
ButtonWidth = 57
|
||||||
|
Caption = 'ToolBar1'
|
||||||
|
Flat = True
|
||||||
|
Images = ImageList1
|
||||||
|
TabOrder = 0
|
||||||
|
object Edit1: TEdit
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 81
|
||||||
|
Height = 22
|
||||||
|
TabOrder = 0
|
||||||
|
Text = '1'
|
||||||
|
end
|
||||||
|
object ToolButton1: TToolButton
|
||||||
|
Left = 81
|
||||||
|
Top = 0
|
||||||
|
Caption = #20851#38381
|
||||||
|
ImageIndex = 0
|
||||||
|
OnClick = ToolButton1Click
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
Left = 138
|
||||||
|
Top = 0
|
||||||
|
Width = 79
|
||||||
|
Height = 22
|
||||||
|
Caption = ' DllName'#65306
|
||||||
|
end
|
||||||
|
object DllName: TEdit
|
||||||
|
Left = 217
|
||||||
|
Top = 0
|
||||||
|
Width = 135
|
||||||
|
Height = 22
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object MainMenu1: TMainMenu
|
||||||
|
Left = 232
|
||||||
|
Top = 40
|
||||||
|
object test1: TMenuItem
|
||||||
|
Caption = 'test'
|
||||||
|
OnClick = test1Click
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object ImageList1: TImageList
|
||||||
|
Left = 320
|
||||||
|
Top = 56
|
||||||
|
Bitmap = {
|
||||||
|
494C010101000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
|
||||||
|
0000000000003600000028000000400000001000000001002000000000000010
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000EFEFEF000000
|
||||||
|
0000EFEFEF00EFEFEF000000000000000000EFEFEF0000000000000000000000
|
||||||
|
0000EFEFEF00EFEFEF0000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000EFEFEF0000000000EFEFEF00EFEFEF0000000000EFEFEF00000000008080
|
||||||
|
00008080000000000000C0C0C000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
00000000000000000000000000000000000000000000EFEFEF00EFEFEF000000
|
||||||
|
0000EFEFEF00EFEFEF000000000000000000C0C0C00000000000000000008080
|
||||||
|
00008080000080800000EFEFEF00EFEFEF000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000EFEFEF0000000000000000000000000000000000000000008080
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000EFEFEF0000000000808080008080800080808000000000008080
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000008080000000000000808080008080800080808000000000008080
|
||||||
|
0000000000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000EFEFEF00EFEF
|
||||||
|
EF0000000000FFFF000080800000000000008080800080808000000000000000
|
||||||
|
0000000000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000FFFF0000FFFF0000808000000000000080808000000000008080
|
||||||
|
0000000000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000808000008080
|
||||||
|
000080800000FFFF0000FFFF0000FFFF00000000000080808000000000008080
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000FFFF0000FFFF
|
||||||
|
0000FFFF0000FFFF000000000000FFFF00000000000080808000000000008080
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000FFFF0000FFFF0000FFFF00000000000080808000000000008080
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000808000000000000080808000808080008080800080808000FFFF
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000808080008080800080808000808080000000
|
||||||
|
0000808000008080000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000000000000000000000000000424D3E000000000000003E000000
|
||||||
|
2800000040000000100000000100010000000000800000000000000000000000
|
||||||
|
000000000000000000000000FFFFFF00FFFF000000000000D343000000000000
|
||||||
|
F4810000000000009340000000000000F801000000000000F001000000000000
|
||||||
|
F001000000000000C001000000000000C001000000000000C001000000000000
|
||||||
|
C201000000000000C001000000000000F001000000000000F001000000000000
|
||||||
|
FC03000000000000FFFF00000000000000000000000000000000000000000000
|
||||||
|
000000000000}
|
||||||
|
end
|
||||||
|
object ADOConnection1: TADOConnection
|
||||||
|
ConnectionString =
|
||||||
|
'Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ' +
|
||||||
|
'ID=sa;Initial Catalog=rzdata;Data Source=6GMFFMYKYMJDZW7'
|
||||||
|
LoginPrompt = False
|
||||||
|
Provider = 'SQLOLEDB.1'
|
||||||
|
Left = 408
|
||||||
|
Top = 64
|
||||||
|
end
|
||||||
|
end
|
106
样品/U_testdll.pas
Normal file
106
样品/U_testdll.pas
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
unit U_testdll;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ExtCtrls, StdCtrls, Menus, ToolWin, ComCtrls, ImgList, DB, ADODB;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
MainMenu1: TMainMenu;
|
||||||
|
test1: TMenuItem;
|
||||||
|
ToolBar1: TToolBar;
|
||||||
|
Edit1: TEdit;
|
||||||
|
ToolButton1: TToolButton;
|
||||||
|
ImageList1: TImageList;
|
||||||
|
ADOConnection1: TADOConnection;
|
||||||
|
DllName: TEdit;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure test1Click(Sender: TObject);
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure FormResize(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
newh:hwnd;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
sendmessage(newh,1034,4,0);
|
||||||
|
action:=cafree;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.test1Click(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;
|
||||||
|
var
|
||||||
|
Tf: TMyFunc;
|
||||||
|
Tp: TFarProc;
|
||||||
|
Th:Thandle;
|
||||||
|
begin
|
||||||
|
//静态加载
|
||||||
|
//newh:=getForm(Application,1,ADOConnection1,PChar('sa'),PChar('dsa'));
|
||||||
|
|
||||||
|
//动态加载
|
||||||
|
// showMessage(intTostr(application.Handle));
|
||||||
|
Th := LoadLibrary('YPGL.dll');
|
||||||
|
if Th > 0 then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Tp := GetProcAddress(Th, 'GetDllForm');
|
||||||
|
if Tp <> nil then
|
||||||
|
begin
|
||||||
|
Tf := TMyFunc(Tp);
|
||||||
|
newh:=Tf(Application,0,strToint(edit1.text),0,0,
|
||||||
|
PChar('sa'),
|
||||||
|
PChar('dsa'),
|
||||||
|
PChar('bsa'),
|
||||||
|
PChar('tsa'),
|
||||||
|
PChar('d1sa'),
|
||||||
|
PChar('d2sa'),
|
||||||
|
'','','','','','','','',''
|
||||||
|
);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
ShowMessage('打印执行错误');
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
// FreeLibrary();
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
ShowMessage('找不到'+Trim(DllName.Text));
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.ToolButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormResize(Sender: TObject);
|
||||||
|
begin
|
||||||
|
sendmessage(newh,1034,1,0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
2
样品/YPFile.INI
Normal file
2
样品/YPFile.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[样品编号]
|
||||||
|
编号类型=大类
|
42
样品/YPGL.cfg
Normal file
42
样品/YPGL.cfg
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
-$A8
|
||||||
|
-$B-
|
||||||
|
-$C+
|
||||||
|
-$D+
|
||||||
|
-$E-
|
||||||
|
-$F-
|
||||||
|
-$G+
|
||||||
|
-$H+
|
||||||
|
-$I+
|
||||||
|
-$J-
|
||||||
|
-$K-
|
||||||
|
-$L+
|
||||||
|
-$M-
|
||||||
|
-$N+
|
||||||
|
-$O+
|
||||||
|
-$P+
|
||||||
|
-$Q-
|
||||||
|
-$R-
|
||||||
|
-$S-
|
||||||
|
-$T-
|
||||||
|
-$U-
|
||||||
|
-$V+
|
||||||
|
-$W-
|
||||||
|
-$X+
|
||||||
|
-$YD
|
||||||
|
-$Z1
|
||||||
|
-cg
|
||||||
|
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
-H+
|
||||||
|
-W+
|
||||||
|
-M
|
||||||
|
-$M16384,1048576
|
||||||
|
-K$00400000
|
||||||
|
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
|
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
|
-U"D:\말繫ERP"
|
||||||
|
-O"D:\말繫ERP"
|
||||||
|
-I"D:\말繫ERP"
|
||||||
|
-R"D:\말繫ERP"
|
||||||
|
-w-UNSAFE_TYPE
|
||||||
|
-w-UNSAFE_CODE
|
||||||
|
-w-UNSAFE_CAST
|
138
样品/YPGL.dof
Normal file
138
样品/YPGL.dof
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=D:\말繫ERP
|
||||||
|
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;dclOffice2k;Rave50CLX;Rave50VCL
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=D:\其속螺淃커덜쯤\淃커덜쯤\쁨룟\湳틔\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
||||||
|
[Excluded Packages]
|
||||||
|
c:\program files\borland\delphi7\Bin\DBWEBXPRT.BPL=Borland Web Wizard Package
|
54
样品/YPGL.dpr
Normal file
54
样品/YPGL.dpr
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
library YPGL;
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils,
|
||||||
|
classes,
|
||||||
|
forms,
|
||||||
|
WinTypes,
|
||||||
|
WinProcs,
|
||||||
|
U_DataLink in 'U_DataLink.pas' {DataLink_YPGL: TDataModule},
|
||||||
|
U_GetDllForm in 'U_GetDllForm.pas',
|
||||||
|
U_iniParam in 'U_iniParam.pas',
|
||||||
|
U_KHGetCPManage in 'U_KHGetCPManage.pas' {frmKHGetCPManage},
|
||||||
|
U_KHGetCPAdd in 'U_KHGetCPAdd.pas' {frmKHGetCPAdd},
|
||||||
|
U_CPType in 'U_CPType.pas' {frmCPType},
|
||||||
|
U_FileUp in 'U_FileUp.pas' {frmFileUp},
|
||||||
|
U_KHGetY in 'U_KHGetY.pas' {frmKHGetY},
|
||||||
|
U_CPManageSel in 'U_CPManageSel.pas' {frmCPManageSel},
|
||||||
|
U_CPAdd in 'U_CPAdd.pas' {frmCPAdd},
|
||||||
|
U_SelExportField in '..\..\..\ThreeFun\Fun\U_SelExportField.pas' {frmSelExportField},
|
||||||
|
U_ColumnSet in '..\..\..\ThreeFun\Form\U_ColumnSet.pas' {frmColumnSet},
|
||||||
|
U_ColumnBandSet in '..\..\..\ThreeFun\Form\U_ColumnBandSet.pas' {frmColumnBandSet},
|
||||||
|
U_SelPrintFieldNew in '..\..\..\ThreeFun\Form\U_SelPrintFieldNew.pas' {frmSelPrintFieldNew},
|
||||||
|
U_YPCR in 'U_YPCR.pas' {frmYPCR},
|
||||||
|
U_CPManage in 'U_CPManage.pas' {frmCPManage},
|
||||||
|
U_ZDYHelp in '..\..\..\ThreeFun\Form\U_ZDYHelp.pas' {frmZDYHelp},
|
||||||
|
U_Fun in '..\..\..\ThreeFun\Fun\U_Fun.pas',
|
||||||
|
U_SLT in 'U_SLT.pas' {frmSLT: TFrame},
|
||||||
|
U_Fun10 in '..\..\..\ThreeFun\Fun\U_Fun10.pas',
|
||||||
|
U_YPTypeHelp in '..\..\..\ThreeFun\Form\U_YPTypeHelp.pas' {frmYPTypeHelp};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
procedure DllEnterPoint(dwReason: DWORD);far;stdcall;
|
||||||
|
begin
|
||||||
|
DLLProc := @DLLEnterPoint;
|
||||||
|
DllEnterPoint(DLL_PROCESS_ATTACH);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DLLUnloadProc(Reason: Integer); register;
|
||||||
|
begin
|
||||||
|
{ if (Reason = DLL_PROCESS_DETACH) or (Reason=DLL_THREAD_DETACH) then
|
||||||
|
Application:=NewDllApp; }
|
||||||
|
end;
|
||||||
|
exports
|
||||||
|
GetDllForm;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
NewDllApp:=Application;
|
||||||
|
DLLProc := @DLLUnloadProc;
|
||||||
|
except
|
||||||
|
|
||||||
|
end;
|
||||||
|
end.
|
||||||
|
|
BIN
样品/YPGL.rar
Normal file
BIN
样品/YPGL.rar
Normal file
Binary file not shown.
BIN
样品/YPGL.res
Normal file
BIN
样品/YPGL.res
Normal file
Binary file not shown.
2
样品/consvr.ini
Normal file
2
样品/consvr.ini
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[SERVER]
|
||||||
|
SERVER=192.168.88.254
|
38
样品/testDll.cfg
Normal file
38
样品/testDll.cfg
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
-$A8
|
||||||
|
-$B-
|
||||||
|
-$C+
|
||||||
|
-$D+
|
||||||
|
-$E-
|
||||||
|
-$F-
|
||||||
|
-$G+
|
||||||
|
-$H+
|
||||||
|
-$I+
|
||||||
|
-$J-
|
||||||
|
-$K-
|
||||||
|
-$L+
|
||||||
|
-$M-
|
||||||
|
-$N+
|
||||||
|
-$O+
|
||||||
|
-$P+
|
||||||
|
-$Q-
|
||||||
|
-$R-
|
||||||
|
-$S-
|
||||||
|
-$T-
|
||||||
|
-$U-
|
||||||
|
-$V+
|
||||||
|
-$W-
|
||||||
|
-$X+
|
||||||
|
-$YD
|
||||||
|
-$Z1
|
||||||
|
-cg
|
||||||
|
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
-H+
|
||||||
|
-W+
|
||||||
|
-M
|
||||||
|
-$M16384,1048576
|
||||||
|
-K$00400000
|
||||||
|
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-w-UNSAFE_TYPE
|
||||||
|
-w-UNSAFE_CODE
|
||||||
|
-w-UNSAFE_CAST
|
136
样品/testDll.dof
Normal file
136
样品/testDll.dof
Normal file
|
@ -0,0 +1,136 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=
|
||||||
|
Packages=
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=F:\selfware_83398\selfware\马国钢开发代码\项目代码\self\样品\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
14
样品/testDll.dpr
Normal file
14
样品/testDll.dpr
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
program testDll;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
U_testdll in 'U_testdll.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
BIN
样品/testDll.res
Normal file
BIN
样品/testDll.res
Normal file
Binary file not shown.
317
检验管理/AES.pas
Normal file
317
检验管理/AES.pas
Normal file
|
@ -0,0 +1,317 @@
|
||||||
|
(**************************************************)
|
||||||
|
|
||||||
|
unit AES;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Classes, Math, ElAES;
|
||||||
|
|
||||||
|
type
|
||||||
|
TKeyBit = (kb128, kb192, kb256);
|
||||||
|
|
||||||
|
function StrToHex(Value: string): string;
|
||||||
|
function HexToStr(Value: string): string;
|
||||||
|
function EncryptString(Value: string; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): string;
|
||||||
|
function DecryptString(Value: string; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): string;
|
||||||
|
function EncryptStream(Stream: TStream; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): TStream;
|
||||||
|
function DecryptStream(Stream: TStream; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): TStream;
|
||||||
|
procedure EncryptFile(SourceFile, DestFile: string;
|
||||||
|
Key: string; KeyBit: TKeyBit = kb128);
|
||||||
|
procedure DecryptFile(SourceFile, DestFile: string;
|
||||||
|
Key: string; KeyBit: TKeyBit = kb128);
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function StrToHex(Value: string): string;
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
for I := 1 to Length(Value) do
|
||||||
|
Result := Result + IntToHex(Ord(Value[I]), 2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function HexToStr(Value: string): string;
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
for I := 1 to Length(Value) do
|
||||||
|
begin
|
||||||
|
if ((I mod 2) = 1) then
|
||||||
|
Result := Result + Chr(StrToInt('0x'+ Copy(Value, I, 2)));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ -- 字符串加密函数 默认按照 128 位密匙加密 -- }
|
||||||
|
function EncryptString(Value: string; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): string;
|
||||||
|
var
|
||||||
|
SS, DS: TStringStream;
|
||||||
|
Size: Int64;
|
||||||
|
AESKey128: TAESKey128;
|
||||||
|
AESKey192: TAESKey192;
|
||||||
|
AESKey256: TAESKey256;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
SS := TStringStream.Create(Value);
|
||||||
|
DS := TStringStream.Create('');
|
||||||
|
try
|
||||||
|
Size := SS.Size;
|
||||||
|
DS.WriteBuffer(Size, SizeOf(Size));
|
||||||
|
{ -- 128 位密匙最大长度为 16 个字符 -- }
|
||||||
|
if KeyBit = kb128 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey128, SizeOf(AESKey128), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey128, Min(SizeOf(AESKey128), Length(Key)));
|
||||||
|
EncryptAESStreamECB(SS, 0, AESKey128, DS);
|
||||||
|
end;
|
||||||
|
{ -- 192 位密匙最大长度为 24 个字符 -- }
|
||||||
|
if KeyBit = kb192 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey192, SizeOf(AESKey192), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey192, Min(SizeOf(AESKey192), Length(Key)));
|
||||||
|
EncryptAESStreamECB(SS, 0, AESKey192, DS);
|
||||||
|
end;
|
||||||
|
{ -- 256 位密匙最大长度为 32 个字符 -- }
|
||||||
|
if KeyBit = kb256 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey256, SizeOf(AESKey256), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey256, Min(SizeOf(AESKey256), Length(Key)));
|
||||||
|
EncryptAESStreamECB(SS, 0, AESKey256, DS);
|
||||||
|
end;
|
||||||
|
Result := StrToHex(DS.DataString);
|
||||||
|
finally
|
||||||
|
SS.Free;
|
||||||
|
DS.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ -- 字符串解密函数 默认按照 128 位密匙解密 -- }
|
||||||
|
function DecryptString(Value: string; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): string;
|
||||||
|
var
|
||||||
|
SS, DS: TStringStream;
|
||||||
|
Size: Int64;
|
||||||
|
AESKey128: TAESKey128;
|
||||||
|
AESKey192: TAESKey192;
|
||||||
|
AESKey256: TAESKey256;
|
||||||
|
begin
|
||||||
|
Result := '';
|
||||||
|
SS := TStringStream.Create(HexToStr(Value));
|
||||||
|
DS := TStringStream.Create('');
|
||||||
|
try
|
||||||
|
Size := SS.Size;
|
||||||
|
SS.ReadBuffer(Size, SizeOf(Size));
|
||||||
|
{ -- 128 位密匙最大长度为 16 个字符 -- }
|
||||||
|
if KeyBit = kb128 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey128, SizeOf(AESKey128), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey128, Min(SizeOf(AESKey128), Length(Key)));
|
||||||
|
DecryptAESStreamECB(SS, SS.Size - SS.Position, AESKey128, DS);
|
||||||
|
end;
|
||||||
|
{ -- 192 位密匙最大长度为 24 个字符 -- }
|
||||||
|
if KeyBit = kb192 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey192, SizeOf(AESKey192), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey192, Min(SizeOf(AESKey192), Length(Key)));
|
||||||
|
DecryptAESStreamECB(SS, SS.Size - SS.Position, AESKey192, DS);
|
||||||
|
end;
|
||||||
|
{ -- 256 位密匙最大长度为 32 个字符 -- }
|
||||||
|
if KeyBit = kb256 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey256, SizeOf(AESKey256), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey256, Min(SizeOf(AESKey256), Length(Key)));
|
||||||
|
DecryptAESStreamECB(SS, SS.Size - SS.Position, AESKey256, DS);
|
||||||
|
end;
|
||||||
|
Result := DS.DataString;
|
||||||
|
finally
|
||||||
|
SS.Free;
|
||||||
|
DS.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ -- 流加密函数 默认按照 128 位密匙解密 -- }
|
||||||
|
function EncryptStream(Stream: TStream; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): TStream;
|
||||||
|
var
|
||||||
|
Count: Int64;
|
||||||
|
OutStrm: TStream;
|
||||||
|
AESKey128: TAESKey128;
|
||||||
|
AESKey192: TAESKey192;
|
||||||
|
AESKey256: TAESKey256;
|
||||||
|
begin
|
||||||
|
OutStrm := TStream.Create;
|
||||||
|
Stream.Position := 0;
|
||||||
|
Count := Stream.Size;
|
||||||
|
OutStrm.Write(Count, SizeOf(Count));
|
||||||
|
try
|
||||||
|
{ -- 128 位密匙最大长度为 16 个字符 -- }
|
||||||
|
if KeyBit = kb128 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey128, SizeOf(AESKey128), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey128, Min(SizeOf(AESKey128), Length(Key)));
|
||||||
|
EncryptAESStreamECB(Stream, 0, AESKey128, OutStrm);
|
||||||
|
end;
|
||||||
|
{ -- 192 位密匙最大长度为 24 个字符 -- }
|
||||||
|
if KeyBit = kb192 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey192, SizeOf(AESKey192), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey192, Min(SizeOf(AESKey192), Length(Key)));
|
||||||
|
EncryptAESStreamECB(Stream, 0, AESKey192, OutStrm);
|
||||||
|
end;
|
||||||
|
{ -- 256 位密匙最大长度为 32 个字符 -- }
|
||||||
|
if KeyBit = kb256 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey256, SizeOf(AESKey256), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey256, Min(SizeOf(AESKey256), Length(Key)));
|
||||||
|
EncryptAESStreamECB(Stream, 0, AESKey256, OutStrm);
|
||||||
|
end;
|
||||||
|
Result := OutStrm;
|
||||||
|
finally
|
||||||
|
OutStrm.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ -- 流解密函数 默认按照 128 位密匙解密 -- }
|
||||||
|
function DecryptStream(Stream: TStream; Key: string;
|
||||||
|
KeyBit: TKeyBit = kb128): TStream;
|
||||||
|
var
|
||||||
|
Count, OutPos: Int64;
|
||||||
|
OutStrm: TStream;
|
||||||
|
AESKey128: TAESKey128;
|
||||||
|
AESKey192: TAESKey192;
|
||||||
|
AESKey256: TAESKey256;
|
||||||
|
begin
|
||||||
|
OutStrm := TStream.Create;
|
||||||
|
Stream.Position := 0;
|
||||||
|
OutPos :=OutStrm.Position;
|
||||||
|
Stream.ReadBuffer(Count, SizeOf(Count));
|
||||||
|
try
|
||||||
|
{ -- 128 位密匙最大长度为 16 个字符 -- }
|
||||||
|
if KeyBit = kb128 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey128, SizeOf(AESKey128), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey128, Min(SizeOf(AESKey128), Length(Key)));
|
||||||
|
DecryptAESStreamECB(Stream, Stream.Size - Stream.Position,
|
||||||
|
AESKey128, OutStrm);
|
||||||
|
end;
|
||||||
|
{ -- 192 位密匙最大长度为 24 个字符 -- }
|
||||||
|
if KeyBit = kb192 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey192, SizeOf(AESKey192), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey192, Min(SizeOf(AESKey192), Length(Key)));
|
||||||
|
DecryptAESStreamECB(Stream, Stream.Size - Stream.Position,
|
||||||
|
AESKey192, OutStrm);
|
||||||
|
end;
|
||||||
|
{ -- 256 位密匙最大长度为 32 个字符 -- }
|
||||||
|
if KeyBit = kb256 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey256, SizeOf(AESKey256), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey256, Min(SizeOf(AESKey256), Length(Key)));
|
||||||
|
DecryptAESStreamECB(Stream, Stream.Size - Stream.Position,
|
||||||
|
AESKey256, OutStrm);
|
||||||
|
end;
|
||||||
|
OutStrm.Size := OutPos + Count;
|
||||||
|
OutStrm.Position := OutPos;
|
||||||
|
Result := OutStrm;
|
||||||
|
finally
|
||||||
|
OutStrm.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ -- 文件加密函数 默认按照 128 位密匙解密 -- }
|
||||||
|
procedure EncryptFile(SourceFile, DestFile: string;
|
||||||
|
Key: string; KeyBit: TKeyBit = kb128);
|
||||||
|
var
|
||||||
|
SFS, DFS: TFileStream;
|
||||||
|
Size: Int64;
|
||||||
|
AESKey128: TAESKey128;
|
||||||
|
AESKey192: TAESKey192;
|
||||||
|
AESKey256: TAESKey256;
|
||||||
|
begin
|
||||||
|
SFS := TFileStream.Create(SourceFile, fmOpenRead);
|
||||||
|
try
|
||||||
|
DFS := TFileStream.Create(DestFile, fmCreate);
|
||||||
|
try
|
||||||
|
Size := SFS.Size;
|
||||||
|
DFS.WriteBuffer(Size, SizeOf(Size));
|
||||||
|
{ -- 128 位密匙最大长度为 16 个字符 -- }
|
||||||
|
if KeyBit = kb128 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey128, SizeOf(AESKey128), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey128, Min(SizeOf(AESKey128), Length(Key)));
|
||||||
|
EncryptAESStreamECB(SFS, 0, AESKey128, DFS);
|
||||||
|
end;
|
||||||
|
{ -- 192 位密匙最大长度为 24 个字符 -- }
|
||||||
|
if KeyBit = kb192 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey192, SizeOf(AESKey192), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey192, Min(SizeOf(AESKey192), Length(Key)));
|
||||||
|
EncryptAESStreamECB(SFS, 0, AESKey192, DFS);
|
||||||
|
end;
|
||||||
|
{ -- 256 位密匙最大长度为 32 个字符 -- }
|
||||||
|
if KeyBit = kb256 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey256, SizeOf(AESKey256), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey256, Min(SizeOf(AESKey256), Length(Key)));
|
||||||
|
EncryptAESStreamECB(SFS, 0, AESKey256, DFS);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
DFS.Free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
SFS.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ -- 文件解密函数 默认按照 128 位密匙解密 -- }
|
||||||
|
procedure DecryptFile(SourceFile, DestFile: string;
|
||||||
|
Key: string; KeyBit: TKeyBit = kb128);
|
||||||
|
var
|
||||||
|
SFS, DFS: TFileStream;
|
||||||
|
Size: Int64;
|
||||||
|
AESKey128: TAESKey128;
|
||||||
|
AESKey192: TAESKey192;
|
||||||
|
AESKey256: TAESKey256;
|
||||||
|
begin
|
||||||
|
SFS := TFileStream.Create(SourceFile, fmOpenRead);
|
||||||
|
try
|
||||||
|
SFS.ReadBuffer(Size, SizeOf(Size));
|
||||||
|
DFS := TFileStream.Create(DestFile, fmCreate);
|
||||||
|
try
|
||||||
|
{ -- 128 位密匙最大长度为 16 个字符 -- }
|
||||||
|
if KeyBit = kb128 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey128, SizeOf(AESKey128), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey128, Min(SizeOf(AESKey128), Length(Key)));
|
||||||
|
DecryptAESStreamECB(SFS, SFS.Size - SFS.Position, AESKey128, DFS);
|
||||||
|
end;
|
||||||
|
{ -- 192 位密匙最大长度为 24 个字符 -- }
|
||||||
|
if KeyBit = kb192 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey192, SizeOf(AESKey192), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey192, Min(SizeOf(AESKey192), Length(Key)));
|
||||||
|
DecryptAESStreamECB(SFS, SFS.Size - SFS.Position, AESKey192, DFS);
|
||||||
|
end;
|
||||||
|
{ -- 256 位密匙最大长度为 32 个字符 -- }
|
||||||
|
if KeyBit = kb256 then
|
||||||
|
begin
|
||||||
|
FillChar(AESKey256, SizeOf(AESKey256), 0 );
|
||||||
|
Move(PChar(Key)^, AESKey256, Min(SizeOf(AESKey256), Length(Key)));
|
||||||
|
DecryptAESStreamECB(SFS, SFS.Size - SFS.Position, AESKey256, DFS);
|
||||||
|
end;
|
||||||
|
DFS.Size := Size;
|
||||||
|
finally
|
||||||
|
DFS.Free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
SFS.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end.
|
2488
检验管理/ElAES.pas
Normal file
2488
检验管理/ElAES.pas
Normal file
File diff suppressed because it is too large
Load Diff
2
检验管理/FieldExportSet/.INI
Normal file
2
检验管理/FieldExportSet/.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[导出设置]
|
||||||
|
导出字段=Begin/订单号/颜色/出库长度/长度单位/卷号/缸号
|
2
检验管理/FieldExportSet/检验分析订单.INI
Normal file
2
检验管理/FieldExportSet/检验分析订单.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[导出设置]
|
||||||
|
导出字段=Begin/布单号/布类/颜色/针寸数/重量(磅)/疵点个数
|
2
检验管理/FieldExportSet/检验报告.INI
Normal file
2
检验管理/FieldExportSet/检验报告.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[导出设置]
|
||||||
|
导出字段=Begin
|
2
检验管理/FieldExportSet/生产指示单子列表.INI
Normal file
2
检验管理/FieldExportSet/生产指示单子列表.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[导出设置]
|
||||||
|
导出字段=Begin/客户订单号
|
2
检验管理/FieldExportSet/采购单列表.INI
Normal file
2
检验管理/FieldExportSet/采购单列表.INI
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[导出设置]
|
||||||
|
导出字段=Begin/采购单编号/Fabric/布类
|
6
检验管理/File.INI
Normal file
6
检验管理/File.INI
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
[生产车间配置]
|
||||||
|
卷条码机台标志=
|
||||||
|
机台个数=
|
||||||
|
端口号=
|
||||||
|
端口Dll文件=JZCRS323D.dll
|
||||||
|
码表Dll文件=JCYData10.dll
|
138
检验管理/OrderManage.dof
Normal file
138
检验管理/OrderManage.dof
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=D:\富通ERP
|
||||||
|
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;dclOffice2k;Rave50CLX;Rave50VCL
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=F:\selfware_83398\selfware\马国钢开发代码\项目代码\self\订单\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
||||||
|
[Excluded Packages]
|
||||||
|
c:\program files\borland\delphi7\Bin\DBWEBXPRT.BPL=Borland Web Wizard Package
|
23
检验管理/ProjectGroup1.bpg
Normal file
23
检验管理/ProjectGroup1.bpg
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
VERSION = BWS.01
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
!ifndef ROOT
|
||||||
|
ROOT = $(MAKEDIR)\..
|
||||||
|
!endif
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
|
||||||
|
DCC = $(ROOT)\bin\dcc32.exe $**
|
||||||
|
BRCC = $(ROOT)\bin\brcc32.exe $**
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
PROJECTS = testDll.exe ProductPrice.dll
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
default: $(PROJECTS)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
testDll.exe: testDll.dpr
|
||||||
|
$(DCC)
|
||||||
|
|
||||||
|
ProductPrice.dll: ProductPrice.dpr
|
||||||
|
$(DCC)
|
||||||
|
|
||||||
|
|
38
检验管理/RCInspection.cfg
Normal file
38
检验管理/RCInspection.cfg
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
-$A8
|
||||||
|
-$B-
|
||||||
|
-$C+
|
||||||
|
-$D+
|
||||||
|
-$E-
|
||||||
|
-$F-
|
||||||
|
-$G+
|
||||||
|
-$H+
|
||||||
|
-$I+
|
||||||
|
-$J-
|
||||||
|
-$K-
|
||||||
|
-$L+
|
||||||
|
-$M-
|
||||||
|
-$N+
|
||||||
|
-$O+
|
||||||
|
-$P+
|
||||||
|
-$Q-
|
||||||
|
-$R-
|
||||||
|
-$S-
|
||||||
|
-$T-
|
||||||
|
-$U-
|
||||||
|
-$V+
|
||||||
|
-$W-
|
||||||
|
-$X+
|
||||||
|
-$YD
|
||||||
|
-$Z1
|
||||||
|
-cg
|
||||||
|
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
-H+
|
||||||
|
-W+
|
||||||
|
-M
|
||||||
|
-$M16384,1048576
|
||||||
|
-K$00400000
|
||||||
|
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
|
-w-UNSAFE_TYPE
|
||||||
|
-w-UNSAFE_CODE
|
||||||
|
-w-UNSAFE_CAST
|
141
检验管理/RCInspection.dof
Normal file
141
检验管理/RCInspection.dof
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=
|
||||||
|
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;dclOffice2k;Rave50CLX;Rave50VCL
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=D:\selfware_83398\selfware\马国钢开发代码\项目代码\self\染厂检验管理\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
||||||
|
[Excluded Packages]
|
||||||
|
c:\program files\borland\delphi7\Bin\DBWEBXPRT.BPL=Borland Web Wizard Package
|
||||||
|
[HistoryLists\hlUnitAliases]
|
||||||
|
Count=1
|
||||||
|
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
BIN
检验管理/RCInspection.res
Normal file
BIN
检验管理/RCInspection.res
Normal file
Binary file not shown.
3
检验管理/SYSTEMSET.ini
Normal file
3
检验管理/SYSTEMSET.ini
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[SERVER]
|
||||||
|
服务器地址=127.0.0.1
|
||||||
|
软件名称=XXXXXXX1
|
38
检验管理/TradeManage.cfg
Normal file
38
检验管理/TradeManage.cfg
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
-$A8
|
||||||
|
-$B-
|
||||||
|
-$C+
|
||||||
|
-$D+
|
||||||
|
-$E-
|
||||||
|
-$F-
|
||||||
|
-$G+
|
||||||
|
-$H+
|
||||||
|
-$I+
|
||||||
|
-$J-
|
||||||
|
-$K-
|
||||||
|
-$L+
|
||||||
|
-$M-
|
||||||
|
-$N+
|
||||||
|
-$O+
|
||||||
|
-$P+
|
||||||
|
-$Q-
|
||||||
|
-$R-
|
||||||
|
-$S-
|
||||||
|
-$T-
|
||||||
|
-$U-
|
||||||
|
-$V+
|
||||||
|
-$W-
|
||||||
|
-$X+
|
||||||
|
-$YD
|
||||||
|
-$Z1
|
||||||
|
-cg
|
||||||
|
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
-H+
|
||||||
|
-W+
|
||||||
|
-M
|
||||||
|
-$M16384,1048576
|
||||||
|
-K$00400000
|
||||||
|
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
|
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
|
-w-UNSAFE_TYPE
|
||||||
|
-w-UNSAFE_CODE
|
||||||
|
-w-UNSAFE_CAST
|
141
检验管理/TradeManage.dof
Normal file
141
检验管理/TradeManage.dof
Normal file
|
@ -0,0 +1,141 @@
|
||||||
|
[FileVersion]
|
||||||
|
Version=7.0
|
||||||
|
[Compiler]
|
||||||
|
A=8
|
||||||
|
B=0
|
||||||
|
C=1
|
||||||
|
D=1
|
||||||
|
E=0
|
||||||
|
F=0
|
||||||
|
G=1
|
||||||
|
H=1
|
||||||
|
I=1
|
||||||
|
J=0
|
||||||
|
K=0
|
||||||
|
L=1
|
||||||
|
M=0
|
||||||
|
N=1
|
||||||
|
O=1
|
||||||
|
P=1
|
||||||
|
Q=0
|
||||||
|
R=0
|
||||||
|
S=0
|
||||||
|
T=0
|
||||||
|
U=0
|
||||||
|
V=1
|
||||||
|
W=0
|
||||||
|
X=1
|
||||||
|
Y=1
|
||||||
|
Z=1
|
||||||
|
ShowHints=1
|
||||||
|
ShowWarnings=1
|
||||||
|
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
NamespacePrefix=
|
||||||
|
SymbolDeprecated=1
|
||||||
|
SymbolLibrary=1
|
||||||
|
SymbolPlatform=1
|
||||||
|
UnitLibrary=1
|
||||||
|
UnitPlatform=1
|
||||||
|
UnitDeprecated=1
|
||||||
|
HResultCompat=1
|
||||||
|
HidingMember=1
|
||||||
|
HiddenVirtual=1
|
||||||
|
Garbage=1
|
||||||
|
BoundsError=1
|
||||||
|
ZeroNilCompat=1
|
||||||
|
StringConstTruncated=1
|
||||||
|
ForLoopVarVarPar=1
|
||||||
|
TypedConstVarPar=1
|
||||||
|
AsgToTypedConst=1
|
||||||
|
CaseLabelRange=1
|
||||||
|
ForVariable=1
|
||||||
|
ConstructingAbstract=1
|
||||||
|
ComparisonFalse=1
|
||||||
|
ComparisonTrue=1
|
||||||
|
ComparingSignedUnsigned=1
|
||||||
|
CombiningSignedUnsigned=1
|
||||||
|
UnsupportedConstruct=1
|
||||||
|
FileOpen=1
|
||||||
|
FileOpenUnitSrc=1
|
||||||
|
BadGlobalSymbol=1
|
||||||
|
DuplicateConstructorDestructor=1
|
||||||
|
InvalidDirective=1
|
||||||
|
PackageNoLink=1
|
||||||
|
PackageThreadVar=1
|
||||||
|
ImplicitImport=1
|
||||||
|
HPPEMITIgnored=1
|
||||||
|
NoRetVal=1
|
||||||
|
UseBeforeDef=1
|
||||||
|
ForLoopVarUndef=1
|
||||||
|
UnitNameMismatch=1
|
||||||
|
NoCFGFileFound=1
|
||||||
|
MessageDirective=1
|
||||||
|
ImplicitVariants=1
|
||||||
|
UnicodeToLocale=1
|
||||||
|
LocaleToUnicode=1
|
||||||
|
ImagebaseMultiple=1
|
||||||
|
SuspiciousTypecast=1
|
||||||
|
PrivatePropAccessor=1
|
||||||
|
UnsafeType=0
|
||||||
|
UnsafeCode=0
|
||||||
|
UnsafeCast=0
|
||||||
|
[Linker]
|
||||||
|
MapFile=0
|
||||||
|
OutputObjs=0
|
||||||
|
ConsoleApp=1
|
||||||
|
DebugInfo=0
|
||||||
|
RemoteSymbols=0
|
||||||
|
MinStackSize=16384
|
||||||
|
MaxStackSize=1048576
|
||||||
|
ImageBase=4194304
|
||||||
|
ExeDescription=
|
||||||
|
[Directories]
|
||||||
|
OutputDir=
|
||||||
|
UnitOutputDir=
|
||||||
|
PackageDLLOutputDir=
|
||||||
|
PackageDCPOutputDir=
|
||||||
|
SearchPath=
|
||||||
|
Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;dclOffice2k;Rave50CLX;Rave50VCL
|
||||||
|
Conditionals=
|
||||||
|
DebugSourceDirs=
|
||||||
|
UsePackages=0
|
||||||
|
[Parameters]
|
||||||
|
RunParams=
|
||||||
|
HostApplication=D:\徐加艳项目代码\项目代码\惠峰\检验管理\testDll.exe
|
||||||
|
Launcher=
|
||||||
|
UseLauncher=0
|
||||||
|
DebugCWD=
|
||||||
|
[Language]
|
||||||
|
ActiveLang=
|
||||||
|
ProjectLang=
|
||||||
|
RootDir=
|
||||||
|
[Version Info]
|
||||||
|
IncludeVerInfo=0
|
||||||
|
AutoIncBuild=0
|
||||||
|
MajorVer=1
|
||||||
|
MinorVer=0
|
||||||
|
Release=0
|
||||||
|
Build=0
|
||||||
|
Debug=0
|
||||||
|
PreRelease=0
|
||||||
|
Special=0
|
||||||
|
Private=0
|
||||||
|
DLL=0
|
||||||
|
Locale=2052
|
||||||
|
CodePage=936
|
||||||
|
[Version Info Keys]
|
||||||
|
CompanyName=
|
||||||
|
FileDescription=
|
||||||
|
FileVersion=1.0.0.0
|
||||||
|
InternalName=
|
||||||
|
LegalCopyright=
|
||||||
|
LegalTrademarks=
|
||||||
|
OriginalFilename=
|
||||||
|
ProductName=
|
||||||
|
ProductVersion=1.0.0.0
|
||||||
|
Comments=
|
||||||
|
[Excluded Packages]
|
||||||
|
c:\program files\borland\delphi7\Bin\DBWEBXPRT.BPL=Borland Web Wizard Package
|
||||||
|
[HistoryLists\hlUnitAliases]
|
||||||
|
Count=1
|
||||||
|
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
77
检验管理/TradeManage.dpr
Normal file
77
检验管理/TradeManage.dpr
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
library TradeManage;
|
||||||
|
uses
|
||||||
|
SysUtils,
|
||||||
|
classes,
|
||||||
|
forms,
|
||||||
|
WinTypes,
|
||||||
|
WinProcs,
|
||||||
|
U_DataLink in 'U_DataLink.pas' {DataLink_TradeManage: TDataModule},
|
||||||
|
U_GetDllForm in 'U_GetDllForm.pas',
|
||||||
|
U_ZDYHelpSel in '..\..\..\ThreeFun\Form\U_ZDYHelpSel.pas' {frmZDYHelpSel},
|
||||||
|
U_SelExportField in '..\..\..\ThreeFun\Fun\U_SelExportField.pas' {frmSelExportField},
|
||||||
|
U_ColumnSet in '..\..\..\ThreeFun\Form\U_ColumnSet.pas' {frmColumnSet},
|
||||||
|
U_ZDYHelp in '..\..\..\ThreeFun\Form\U_ZDYHelp.pas' {frmZDYHelp},
|
||||||
|
U_GetAddRess in '..\..\..\ThreeFun\Form\U_GetAddRess.pas',
|
||||||
|
U_iniParam in 'U_iniParam.pas',
|
||||||
|
AES in 'AES.pas',
|
||||||
|
ElAES in 'ElAES.pas',
|
||||||
|
U_SelPrintFieldNew in '..\..\..\ThreeFun\Form\U_SelPrintFieldNew.pas' {frmSelPrintFieldNew},
|
||||||
|
U_LabelPrint in 'U_LabelPrint.pas' {frmLabelPrint},
|
||||||
|
U_ConInPutNX in 'U_ConInPutNX.pas' {frmConInPutNX},
|
||||||
|
U_MJManageNewFDNew in 'U_MJManageNewFDNew.pas' {frmMJManageNewFDNewSF},
|
||||||
|
U_MJEdit in 'U_MJEdit.pas' {frmMJEdit},
|
||||||
|
U_CpRkSaoMNewDB in 'U_CpRkSaoMNewDB.pas' {frmCpRkSaoMNewDB},
|
||||||
|
U_OrderSelRK in 'U_OrderSelRK.pas' {frmOrderSelRK},
|
||||||
|
U_CKProductBCPKCHZList in 'U_CKProductBCPKCHZList.pas' {frmCKProductBCPKCHZList},
|
||||||
|
U_ClothHCList in 'U_ClothHCList.pas' {frmClothHCList},
|
||||||
|
U_ContractListNX in 'U_ContractListNX.pas' {frmContractListNX},
|
||||||
|
U_OrderJDList in 'U_OrderJDList.pas' {frmOrderJDList},
|
||||||
|
U_ProductOrderListSel in 'U_ProductOrderListSel.pas' {frmProductOrderListSel},
|
||||||
|
U_ConInPut in 'U_ConInPut.pas' {frmConInPut},
|
||||||
|
U_ClothContractInPut in 'U_ClothContractInPut.pas' {frmClothContractInPut},
|
||||||
|
U_ClothContractList in 'U_ClothContractList.pas' {frmClothContractList},
|
||||||
|
U_ClothContractInPutHZ in 'U_ClothContractInPutHZ.pas' {frmClothContractInPutHZ},
|
||||||
|
U_OrderInPut in 'U_OrderInPut.pas' {frmOrderInPut},
|
||||||
|
U_CKProductBCPOutList in 'U_CKProductBCPOutList.pas' {frmCKProductBCPOutList},
|
||||||
|
U_CpRkSaoMNew in 'U_CpRkSaoMNew.pas' {frmCpRkSaoMNew},
|
||||||
|
U_Fun10 in '..\..\..\ThreeFun\Fun\U_Fun10.pas',
|
||||||
|
U_ProductOrderNewList_JD in 'U_ProductOrderNewList_JD.pas' {frmProductOrderNewList_JD},
|
||||||
|
U_HCList in 'U_HCList.pas' {frmHCList},
|
||||||
|
U_ModulePromptList in 'U_ModulePromptList.pas' {frmModulePromptList},
|
||||||
|
U_Fun in '..\..\..\ThreeFun\Fun\U_Fun.pas',
|
||||||
|
U_FjList in 'U_FjList.pas' {frmFjList},
|
||||||
|
getpic in 'getpic.pas' {FormGetPic},
|
||||||
|
U_JYOrderOther_Main in 'U_JYOrderOther_Main.pas' {FrmJYOrderOther},
|
||||||
|
U_FjList10 in '..\..\..\ThreeFun\Form\U_FjList10.pas' {frmFjList10},
|
||||||
|
U_CompressionFun in '..\..\..\ThreeFun\Fun\U_CompressionFun.pas',
|
||||||
|
U_ColumnBandSet in '..\..\..\ThreeFun\Form\U_ColumnBandSet.pas' {frmColumnBandSet},
|
||||||
|
U_CKJYList in 'U_CKJYList.pas' {frmCKJYList},
|
||||||
|
U_CKProductJYHZList in 'U_CKProductJYHZList.pas' {frmCKProductJYHZList},
|
||||||
|
U_SysLogOrder in 'U_SysLogOrder.pas' {frmSysLogOrder},
|
||||||
|
U_MJSJFX in 'U_MJSJFX.pas' {frmMJSJFX},
|
||||||
|
U_RTFun in '..\..\..\RTFunAndForm\Fun\U_RTFun.pas';
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
procedure DllEnterPoint(dwReason: DWORD);far;stdcall;
|
||||||
|
begin
|
||||||
|
DLLProc := @DLLEnterPoint;
|
||||||
|
DllEnterPoint(DLL_PROCESS_ATTACH);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure DLLUnloadProc(Reason: Integer); register;
|
||||||
|
begin
|
||||||
|
// if (Reason = DLL_PROCESS_DETACH) or (Reason=DLL_THREAD_DETACH) then
|
||||||
|
// Application:=NewDllApp;
|
||||||
|
end;
|
||||||
|
exports
|
||||||
|
GetDllForm;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
NewDllApp:=Application;
|
||||||
|
DLLProc := @DLLUnloadProc;
|
||||||
|
except
|
||||||
|
|
||||||
|
end;
|
||||||
|
end.
|
||||||
|
|
BIN
检验管理/TradeManage.rar
Normal file
BIN
检验管理/TradeManage.rar
Normal file
Binary file not shown.
BIN
检验管理/TradeManage.res
Normal file
BIN
检验管理/TradeManage.res
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user