1234
This commit is contained in:
commit
e4d35a6883
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
|
||||
42
客户供应商管理(Company.dll)/Company.cfg
Normal file
42
客户供应商管理(Company.dll)/Company.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
客户供应商管理(Company.dll)/Company.dof
Normal file
138
客户供应商管理(Company.dll)/Company.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:\丁迪峰开发代码\项目代码\呈协\客户供应商管理(Company.dll)\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
|
||||
46
客户供应商管理(Company.dll)/Company.dpr
Normal file
46
客户供应商管理(Company.dll)/Company.dpr
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
library Company;
|
||||
|
||||
uses
|
||||
SysUtils,
|
||||
classes,
|
||||
forms,
|
||||
WinTypes,
|
||||
WinProcs,
|
||||
U_GetDllForm in 'U_GetDllForm.pas',
|
||||
U_RTFun in '..\..\..\RTFunAndForm\Fun\U_RTFun.pas',
|
||||
U_ModuleNote in 'U_ModuleNote.pas' {frmModuleNote},
|
||||
U_DataLink in 'U_DataLink.pas' {DataLink_Company: TDataModule},
|
||||
U_ZDYHelpSel in 'U_ZDYHelpSel.pas' {frmZDYHelpSel},
|
||||
U_iniParam in 'U_iniParam.pas',
|
||||
U_ZDYHelp in 'U_ZDYHelp.pas' {frmZDYHelp},
|
||||
U_Fun in '..\..\..\ThreeFun\Fun\U_Fun.pas',
|
||||
U_Fun10 in '..\..\..\ThreeFun\Fun\U_Fun10.pas',
|
||||
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};
|
||||
|
||||
{$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
客户供应商管理(Company.dll)/Company.res
Normal file
BIN
客户供应商管理(Company.dll)/Company.res
Normal file
Binary file not shown.
3
客户供应商管理(Company.dll)/Desktop.ini
Normal file
3
客户供应商管理(Company.dll)/Desktop.ini
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[.ShellClassInfo]
|
||||
IconFile=C:\Program Files (x86)\360\360WangPan\new_desktop_win7.ico
|
||||
IconIndex=0
|
||||
4
客户供应商管理(Company.dll)/File.INI
Normal file
4
客户供应商管理(Company.dll)/File.INI
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[生产车间配置]
|
||||
卷条码机台标志=99
|
||||
成品DLL文件=CYZZ.dll
|
||||
成品DLL调用号=11
|
||||
7
客户供应商管理(Company.dll)/FileHelp.ini
Normal file
7
客户供应商管理(Company.dll)/FileHelp.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[FILEPATH]
|
||||
FileClass=YP,AA,BB,HT
|
||||
YP=D:\YP
|
||||
AA=D:\AA
|
||||
BB=D:\BB
|
||||
HT=D:\HT
|
||||
OTHER=D:\OTHER
|
||||
7
客户供应商管理(Company.dll)/JCYData.INI
Normal file
7
客户供应商管理(Company.dll)/JCYData.INI
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[系统配置]
|
||||
串口号=com1
|
||||
波特率=9600
|
||||
校验位=0
|
||||
数据位=8
|
||||
停止位=0
|
||||
频率=100
|
||||
7
客户供应商管理(Company.dll)/JZCRS323C.INI
Normal file
7
客户供应商管理(Company.dll)/JZCRS323C.INI
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[系统配置]
|
||||
串口号=com2
|
||||
波特率=1200
|
||||
校验位=0
|
||||
数据位=8
|
||||
停止位=0
|
||||
频率=100
|
||||
0
客户供应商管理(Company.dll)/JZCRS323CList.txt
Normal file
0
客户供应商管理(Company.dll)/JZCRS323CList.txt
Normal file
23
客户供应商管理(Company.dll)/ProjectGroup1.bpg
Normal file
23
客户供应商管理(Company.dll)/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)
|
||||
|
||||
|
||||
3
客户供应商管理(Company.dll)/SYSTEMSET.ini
Normal file
3
客户供应商管理(Company.dll)/SYSTEMSET.ini
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[SERVER]
|
||||
服务器地址=172.168.1.246
|
||||
软件名称=欣戈纺织
|
||||
444
客户供应商管理(Company.dll)/U_Customer.dfm
Normal file
444
客户供应商管理(Company.dll)/U_Customer.dfm
Normal file
|
|
@ -0,0 +1,444 @@
|
|||
object frmCustomer: TfrmCustomer
|
||||
Left = 160
|
||||
Top = 149
|
||||
Width = 1382
|
||||
Height = 650
|
||||
Caption = #23458#25143#36164#26009#31649#29702
|
||||
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 = 1366
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 95
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Company.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Company.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 3
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 113
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25351#23450#19994#21153#21592
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 414
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1366
|
||||
Height = 39
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 190
|
||||
Top = 13
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #23458#25143#21517#31216
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 22
|
||||
Top = 13
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #23458#25143#32534#21495
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 350
|
||||
Top = 13
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = #19994#21153#21592
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 502
|
||||
Top = 13
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #22320#21306
|
||||
end
|
||||
object CoName: TEdit
|
||||
Tag = 2
|
||||
Left = 238
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 1
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
object CoCode: TEdit
|
||||
Tag = 2
|
||||
Left = 70
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 0
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
object Salesman: TEdit
|
||||
Tag = 2
|
||||
Left = 388
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 2
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
object Coarea: TEdit
|
||||
Tag = 2
|
||||
Left = 532
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 3
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 70
|
||||
Width = 1366
|
||||
Height = 338
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnFocusedRecordChanged = Tv2FocusedRecordChanged
|
||||
DataController.DataSource = DS_HZ
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Inactive = DataLink_Company.SHuangSe
|
||||
Styles.IncSearch = DataLink_Company.SHuangSe
|
||||
Styles.Selection = DataLink_Company.SHuangSe
|
||||
Styles.Header = DataLink_Company.handBlack
|
||||
object v2Column2: TcxGridDBColumn
|
||||
Caption = #23458#25143#32534#21495
|
||||
DataBinding.FieldName = 'CoCode'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 86
|
||||
end
|
||||
object v2Column6: TcxGridDBColumn
|
||||
Caption = #23458#25143#21517#31216
|
||||
DataBinding.FieldName = 'CoName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 127
|
||||
end
|
||||
object v2Column15: TcxGridDBColumn
|
||||
Caption = #23458#25143#31616#31216
|
||||
DataBinding.FieldName = 'CoHRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 100
|
||||
end
|
||||
object v2Column10: TcxGridDBColumn
|
||||
Caption = #19994#21153#21592
|
||||
DataBinding.FieldName = 'Salesman'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 84
|
||||
end
|
||||
object v2DEFStr7: TcxGridDBColumn
|
||||
Caption = #22320#21306
|
||||
DataBinding.FieldName = 'Coarea'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object v2Column7: TcxGridDBColumn
|
||||
Caption = #20844#21496#22320#22336
|
||||
DataBinding.FieldName = 'CoAddress'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
object v2Column3: TcxGridDBColumn
|
||||
Caption = #38134#34892#36134#21495
|
||||
DataBinding.FieldName = 'BankNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v2Column4: TcxGridDBColumn
|
||||
Caption = #24320#25143#34892
|
||||
DataBinding.FieldName = 'BankName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 103
|
||||
end
|
||||
object v2Column1: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 163
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 408
|
||||
Width = 1366
|
||||
Height = 204
|
||||
Align = alBottom
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSLXR
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Header = DataLink_Company.Default
|
||||
object v3Column3: TcxGridDBColumn
|
||||
Caption = #40664#35748
|
||||
DataBinding.FieldName = 'IsDefault'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'Contacts'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'position'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'Fax'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'Telephone'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #25163#26426
|
||||
DataBinding.FieldName = 'PhoneNumber'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object Tv1Column1: TcxGridDBColumn
|
||||
Caption = #37038#31665
|
||||
DataBinding.FieldName = 'Email'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v3Column2: TcxGridDBColumn
|
||||
Caption = #24494#20449
|
||||
DataBinding.FieldName = 'WeChat'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 773
|
||||
Top = 9
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
Parameters = <>
|
||||
Left = 829
|
||||
Top = 17
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 949
|
||||
Top = 225
|
||||
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 = 864
|
||||
Top = 224
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
Left = 928
|
||||
Top = 216
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 888
|
||||
Top = 224
|
||||
end
|
||||
object DS_HZ: TDataSource
|
||||
DataSet = CDS_HZ
|
||||
Left = 915
|
||||
Top = 163
|
||||
end
|
||||
object CDS_HZ: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 712
|
||||
Top = 192
|
||||
end
|
||||
object CDS_LXR: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 448
|
||||
Top = 428
|
||||
end
|
||||
object DSLXR: TDataSource
|
||||
DataSet = CDS_LXR
|
||||
Left = 483
|
||||
Top = 419
|
||||
end
|
||||
end
|
||||
289
客户供应商管理(Company.dll)/U_Customer.pas
Normal file
289
客户供应商管理(Company.dll)/U_Customer.pas
Normal file
|
|
@ -0,0 +1,289 @@
|
|||
unit U_Customer;
|
||||
|
||||
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, cxDBLookupComboBox;
|
||||
|
||||
type
|
||||
TfrmCustomer = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
Panel1: TPanel;
|
||||
ToolButton2: TToolButton;
|
||||
ADOQueryMain: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
Label3: TLabel;
|
||||
CoName: TEdit;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
DS_HZ: TDataSource;
|
||||
CDS_HZ: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
v2Column6: TcxGridDBColumn;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
v2Column2: TcxGridDBColumn;
|
||||
v2Column7: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
CoCode: TEdit;
|
||||
v2Column10: TcxGridDBColumn;
|
||||
ToolButton4: TToolButton;
|
||||
Label2: TLabel;
|
||||
Salesman: TEdit;
|
||||
v2DEFStr7: TcxGridDBColumn;
|
||||
Coarea: TEdit;
|
||||
Label4: TLabel;
|
||||
v2Column15: TcxGridDBColumn;
|
||||
CDS_LXR: TClientDataSet;
|
||||
DSLXR: TDataSource;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v3Column3: TcxGridDBColumn;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
Tv1Column1: TcxGridDBColumn;
|
||||
v3Column2: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
ToolButton1: TToolButton;
|
||||
v2Column3: TcxGridDBColumn;
|
||||
v2Column4: 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 TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure CoNameChange(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure TBuserClick(Sender: TObject);
|
||||
procedure Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
procedure SetStatus();
|
||||
public
|
||||
canshu1:string;
|
||||
end;
|
||||
|
||||
//var
|
||||
// frmCustomer: TfrmCustomer;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun,U_ZDYHelp,U_CustomerInput,U_YWYSel;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmCustomer.SetStatus();
|
||||
begin
|
||||
ToolButton1.Visible:=false;
|
||||
if Trim(canshu1)='管理员' then
|
||||
begin
|
||||
ToolButton1.Visible:=true;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
procedure TfrmCustomer.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company where CoType=''客户'' and Valid=''Y'' ');
|
||||
if Trim(canshu1)='业务员' then
|
||||
sql.Add(' and Salesman='+quotedstr(trim(DName)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
||||
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmCustomer.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
// frmCustomer:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(trim(self.caption),Tv2,'客户管理');
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCustomer.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_HZ.fieldbyname('COID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update Company set Valid=''N'' where COID='''+Trim(CDS_HZ.fieldbyname('COID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
CDS_HZ.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid(trim(self.Caption),Tv2,'客户管理');
|
||||
SetStatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.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 TfrmCustomer.CoNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmCustomer.ToolButton4Click(Sender: TObject);
|
||||
begin
|
||||
IF CDS_HZ.IsEmpty then exit;
|
||||
try
|
||||
frmCustomerInput:=TfrmCustomerInput.Create(Application);
|
||||
with frmCustomerInput do
|
||||
begin
|
||||
FCOID:=Trim(Self.CDS_HZ.fieldbyname('COID').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCustomerInput.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmCustomerInput:=TfrmCustomerInput.Create(Application);
|
||||
with frmCustomerInput do
|
||||
begin
|
||||
Salesman.Text:=trim(Dname);
|
||||
FCOID:='';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCustomerInput.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.TBuserClick(Sender: TObject);
|
||||
var
|
||||
FuserName:string;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.Tv2FocusedRecordChanged(
|
||||
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||
AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company_contact where COID='+quotedstr(Trim(CDS_HZ.FieldByName('COID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_LXR);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_LXR);
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
MSalesman:string;
|
||||
begin
|
||||
try
|
||||
frmYWYSel:=TfrmYWYSel.Create(Application);
|
||||
with frmYWYSel do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
MSalesman:=Trim(ClientDataSet1.fieldbyname('UserName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmYWYSel.Free;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update Company set Salesman='+quotedstr(trim(MSalesman))+' where COID='''+Trim(CDS_HZ.fieldbyname('COID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
initgrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCustomer.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
404
客户供应商管理(Company.dll)/U_CustomerInput.dfm
Normal file
404
客户供应商管理(Company.dll)/U_CustomerInput.dfm
Normal file
|
|
@ -0,0 +1,404 @@
|
|||
object frmCustomerInput: TfrmCustomerInput
|
||||
Left = 261
|
||||
Top = 149
|
||||
Width = 1123
|
||||
Height = 574
|
||||
Caption = #23458#25143#36164#26009#24405#20837
|
||||
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 = 1107
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Company.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Company.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object ToolButton3: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 217
|
||||
Width = 1107
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 119
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Company.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Company.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #35774#20026#40664#35748#32852#31995#20154
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 123
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 186
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 248
|
||||
Width = 1107
|
||||
Height = 288
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSLXR
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Header = DataLink_Company.Default
|
||||
object v3Column3: TcxGridDBColumn
|
||||
Caption = #40664#35748
|
||||
DataBinding.FieldName = 'IsDefault'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'Contacts'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'position'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'Fax'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'Telephone'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #25163#26426
|
||||
DataBinding.FieldName = 'PhoneNumber'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object Tv1Column1: TcxGridDBColumn
|
||||
Caption = #37038#31665
|
||||
DataBinding.FieldName = 'Email'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v3Column2: TcxGridDBColumn
|
||||
Caption = #24494#20449
|
||||
DataBinding.FieldName = 'WeChat'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1107
|
||||
Height = 186
|
||||
Align = alTop
|
||||
BevelInner = bvNone
|
||||
BevelOuter = bvNone
|
||||
Ctl3D = False
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentCtl3D = False
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 42
|
||||
Top = 35
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #23458#25143#32534#21495
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 304
|
||||
Top = 35
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #23458#25143#21517#31216
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 42
|
||||
Top = 63
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #22320' '#21306
|
||||
end
|
||||
object Label39: TLabel
|
||||
Left = 304
|
||||
Top = 63
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #20844#21496#22320#22336
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 42
|
||||
Top = 119
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #22791' '#27880
|
||||
end
|
||||
object Label19: TLabel
|
||||
Left = 548
|
||||
Top = 63
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #19994' '#21153' '#21592
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 547
|
||||
Top = 35
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #23458#25143#31616#31216
|
||||
end
|
||||
object Label35: TLabel
|
||||
Left = 38
|
||||
Top = 89
|
||||
Width = 60
|
||||
Height = 15
|
||||
Caption = #38134#34892#36134#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label36: TLabel
|
||||
Left = 299
|
||||
Top = 89
|
||||
Width = 61
|
||||
Height = 15
|
||||
Caption = #24320' '#25143' '#34892
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object CoName: TEdit
|
||||
Tag = 2
|
||||
Left = 367
|
||||
Top = 32
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 1
|
||||
end
|
||||
object CoAddress: TEdit
|
||||
Tag = 2
|
||||
Left = 367
|
||||
Top = 60
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 4
|
||||
end
|
||||
object Note: TMemo
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 116
|
||||
Width = 877
|
||||
Height = 57
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 8
|
||||
end
|
||||
object CoHRName: TEdit
|
||||
Tag = 2
|
||||
Left = 612
|
||||
Top = 32
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 2
|
||||
end
|
||||
object CoCode: TEdit
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 32
|
||||
Width = 140
|
||||
Height = 20
|
||||
Enabled = False
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 0
|
||||
end
|
||||
object Coarea: TEdit
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 60
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 3
|
||||
end
|
||||
object Salesman: TEdit
|
||||
Tag = 2
|
||||
Left = 612
|
||||
Top = 61
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 5
|
||||
end
|
||||
object BankName: TEdit
|
||||
Tag = 2
|
||||
Left = 367
|
||||
Top = 86
|
||||
Width = 150
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 7
|
||||
end
|
||||
object BankNo: TEdit
|
||||
Tag = 2
|
||||
Left = 111
|
||||
Top = 86
|
||||
Width = 150
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 6
|
||||
end
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 419
|
||||
Top = 264
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
Parameters = <>
|
||||
Left = 462
|
||||
Top = 264
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 525
|
||||
Top = 281
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 382
|
||||
Top = 382
|
||||
end
|
||||
object CDS_LXR: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 425
|
||||
Top = 383
|
||||
end
|
||||
object DSLXR: TDataSource
|
||||
DataSet = CDS_LXR
|
||||
Left = 472
|
||||
Top = 383
|
||||
end
|
||||
end
|
||||
389
客户供应商管理(Company.dll)/U_CustomerInput.pas
Normal file
389
客户供应商管理(Company.dll)/U_CustomerInput.pas
Normal file
|
|
@ -0,0 +1,389 @@
|
|||
unit U_CustomerInput;
|
||||
|
||||
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, cxDropDownEdit, BtnEdit;
|
||||
|
||||
type
|
||||
TfrmCustomerInput = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
ToolButton3: TToolButton;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
CDS_LXR: TClientDataSet;
|
||||
DSLXR: TDataSource;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
Tv1Column1: TcxGridDBColumn;
|
||||
v3Column2: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
v3Column3: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
ScrollBox1: TScrollBox;
|
||||
Label2: TLabel;
|
||||
Label6: TLabel;
|
||||
Label12: TLabel;
|
||||
Label39: TLabel;
|
||||
Label7: TLabel;
|
||||
Label19: TLabel;
|
||||
CoName: TEdit;
|
||||
CoAddress: TEdit;
|
||||
Note: TMemo;
|
||||
Label1: TLabel;
|
||||
CoHRName: TEdit;
|
||||
CoCode: TEdit;
|
||||
Coarea: TEdit;
|
||||
Salesman: TEdit;
|
||||
Label35: TLabel;
|
||||
Label36: TLabel;
|
||||
BankName: TEdit;
|
||||
BankNo: TEdit;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
function SaveData():Boolean;
|
||||
|
||||
public
|
||||
fkhType:string;
|
||||
{ Public declarations }
|
||||
FCOID:String;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
frmCustomerInput: TfrmCustomerInput;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun,U_ZDYHelp,U_YWYSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
procedure TfrmCustomerInput.InitGrid();
|
||||
begin
|
||||
try
|
||||
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company where CoType=''客户'' and COID='''+Trim(FCOID)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCSHData(ADOQueryMain,ScrollBox1,2);
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company_contact where COID='+quotedstr(Trim(FCOID)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_LXR);
|
||||
SInitCDSData20(ADOQueryMain,CDS_LXR);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmCustomerInput.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCustomerInput:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomerInput.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomerInput.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(trim(self.Caption),Tv1,'客户管理');
|
||||
ModalResult:=1;
|
||||
end;
|
||||
procedure TfrmCustomerInput.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid(trim(self.Caption),Tv1,'客户管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCustomerInput.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
function TfrmCustomerInput.SaveData():Boolean;
|
||||
var
|
||||
MaxId,MaxSubId,FCoCode,FCCID:String;
|
||||
begin
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if Trim(FCOID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'CO','Company',4,1)=False then
|
||||
begin
|
||||
Result:=False;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if GetLSNo(ADOQueryCmd,FCoCode,'KH','Company',4,0)=False then
|
||||
begin
|
||||
Result:=False;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
CoCode.Text:=trim(FCoCode);
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxId:=Trim(FCOID);
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from Company where COID='''+Trim(FCOID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FCOID)='' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value:=Trim(DName);
|
||||
FieldByName('Edittime').Value:=SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('COID').Value:=Trim(maxId);
|
||||
SSetsaveSqlNew(ADOQueryCmd,'Company',ScrollBox1,2);
|
||||
FieldByName('CoType').Value:='客户';
|
||||
Post;
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Company where CoName='+quotedstr(trim(CoName.Text)));
|
||||
sql.Add(' and CoType=''客户'' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryCmd.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('客户名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Company where CoCode='+quotedstr(trim(CoCode.Text)));
|
||||
sql.Add(' and CoType=''客户'' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryCmd.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('编号重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
IF not CDS_LXR.IsEmpty then
|
||||
begin
|
||||
with CDS_LXR do
|
||||
begin
|
||||
CDS_LXR.First;
|
||||
while not Eof do
|
||||
begin
|
||||
FCCID:=Trim(CDS_LXR.fieldbyname('CCID').AsString);
|
||||
if Trim(FCCID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,MaxSubId,'CCS','Company_contact',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取系人最大ID失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxSubId:=trim(FCCID);
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Company_contact where CCID='+quotedstr(Trim(MaxSubId)));
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FCCID)='' then
|
||||
begin
|
||||
Append;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('CCID').Value:=Trim(MaxSubId);
|
||||
FieldByName('COID').Value:=Trim(maxId);
|
||||
RTSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_LXR,'Company_contact',0);
|
||||
Post;
|
||||
end;
|
||||
with CDS_LXR do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('CCID').Value:=Trim(MaxSubId);
|
||||
Post;
|
||||
end;
|
||||
CDS_LXR.Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
FCCID:=Trim(MaxSubId);
|
||||
Result:=True;
|
||||
except
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomerInput.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
|
||||
if Trim(CoName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('客户名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if SaveData() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmCustomerInput.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'CC','Company_contact',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取系人最大ID失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if CDS_LXR.IsEmpty then
|
||||
begin
|
||||
with CDS_LXR do
|
||||
begin
|
||||
Append;
|
||||
fieldbyname('CCID').Value:=trim(maxno);
|
||||
fieldbyname('IsDefault').Value:=true;
|
||||
Post;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
with CDS_LXR do
|
||||
begin
|
||||
Append;
|
||||
fieldbyname('CCID').Value:=trim(maxno);
|
||||
fieldbyname('IsDefault').Value:=false;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCustomerInput.ToolButton5Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_LXR.IsEmpty then Exit;
|
||||
if Trim(CDS_LXR.fieldbyname('ASID').AsString)<>'' then
|
||||
begin
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from Company_contact where CCID='''+Trim(CDS_LXR.fieldbyname('CCID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
CDS_LXR.Delete;
|
||||
if CDS_LXR.IsEmpty=false then
|
||||
begin
|
||||
if CDS_LXR.Locate('IsDefault',true,[])=false then
|
||||
begin
|
||||
CDS_LXR.first;
|
||||
CDS_LXR.edit;
|
||||
CDS_LXR.FieldByName('IsDefault').value:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCustomerInput.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
DwFlag:string;
|
||||
begin
|
||||
DwFlag:= trim(CDS_LXR.FieldByName('CCID').AsString);
|
||||
if CDS_LXR.Locate('IsDefault',true,[]) then
|
||||
begin
|
||||
CDS_LXR.edit;
|
||||
CDS_LXR.FieldByName('IsDefault').value:=false;
|
||||
end;
|
||||
if CDS_LXR.Locate('CCID',DwFlag,[]) then
|
||||
begin
|
||||
CDS_LXR.edit;
|
||||
CDS_LXR.FieldByName('IsDefault').value:=true;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
17983
客户供应商管理(Company.dll)/U_DataLink.dfm
Normal file
17983
客户供应商管理(Company.dll)/U_DataLink.dfm
Normal file
File diff suppressed because it is too large
Load Diff
70
客户供应商管理(Company.dll)/U_DataLink.pas
Normal file
70
客户供应商管理(Company.dll)/U_DataLink.pas
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
unit U_DataLink;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, DB, ADODB, ImgList, Controls, cxStyles, cxLookAndFeels,
|
||||
Windows,Messages,forms,OleCtnrs,DateUtils;
|
||||
var
|
||||
DConString:String; {全局连接字符串}
|
||||
server, dtbase, user, pswd: String; {数据库连接参数}
|
||||
DCurHandle:hwnd; //当前窗体句柄
|
||||
DName:string ; //#用户名#//
|
||||
DCode:string ; //#用户编号#//
|
||||
Ddatabase:string; //#数据库名称#//
|
||||
DTitCaption: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; //公司
|
||||
type
|
||||
TDataLink_Company = 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;
|
||||
SHuangSeCu: 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_Company: TDataLink_Company;
|
||||
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
procedure TDataLink_Company.DataModuleDestroy(Sender: TObject);
|
||||
begin
|
||||
DataLink_Company:=nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
||||
440
客户供应商管理(Company.dll)/U_Factory.dfm
Normal file
440
客户供应商管理(Company.dll)/U_Factory.dfm
Normal file
|
|
@ -0,0 +1,440 @@
|
|||
object frmFactory: TfrmFactory
|
||||
Left = 160
|
||||
Top = 149
|
||||
Width = 1382
|
||||
Height = 650
|
||||
Caption = #20379#24212#21830#36164#26009#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 = 1366
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Company.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Company.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 3
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 113
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1366
|
||||
Height = 39
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 202
|
||||
Top = 13
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#21517#31216
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 22
|
||||
Top = 13
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 407
|
||||
Top = 13
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #22320#21306
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 573
|
||||
Top = 13
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #31867#22411
|
||||
end
|
||||
object CoName: TEdit
|
||||
Tag = 2
|
||||
Left = 263
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 1
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
object CoCode: TEdit
|
||||
Tag = 2
|
||||
Left = 82
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 0
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
object Coarea: TEdit
|
||||
Tag = 2
|
||||
Left = 437
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 2
|
||||
OnChange = CoNameChange
|
||||
end
|
||||
object FactType: TComboBox
|
||||
Tag = 2
|
||||
Left = 605
|
||||
Top = 9
|
||||
Width = 80
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
ItemHeight = 12
|
||||
TabOrder = 3
|
||||
Items.Strings = (
|
||||
''
|
||||
#21407#26009#20379#24212#21830
|
||||
#32455#36896#21152#24037#21450#22383#24067
|
||||
#21360#26579#21152#24037#21378
|
||||
#21518#22788#29702#21152#24037#21378)
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 70
|
||||
Width = 1366
|
||||
Height = 338
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnFocusedRecordChanged = Tv2FocusedRecordChanged
|
||||
DataController.DataSource = DS_HZ
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Inactive = DataLink_Company.SHuangSe
|
||||
Styles.IncSearch = DataLink_Company.SHuangSe
|
||||
Styles.Selection = DataLink_Company.SHuangSe
|
||||
Styles.Header = DataLink_Company.handBlack
|
||||
object v2Column2: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
DataBinding.FieldName = 'CoCode'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 86
|
||||
end
|
||||
object v2Column6: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#21517#31216
|
||||
DataBinding.FieldName = 'CoName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 127
|
||||
end
|
||||
object v2Column15: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#31616#31216
|
||||
DataBinding.FieldName = 'CoHRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 100
|
||||
end
|
||||
object v2Column3: TcxGridDBColumn
|
||||
Caption = #31867#22411
|
||||
DataBinding.FieldName = 'FactType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 74
|
||||
end
|
||||
object v2DEFStr7: TcxGridDBColumn
|
||||
Caption = #22320#21306
|
||||
DataBinding.FieldName = 'Coarea'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object v2Column7: TcxGridDBColumn
|
||||
Caption = #20844#21496#22320#22336
|
||||
DataBinding.FieldName = 'CoAddress'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
object v2Column1: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 163
|
||||
end
|
||||
object v2Column12: TcxGridDBColumn
|
||||
Caption = #25805#20316#21592
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v2Column4: TcxGridDBColumn
|
||||
Caption = #36319#21333#21592
|
||||
DataBinding.FieldName = 'COGdy'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 55
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 408
|
||||
Width = 1366
|
||||
Height = 204
|
||||
Align = alBottom
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSLXR
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Header = DataLink_Company.Default
|
||||
object v3Column3: TcxGridDBColumn
|
||||
Caption = #40664#35748
|
||||
DataBinding.FieldName = 'IsDefault'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'Contacts'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'position'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'Fax'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'Telephone'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #25163#26426
|
||||
DataBinding.FieldName = 'PhoneNumber'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object Tv1Column1: TcxGridDBColumn
|
||||
Caption = #37038#31665
|
||||
DataBinding.FieldName = 'Email'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v3Column2: TcxGridDBColumn
|
||||
Caption = #24494#20449
|
||||
DataBinding.FieldName = 'WeChat'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 773
|
||||
Top = 9
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
Parameters = <>
|
||||
Left = 829
|
||||
Top = 17
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 949
|
||||
Top = 225
|
||||
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 = 864
|
||||
Top = 224
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
Left = 928
|
||||
Top = 216
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 888
|
||||
Top = 224
|
||||
end
|
||||
object DS_HZ: TDataSource
|
||||
DataSet = CDS_HZ
|
||||
Left = 915
|
||||
Top = 163
|
||||
end
|
||||
object CDS_HZ: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 712
|
||||
Top = 192
|
||||
end
|
||||
object CDS_LXR: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 448
|
||||
Top = 428
|
||||
end
|
||||
object DSLXR: TDataSource
|
||||
DataSet = CDS_LXR
|
||||
Left = 483
|
||||
Top = 419
|
||||
end
|
||||
end
|
||||
242
客户供应商管理(Company.dll)/U_Factory.pas
Normal file
242
客户供应商管理(Company.dll)/U_Factory.pas
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
unit U_Factory;
|
||||
|
||||
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, cxDBLookupComboBox;
|
||||
|
||||
type
|
||||
TfrmFactory = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
Panel1: TPanel;
|
||||
ToolButton2: TToolButton;
|
||||
ADOQueryMain: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
Label3: TLabel;
|
||||
CoName: TEdit;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
DS_HZ: TDataSource;
|
||||
CDS_HZ: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
v2Column6: TcxGridDBColumn;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
v2Column2: TcxGridDBColumn;
|
||||
v2Column7: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
CoCode: TEdit;
|
||||
ToolButton4: TToolButton;
|
||||
v2DEFStr7: TcxGridDBColumn;
|
||||
v2Column12: TcxGridDBColumn;
|
||||
Coarea: TEdit;
|
||||
Label4: TLabel;
|
||||
v2Column15: TcxGridDBColumn;
|
||||
CDS_LXR: TClientDataSet;
|
||||
DSLXR: TDataSource;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v3Column3: TcxGridDBColumn;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
Tv1Column1: TcxGridDBColumn;
|
||||
v3Column2: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
v2Column3: TcxGridDBColumn;
|
||||
FactType: TComboBox;
|
||||
Label5: TLabel;
|
||||
v2Column4: 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 TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure CoNameChange(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure TBuserClick(Sender: TObject);
|
||||
procedure Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
private
|
||||
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
frmFactory: TfrmFactory;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun,U_ZDYHelp,U_FactoryInput;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
|
||||
procedure TfrmFactory.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company where CoType=''供应商'' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
||||
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmFactory.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFactory:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(trim(self.caption),Tv2,'供应商管理');
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmFactory.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_HZ.fieldbyname('COID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update Company set Valid=''N'' where COID='''+Trim(CDS_HZ.fieldbyname('COID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
CDS_HZ.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid(trim(self.Caption),Tv2,'供应商管理管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.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 TfrmFactory.CoNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmFactory.ToolButton4Click(Sender: TObject);
|
||||
begin
|
||||
IF CDS_HZ.IsEmpty then exit;
|
||||
try
|
||||
frmFactoryInput:=TfrmFactoryInput.Create(Application);
|
||||
with frmFactoryInput do
|
||||
begin
|
||||
FCOID:=Trim(Self.CDS_HZ.fieldbyname('COID').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmFactoryInput.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmFactoryInput:=TfrmFactoryInput.Create(Application);
|
||||
with frmFactoryInput do
|
||||
begin
|
||||
FCOID:='';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmFactoryInput.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.TBuserClick(Sender: TObject);
|
||||
var
|
||||
FuserName:string;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFactory.Tv2FocusedRecordChanged(
|
||||
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||
AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company_contact where COID='+quotedstr(Trim(CDS_HZ.FieldByName('COID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_LXR);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_LXR);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
367
客户供应商管理(Company.dll)/U_FactoryInput.dfm
Normal file
367
客户供应商管理(Company.dll)/U_FactoryInput.dfm
Normal file
|
|
@ -0,0 +1,367 @@
|
|||
object frmFactoryInput: TfrmFactoryInput
|
||||
Left = 261
|
||||
Top = 149
|
||||
Width = 1123
|
||||
Height = 574
|
||||
Caption = #20379#24212#21830#36164#26009#24405#20837
|
||||
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 = 1107
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Company.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Company.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object ToolButton3: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 193
|
||||
Width = 1107
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 119
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Company.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Company.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #35774#20026#40664#35748#32852#31995#20154
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 123
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 186
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 224
|
||||
Width = 1107
|
||||
Height = 312
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSLXR
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Header = DataLink_Company.Default
|
||||
object v3Column3: TcxGridDBColumn
|
||||
Caption = #40664#35748
|
||||
DataBinding.FieldName = 'IsDefault'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'Contacts'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'position'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'Fax'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'Telephone'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #25163#26426
|
||||
DataBinding.FieldName = 'PhoneNumber'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object Tv1Column1: TcxGridDBColumn
|
||||
Caption = #37038#31665
|
||||
DataBinding.FieldName = 'Email'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v3Column2: TcxGridDBColumn
|
||||
Caption = #24494#20449
|
||||
DataBinding.FieldName = 'WeChat'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1107
|
||||
Height = 162
|
||||
Align = alTop
|
||||
BevelInner = bvNone
|
||||
BevelOuter = bvNone
|
||||
Ctl3D = False
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentCtl3D = False
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 29
|
||||
Top = 35
|
||||
Width = 70
|
||||
Height = 14
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 288
|
||||
Top = 35
|
||||
Width = 70
|
||||
Height = 14
|
||||
Caption = #20379#24212#21830#21517#31216
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 42
|
||||
Top = 61
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #22320' '#21306
|
||||
end
|
||||
object Label39: TLabel
|
||||
Left = 304
|
||||
Top = 61
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #20844#21496#22320#22336
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 42
|
||||
Top = 94
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #22791' '#27880
|
||||
end
|
||||
object Label19: TLabel
|
||||
Left = 548
|
||||
Top = 61
|
||||
Width = 56
|
||||
Height = 14
|
||||
Caption = #31867' '#22411
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 533
|
||||
Top = 35
|
||||
Width = 70
|
||||
Height = 14
|
||||
Caption = #20379#24212#21830#31616#31216
|
||||
end
|
||||
object CoName: TEdit
|
||||
Tag = 2
|
||||
Left = 367
|
||||
Top = 32
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 1
|
||||
end
|
||||
object CoAddress: TEdit
|
||||
Tag = 2
|
||||
Left = 368
|
||||
Top = 58
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 5
|
||||
end
|
||||
object Note: TMemo
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 91
|
||||
Width = 877
|
||||
Height = 57
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 6
|
||||
end
|
||||
object CoHRName: TEdit
|
||||
Tag = 2
|
||||
Left = 612
|
||||
Top = 32
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 2
|
||||
end
|
||||
object CoCode: TEdit
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 32
|
||||
Width = 140
|
||||
Height = 20
|
||||
Enabled = False
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 0
|
||||
end
|
||||
object Coarea: TEdit
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 58
|
||||
Width = 140
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 4
|
||||
end
|
||||
object FactType: TComboBox
|
||||
Tag = 2
|
||||
Left = 613
|
||||
Top = 57
|
||||
Width = 140
|
||||
Height = 22
|
||||
Style = csDropDownList
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
ItemHeight = 14
|
||||
TabOrder = 3
|
||||
Items.Strings = (
|
||||
#21407#26009#20379#24212#21830
|
||||
#32455#36896#21152#24037#21450#22383#24067
|
||||
#21360#26579#21152#24037#21378
|
||||
#21518#22788#29702#21152#24037#21378)
|
||||
end
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 419
|
||||
Top = 264
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
Parameters = <>
|
||||
Left = 462
|
||||
Top = 264
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Company.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 525
|
||||
Top = 281
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 382
|
||||
Top = 382
|
||||
end
|
||||
object CDS_LXR: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 425
|
||||
Top = 383
|
||||
end
|
||||
object DSLXR: TDataSource
|
||||
DataSet = CDS_LXR
|
||||
Left = 472
|
||||
Top = 383
|
||||
end
|
||||
end
|
||||
385
客户供应商管理(Company.dll)/U_FactoryInput.pas
Normal file
385
客户供应商管理(Company.dll)/U_FactoryInput.pas
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
unit U_FactoryInput;
|
||||
|
||||
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, cxDropDownEdit, BtnEdit;
|
||||
|
||||
type
|
||||
TfrmFactoryInput = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
ToolButton3: TToolButton;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
CDS_LXR: TClientDataSet;
|
||||
DSLXR: TDataSource;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
Tv1Column1: TcxGridDBColumn;
|
||||
v3Column2: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
v3Column3: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
ScrollBox1: TScrollBox;
|
||||
Label2: TLabel;
|
||||
Label6: TLabel;
|
||||
Label12: TLabel;
|
||||
Label39: TLabel;
|
||||
Label7: TLabel;
|
||||
Label19: TLabel;
|
||||
CoName: TEdit;
|
||||
CoAddress: TEdit;
|
||||
Note: TMemo;
|
||||
Label1: TLabel;
|
||||
CoHRName: TEdit;
|
||||
CoCode: TEdit;
|
||||
Coarea: TEdit;
|
||||
FactType: TComboBox;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
function SaveData():Boolean;
|
||||
|
||||
public
|
||||
fkhType:string;
|
||||
{ Public declarations }
|
||||
FCOID:String;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
frmFactoryInput: TfrmFactoryInput;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
procedure TfrmFactoryInput.InitGrid();
|
||||
begin
|
||||
try
|
||||
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company where CoType=''供应商'' and COID='''+Trim(FCOID)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCSHData(ADOQueryMain,ScrollBox1,2);
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from Company_contact where COID='+quotedstr(Trim(FCOID)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_LXR);
|
||||
SInitCDSData20(ADOQueryMain,CDS_LXR);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmFactoryInput.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFactoryInput:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFactoryInput.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFactoryInput.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(trim(self.Caption),Tv1,'供应商管理');
|
||||
ModalResult:=1;
|
||||
end;
|
||||
procedure TfrmFactoryInput.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid(trim(self.Caption),Tv1,'供应商管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFactoryInput.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
function TfrmFactoryInput.SaveData():Boolean;
|
||||
var
|
||||
MaxId,MaxSubId,FCoCode,FCCID:String;
|
||||
begin
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if Trim(FCOID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'CO','Company',4,1)=False then
|
||||
begin
|
||||
Result:=False;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if GetLSNo(ADOQueryCmd,FCoCode,'KH','Company',4,0)=False then
|
||||
begin
|
||||
Result:=False;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
CoCode.Text:=trim(FCoCode);
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxId:=Trim(FCOID);
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from Company where COID='''+Trim(FCOID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FCOID)='' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value:=Trim(DName);
|
||||
FieldByName('Edittime').Value:=SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('COID').Value:=Trim(maxId);
|
||||
SSetsaveSqlNew(ADOQueryCmd,'Company',ScrollBox1,2);
|
||||
FieldByName('CoType').Value:='供应商';
|
||||
Post;
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Company where CoName='+quotedstr(trim(CoName.Text)));
|
||||
sql.Add(' and CoType=''供应商'' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryCmd.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('供应商名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Company where CoCode='+quotedstr(trim(CoCode.Text)));
|
||||
sql.Add(' and CoType=''供应商'' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryCmd.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('供应商编号重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
IF not CDS_LXR.IsEmpty then
|
||||
begin
|
||||
with CDS_LXR do
|
||||
begin
|
||||
CDS_LXR.First;
|
||||
while not Eof do
|
||||
begin
|
||||
FCCID:=Trim(CDS_LXR.fieldbyname('CCID').AsString);
|
||||
if Trim(FCCID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,MaxSubId,'CCS','Company_contact',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取系人最大ID失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxSubId:=trim(FCCID);
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Company_contact where CCID='+quotedstr(Trim(MaxSubId)));
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FCCID)='' then
|
||||
begin
|
||||
Append;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('CCID').Value:=Trim(MaxSubId);
|
||||
FieldByName('COID').Value:=Trim(maxId);
|
||||
RTSetSaveDataCDS(ADOQueryCmd,Tv1,CDS_LXR,'Company_contact',0);
|
||||
Post;
|
||||
end;
|
||||
with CDS_LXR do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('CCID').Value:=Trim(MaxSubId);
|
||||
Post;
|
||||
end;
|
||||
CDS_LXR.Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
FCCID:=Trim(MaxSubId);
|
||||
Result:=True;
|
||||
except
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFactoryInput.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
|
||||
if Trim(CoName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('供应商名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if SaveData() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmFactoryInput.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'CC','Company_contact',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取系人最大ID失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if CDS_LXR.IsEmpty then
|
||||
begin
|
||||
with CDS_LXR do
|
||||
begin
|
||||
Append;
|
||||
fieldbyname('CCID').Value:=trim(maxno);
|
||||
fieldbyname('IsDefault').Value:=true;
|
||||
Post;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
with CDS_LXR do
|
||||
begin
|
||||
Append;
|
||||
fieldbyname('CCID').Value:=trim(maxno);
|
||||
fieldbyname('IsDefault').Value:=false;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFactoryInput.ToolButton5Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_LXR.IsEmpty then Exit;
|
||||
if Trim(CDS_LXR.fieldbyname('ASID').AsString)<>'' then
|
||||
begin
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from Company_contact where CCID='''+Trim(CDS_LXR.fieldbyname('CCID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
CDS_LXR.Delete;
|
||||
if CDS_LXR.IsEmpty=false then
|
||||
begin
|
||||
if CDS_LXR.Locate('IsDefault',true,[])=false then
|
||||
begin
|
||||
CDS_LXR.first;
|
||||
CDS_LXR.edit;
|
||||
CDS_LXR.FieldByName('IsDefault').value:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFactoryInput.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
DwFlag:string;
|
||||
begin
|
||||
DwFlag:= trim(CDS_LXR.FieldByName('CCID').AsString);
|
||||
if CDS_LXR.Locate('IsDefault',true,[]) then
|
||||
begin
|
||||
CDS_LXR.edit;
|
||||
CDS_LXR.FieldByName('IsDefault').value:=false;
|
||||
end;
|
||||
if CDS_LXR.Locate('CCID',DwFlag,[]) then
|
||||
begin
|
||||
CDS_LXR.edit;
|
||||
CDS_LXR.FieldByName('IsDefault').value:=true;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
188
客户供应商管理(Company.dll)/U_FileUp.dfm
Normal file
188
客户供应商管理(Company.dll)/U_FileUp.dfm
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
object frmFileUp: TfrmFileUp
|
||||
Left = 247
|
||||
Top = 162
|
||||
Width = 634
|
||||
Height = 447
|
||||
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 = 555
|
||||
Height = 367
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
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 = 555
|
||||
Top = 41
|
||||
Width = 63
|
||||
Height = 367
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_DDMD.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 = 618
|
||||
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 = 537
|
||||
Top = 17
|
||||
Width = 23
|
||||
Height = 16
|
||||
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_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
end
|
||||
357
客户供应商管理(Company.dll)/U_FileUp.pas
Normal file
357
客户供应商管理(Company.dll)/U_FileUp.pas
Normal file
|
|
@ -0,0 +1,357 @@
|
|||
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;
|
||||
|
||||
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();
|
||||
procedure ReadINIFile10();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp: TfrmFileUp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$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;
|
||||
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
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
AJpeg:=TJpegImage.Create();
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select Count(*) MM from XD_File where CYID='''+Trim(CYID)+'''');
|
||||
SQL.Add('and filetype=''YP''');
|
||||
Open;
|
||||
j:=fieldbyname('MM').AsInteger;
|
||||
end;
|
||||
Image2.Picture.LoadFromFile(ODPat.FileName);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
CreThumb(AJpeg,Image2,216, 187);
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
PatFile:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
FConNo:=Trim(Code.Text);
|
||||
while Pos('/',FConNo)>0 do
|
||||
begin
|
||||
Delete(FConNo,Pos('/',FConNo),1);
|
||||
end;
|
||||
PatFile:=Trim(FConNo)+'-'+Inttostr(j+i+1)+'.'+PatFile;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
{if not DirectoryExists('D:\图片\'+Trim(gDef1)) then
|
||||
ForceDirectories('D:\图片\'+Trim(gDef1)); }
|
||||
IdFTP1.Put(lstPat[i], Trim('\YP')+'\'+Trim(PatFile));
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID='''+Trim(CYID)+'''');
|
||||
SQL.Add(' and filename='''+Trim(PatFile)+'''');
|
||||
SQL.Add(' and filetype=''YP''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Panel16.Visible:=False;
|
||||
Application.MessageBox(PChar('文件<'+Trim(PatFile)+'>重复,'+inttostr(i)+'个文件上传成功!'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
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;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update CP_YDang Set TPFlag=1 where CYID='''+Trim(CYID)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
SaveImageOther();
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
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;
|
||||
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();
|
||||
var
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
ImgMaxNo:String;
|
||||
i,j: Integer;
|
||||
PatFile: String;
|
||||
FTPPath,FConNo,MaxNo,FTFID:string;
|
||||
begin
|
||||
if Image2.Picture=nil then Exit;
|
||||
AJpeg:=TJpegImage.Create();
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File where WBID='''+Trim(CYID)+'''');
|
||||
Open;
|
||||
end;
|
||||
FTFID:=Trim(ADOQueryTemp.fieldbyname('TFID').AsString);
|
||||
if Trim(FTFID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,ImgMaxNo,'TF','TP_File',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取图片表最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
ImgMaxNo:=Trim(FTFID);
|
||||
end;
|
||||
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(ImgMaxNo);
|
||||
FieldByName('WBID').Value:=Trim(CYID);
|
||||
//FieldByName('TFIdx').Value:=cxTabControl2.TabIndex;
|
||||
FieldByName('TFType').Value:='样品';
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
//CreThumb(AJpeg,Image1,160, 120);
|
||||
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 WBID='''+Trim(CYID)+''' and TFType=''样品'' ');
|
||||
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.
|
||||
253
客户供应商管理(Company.dll)/U_GetDllForm.pas
Normal file
253
客户供应商管理(Company.dll)/U_GetDllForm.pas
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
|
||||
|
||||
unit U_GetDllForm;
|
||||
interface
|
||||
uses
|
||||
Windows,Messages,forms,OleCtnrs,DateUtils,SysUtils,ADODB;
|
||||
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_Customer,U_Factory;
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// 功能说明:取Dll中得窗体 //
|
||||
// 参数说明:App>>调用应用程序; //
|
||||
// FormH>>调用窗口句柄 ; //
|
||||
// FormID>>窗口号; //
|
||||
// Language>>语言种类; //
|
||||
// WinStyle>>窗口类型; //
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
var
|
||||
frmCustomerYW,frmCustomerGQX:TfrmCustomer;
|
||||
|
||||
|
||||
|
||||
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
|
||||
i: Integer;
|
||||
bFound:Boolean;
|
||||
mnewHandle: hwnd;
|
||||
mstyle: TFormStyle; // 0:子窗口; 1:普通窗口
|
||||
mstate: TWindowState;
|
||||
mborderstyle: TFormBorderStyle;
|
||||
begin
|
||||
mNewHandle:=0;
|
||||
DName:=PChar(GName);
|
||||
DCode:=PChar(GCode);
|
||||
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:='124.91.217.13,7781';
|
||||
server:='.';
|
||||
dtbase:='chengxiedata';
|
||||
user:='sa';
|
||||
// pswd:='rightsoft@123';
|
||||
pswd:='rightsoft';
|
||||
DConString := 'Provider=SQLOLEDB.1;Password='+pswd+';Persist Security Info=True;User ID='
|
||||
+user+';Initial Catalog='+dtbase+';Data Source='+server;
|
||||
// DConString:=DataBaseStr;
|
||||
// DName:='周高祥';
|
||||
// DParameters1:='业务员';
|
||||
// DParameters1:='管理员';
|
||||
//DParameters1:='高权限';
|
||||
//DParameters3:='1';
|
||||
if not ConnData() then
|
||||
begin
|
||||
result:=0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
// 定义窗口类型 、状态
|
||||
if WinStyle=0 then
|
||||
begin
|
||||
mstyle := fsMDIChild ;
|
||||
mstate := wsMaximized ;
|
||||
mborderstyle := bsSizeable;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mstyle := fsNormal ;
|
||||
mstate := wsNormal ;
|
||||
mborderstyle := bsSizeable;
|
||||
end;
|
||||
/////////////////////
|
||||
//调用子模块窗口
|
||||
case FormId of
|
||||
111: //客户登记(业务员)
|
||||
begin
|
||||
bFound := FALSE;
|
||||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||||
begin
|
||||
if App.MainForm.MDIChildren[i].Caption = '客户登记(业务员)' then
|
||||
begin
|
||||
BringWindowToTop(frmCustomerYW.Handle);
|
||||
bFound := TRUE;
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
if not bFound then
|
||||
begin
|
||||
frmCustomerYW:= TfrmCustomer.Create(application.MainForm);
|
||||
with frmCustomerYW do
|
||||
begin
|
||||
Title:='客户登记(业务员)';
|
||||
caption:=Trim(Title);
|
||||
FormStyle := mstyle ;
|
||||
windowState := mstate ;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmCustomerYW.BringToFront;
|
||||
//句柄
|
||||
mNewHandle:=frmCustomerYW.Handle;
|
||||
end ;
|
||||
|
||||
112: //客户(高权限)
|
||||
begin
|
||||
bFound := FALSE;
|
||||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||||
begin
|
||||
if App.MainForm.MDIChildren[i].Caption = '客户登记(管理员)' then
|
||||
begin
|
||||
BringWindowToTop(frmCustomerGQX.Handle);
|
||||
bFound := TRUE;
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
if not bFound then
|
||||
begin
|
||||
frmCustomerGQX:= TfrmCustomer.Create(application.MainForm);
|
||||
with frmCustomerGQX do
|
||||
begin
|
||||
Title:='客户登记(管理员)';
|
||||
caption:=Trim(Title);
|
||||
FormStyle := mstyle ;
|
||||
windowState := mstate ;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmCustomerGQX.BringToFront;
|
||||
//句柄
|
||||
mNewHandle:=frmCustomerGQX.Handle;
|
||||
end ;
|
||||
// 111: //客户资料
|
||||
// begin
|
||||
// if frmCustomer=nil then
|
||||
// begin
|
||||
// frmCustomer:= TfrmCustomer.Create(application.MainForm);
|
||||
// with frmCustomer do
|
||||
// begin
|
||||
// caption:=Trim(Title);
|
||||
// FormStyle := mstyle ;
|
||||
// windowState := mstate ;
|
||||
// BorderStyle := mborderstyle;
|
||||
// //show;
|
||||
// end;
|
||||
// end
|
||||
// else
|
||||
// frmCustomer.BringToFront;
|
||||
// //句柄
|
||||
// mNewHandle:=frmCustomer.Handle;
|
||||
// end ;
|
||||
211: //供应商
|
||||
begin
|
||||
if frmFactory=nil then
|
||||
begin
|
||||
frmFactory:= TfrmFactory.Create(application.MainForm);
|
||||
with frmFactory do
|
||||
begin
|
||||
caption:=Trim(Title);
|
||||
FormStyle := mstyle ;
|
||||
windowState := mstate ;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmFactory.BringToFront;
|
||||
//句柄
|
||||
mNewHandle:=frmFactory.Handle;
|
||||
end ;
|
||||
end ;
|
||||
|
||||
Result:= mnewHandle;
|
||||
NewDllApp:=Application ;
|
||||
end;
|
||||
//===========================================================
|
||||
//建立数据库连接池
|
||||
//===========================================================
|
||||
function ConnData():Boolean;
|
||||
begin
|
||||
if not Assigned(DataLink_Company) then
|
||||
DataLink_Company:=TDataLink_Company.Create(Application);
|
||||
Try
|
||||
with DataLink_Company.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
|
||||
OldDllApp:= Application;
|
||||
|
||||
FINALIZATION
|
||||
DataLink_Company.Free;
|
||||
Application := OldDllApp;
|
||||
|
||||
end.
|
||||
|
||||
313
客户供应商管理(Company.dll)/U_LabelAdd.dfm
Normal file
313
客户供应商管理(Company.dll)/U_LabelAdd.dfm
Normal file
|
|
@ -0,0 +1,313 @@
|
|||
object frmLabelAdd: TfrmLabelAdd
|
||||
Left = 191
|
||||
Top = 109
|
||||
Width = 997
|
||||
Height = 612
|
||||
BorderIcons = [biMaximize]
|
||||
Caption = #26631#31614#32534#36753
|
||||
Color = clBtnFace
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 28
|
||||
Width = 413
|
||||
Height = 513
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 0
|
||||
object Label2: TLabel
|
||||
Left = 31
|
||||
Top = 21
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #26631#31614#25991#20214#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 31
|
||||
Top = 95
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #22791' '#27880#65306
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 31
|
||||
Top = 71
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #26631#31614#21517#31216#65306
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 31
|
||||
Top = 47
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #26631#31614#31867#22411#65306
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object LabelFileName: TBtnEditA
|
||||
Left = 92
|
||||
Top = 17
|
||||
Width = 260
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
OnBtnClick = LabelFileNameBtnClick
|
||||
end
|
||||
object beizhu: TMemo
|
||||
Left = 92
|
||||
Top = 92
|
||||
Width = 257
|
||||
Height = 149
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 1
|
||||
end
|
||||
object LabelCaption: TEdit
|
||||
Left = 92
|
||||
Top = 67
|
||||
Width = 258
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 2
|
||||
end
|
||||
object LabelType: TFTComboBox
|
||||
Tag = 99
|
||||
Left = 92
|
||||
Top = 43
|
||||
Width = 260
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
ItemIndex = 0
|
||||
TabOrder = 3
|
||||
Text = #20013#25991#26631#31614
|
||||
Items.Strings = (
|
||||
#20013#25991#26631#31614
|
||||
#33521#25991#26631#31614
|
||||
#20013#33521#25991#26631#31614)
|
||||
end
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 981
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar2'
|
||||
Color = clBtnFace
|
||||
Flat = True
|
||||
Images = DataLink_CYZZ.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
Transparent = False
|
||||
object Tsave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#26631#31614
|
||||
ImageIndex = 5
|
||||
OnClick = TsaveClick
|
||||
end
|
||||
object Tclose: TToolButton
|
||||
Left = 87
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TcloseClick
|
||||
end
|
||||
end
|
||||
object RMPreview1: TRMPreview
|
||||
Left = 428
|
||||
Top = 32
|
||||
Width = 553
|
||||
Height = 541
|
||||
Align = alRight
|
||||
BevelOuter = bvLowered
|
||||
Caption = #26631#31614#39044#35272
|
||||
TabOrder = 2
|
||||
OnDblClick = RMPreview1DblClick
|
||||
Options.RulerUnit = rmutScreenPixels
|
||||
Options.RulerVisible = False
|
||||
Options.DrawBorder = False
|
||||
Options.BorderPen.Color = clGray
|
||||
Options.BorderPen.Style = psDash
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
CommandTimeout = 300
|
||||
Parameters = <>
|
||||
Left = 512
|
||||
Top = 208
|
||||
end
|
||||
object OpenDialog1: TOpenDialog
|
||||
Filter = 'RMFl(*.rmf)|*.rmf'
|
||||
InitialDir = '.'
|
||||
Left = 200
|
||||
Top = 4
|
||||
end
|
||||
object RMGridReport1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
ShowProgress = False
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
Preview = RMPreview1
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 336
|
||||
Top = 8
|
||||
ReportData = {}
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
CommandTimeout = 300
|
||||
Parameters = <>
|
||||
Left = 528
|
||||
Top = 184
|
||||
end
|
||||
object RMGridReportDesigner1: TRMGridReportDesigner
|
||||
Left = 376
|
||||
Top = 8
|
||||
end
|
||||
object RMBarCodeObject1: TRMBarCodeObject
|
||||
Left = 280
|
||||
Top = 4
|
||||
end
|
||||
object RMBMPExport1: TRMBMPExport
|
||||
ScaleX = 1.000000000000000000
|
||||
ScaleY = 1.000000000000000000
|
||||
Left = 408
|
||||
Top = 8
|
||||
end
|
||||
object RMXLSExport1: TRMXLSExport
|
||||
ShowAfterExport = True
|
||||
ExportPrecision = 1
|
||||
PagesOfSheet = 10
|
||||
ExportImages = True
|
||||
ExportFrames = True
|
||||
ExportImageFormat = ifBMP
|
||||
JPEGQuality = 0
|
||||
ScaleX = 1.000000000000000000
|
||||
ScaleY = 1.000000000000000000
|
||||
CompressFile = False
|
||||
Left = 440
|
||||
Top = 8
|
||||
end
|
||||
object RMDS_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
AliasName = #26631#31614#25968#25454
|
||||
Left = 498
|
||||
Top = 72
|
||||
end
|
||||
object RMDataDictionary1: TRMDataDictionary
|
||||
FieldFieldNames.TableName = 'TableName'
|
||||
FieldFieldNames.FieldName = 'FieldName'
|
||||
FieldFieldNames.FieldAlias = 'FieldAlias'
|
||||
Left = 562
|
||||
Top = 72
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
Parameters = <>
|
||||
Left = 352
|
||||
Top = 480
|
||||
end
|
||||
object RMGridReport2: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
ShowProgress = False
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
Dataset = RMDS_Main
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 432
|
||||
Top = 368
|
||||
ReportData = {}
|
||||
end
|
||||
object ADOQueryCmdSC: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
Parameters = <>
|
||||
Left = 296
|
||||
Top = 304
|
||||
object ADOQueryCmdFileContent: TBlobField
|
||||
FieldName = 'Files'
|
||||
end
|
||||
object ADOQueryCmdFtFileName: TStringField
|
||||
FieldName = 'FileName'
|
||||
Size = 40
|
||||
end
|
||||
object ADOQueryCmdFileEditDate: TDateTimeField
|
||||
FieldName = 'FileEditDate'
|
||||
end
|
||||
object ADOQueryCmdFileSize: TFloatField
|
||||
FieldName = 'FileSize'
|
||||
end
|
||||
object ADOQueryCmdFiller: TStringField
|
||||
FieldName = 'Filler'
|
||||
end
|
||||
object ADOQueryCmdLastEditTime: TDateTimeField
|
||||
FieldName = 'LastEditTime'
|
||||
end
|
||||
object ADOQueryCmdLastEditer: TStringField
|
||||
FieldName = 'LastEditer'
|
||||
end
|
||||
object ADOQueryCmdFileCreateDate: TDateTimeField
|
||||
FieldName = 'FileCreateDate'
|
||||
end
|
||||
object ADOQueryCmdchildPath: TStringField
|
||||
FieldName = 'FilePath'
|
||||
end
|
||||
object ADOQueryCmdFileType: TStringField
|
||||
FieldName = 'FileType'
|
||||
end
|
||||
end
|
||||
end
|
||||
455
客户供应商管理(Company.dll)/U_LabelAdd.pas
Normal file
455
客户供应商管理(Company.dll)/U_LabelAdd.pas
Normal file
|
|
@ -0,0 +1,455 @@
|
|||
unit U_LabelAdd;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, BtnEdit, ExtCtrls, DB, ADODB,
|
||||
RM_System, RM_Common, RM_Class, RM_GridReport, Buttons, FTComboBox,
|
||||
RM_Preview, RM_e_Xls, RM_e_Graphic, RM_e_bmp, RM_BarCode,
|
||||
RM_DsgGridReport, RM_Dataset, cxStyles, cxCustomData, cxGraphics,
|
||||
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid;
|
||||
|
||||
type
|
||||
TfrmLabelAdd = class(TForm)
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
LabelFileName: TBtnEditA;
|
||||
beizhu: TMemo;
|
||||
ToolBar1: TToolBar;
|
||||
Tsave: TToolButton;
|
||||
Tclose: TToolButton;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
OpenDialog1: TOpenDialog;
|
||||
RMGridReport1: TRMGridReport;
|
||||
Label9: TLabel;
|
||||
LabelCaption: TEdit;
|
||||
Label10: TLabel;
|
||||
LabelType: TFTComboBox;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
RMPreview1: TRMPreview;
|
||||
RMGridReportDesigner1: TRMGridReportDesigner;
|
||||
RMBarCodeObject1: TRMBarCodeObject;
|
||||
RMBMPExport1: TRMBMPExport;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
RMDS_Main: TRMDBDataSet;
|
||||
RMDataDictionary1: TRMDataDictionary;
|
||||
ADOQuery1: TADOQuery;
|
||||
RMGridReport2: TRMGridReport;
|
||||
ADOQueryCmdSC: TADOQuery;
|
||||
ADOQueryCmdFileContent: TBlobField;
|
||||
ADOQueryCmdFtFileName: TStringField;
|
||||
ADOQueryCmdFileEditDate: TDateTimeField;
|
||||
ADOQueryCmdFileSize: TFloatField;
|
||||
ADOQueryCmdFiller: TStringField;
|
||||
ADOQueryCmdLastEditTime: TDateTimeField;
|
||||
ADOQueryCmdLastEditer: TStringField;
|
||||
ADOQueryCmdFileCreateDate: TDateTimeField;
|
||||
ADOQueryCmdchildPath: TStringField;
|
||||
ADOQueryCmdFileType: TStringField;
|
||||
procedure TcloseClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TsaveClick(Sender: TObject);
|
||||
procedure LabelFileNameBtnClick(Sender: TObject);
|
||||
procedure BtOpenClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure RMPreview1DblClick(Sender: TObject);
|
||||
private
|
||||
fIsChg:Boolean;
|
||||
function SaveData():Boolean;
|
||||
function EditData():Boolean;
|
||||
procedure InitWinData();
|
||||
procedure InitVarDictionary();
|
||||
procedure InitDataSetDictionary();
|
||||
function PostFileToData():boolean;
|
||||
procedure GetFileInfo(mFile:string;var mfileSize:integer;var CreationTime:tdatetime;var WriteTime:tdatetime);
|
||||
function CovFileDate(Fd:_FileTime):TDateTime;
|
||||
public
|
||||
fcustomNo:string;
|
||||
fKeyNo:string;
|
||||
fWinStatus:integer;
|
||||
end;
|
||||
|
||||
var
|
||||
frmLabelAdd: TfrmLabelAdd;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmLabelAdd.TcloseClick(Sender: TObject);
|
||||
begin
|
||||
if fIsChg then
|
||||
begin
|
||||
if application.MessageBox('标签设计过,是否要保存?','提示信息',1)=1 then
|
||||
begin
|
||||
Tsave.Click ;
|
||||
end
|
||||
else
|
||||
close;
|
||||
end
|
||||
else
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelAdd.FormCreate(Sender: TObject);
|
||||
begin
|
||||
panel1.Align :=alClient;
|
||||
fIsChg:=false;
|
||||
// ClearWinData(panel1);
|
||||
// InitVarDictionary();
|
||||
end;
|
||||
|
||||
procedure TfrmLabelAdd.TsaveClick(Sender: TObject);
|
||||
begin
|
||||
if trim(labelCaption.Text)='' then
|
||||
begin
|
||||
application.MessageBox('标签名称不能为空!','提示');
|
||||
labelCaption.SetFocus;
|
||||
exit;
|
||||
end;
|
||||
if trim(LabelFileName.Text)='' then
|
||||
begin
|
||||
application.MessageBox('标签文件不能为空,请选择标签!','提示');
|
||||
LabelFileName.SetFocus;
|
||||
exit;
|
||||
end;
|
||||
PostFileToData();
|
||||
if fWinStatus=0 then
|
||||
begin
|
||||
if SaveData() then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if EditData() then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
function TfrmLabelAdd.PostFileToData():boolean;
|
||||
var
|
||||
mFileName,fFileName,fpathFileName:string;
|
||||
Stream : TMemoryStream;
|
||||
mfileSize:integer;
|
||||
mCreationTime:TdateTime;
|
||||
mWriteTime:TdateTime;
|
||||
begin
|
||||
result:=false;
|
||||
fFileName:=Trim(LabelCaption.Text);
|
||||
fpathFileName:=Trim(LabelFileName.Text);
|
||||
try
|
||||
ADOQueryCmdSC.Connection.BeginTrans ;
|
||||
try
|
||||
with ADOQueryCmdSC do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('delete from RT_FileUpdate');
|
||||
sql.Add('where FileName='+quotedStr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
with ADOQueryCmdSC do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('select * from RT_FileUpdate');
|
||||
sql.Add('where FileName='+quotedStr(trim(fFileName)));
|
||||
Open;
|
||||
//////////////////////////
|
||||
//获取文件信息
|
||||
GetFileInfo(Trim(fpathFileName),mfileSize,mCreationTime,mWriteTime);
|
||||
|
||||
if RecordCount<=0 then
|
||||
begin
|
||||
Append;
|
||||
fieldByName('FileName').AsString := trim(fFileName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
edit;
|
||||
end;
|
||||
|
||||
fieldByName('FileEditDate').Value :=mWriteTime;
|
||||
fieldByName('FileCreateDate').Value :=mCreationTime;
|
||||
fieldByName('FileSize').Value :=mfileSize;
|
||||
fieldByName('Filler').Value :=Dname;
|
||||
fieldByName('LastEditer').Value :=Dname;
|
||||
fieldByName('LastEditTime').Value :=SGetServerDateTime(ADOQueryTmp);
|
||||
if pos('.rmf',fFileName)>0 then
|
||||
begin
|
||||
fieldByName('FilePath').Value :='report';
|
||||
fieldByName('FileType').Value :='公用';
|
||||
end
|
||||
else if pos('.dll',fFileName)>0 then
|
||||
begin
|
||||
fieldByName('FilePath').Value :='';
|
||||
fieldByName('FileType').Value :='一般';
|
||||
end
|
||||
else
|
||||
begin
|
||||
fieldByName('FilePath').Value :='';
|
||||
fieldByName('FileType').Value :='公用';
|
||||
end;
|
||||
//将OLE数据存入数据库
|
||||
ADOQueryCmdFileContent.LoadFromFile(fpathFileName);
|
||||
//ADOQueryCmdFileContent.LoadFromStream(Stream);
|
||||
|
||||
post;
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
result:=true;
|
||||
ADOQueryCmdSC.Connection.CommitTrans ;
|
||||
except
|
||||
ADOQueryCmdSC.Connection.RollbackTrans ;
|
||||
Result:=False;
|
||||
application.MessageBox(pchar('提交文件['+trim(fFileName)+']失败!'),'提示信息',MB_ICONERROR);
|
||||
end;
|
||||
|
||||
end;
|
||||
procedure TfrmLabelAdd.GetFileInfo(mFile:string;var mfileSize:integer;var CreationTime:tdatetime;var WriteTime:tdatetime);
|
||||
var
|
||||
vSearchRec: TSearchRec;
|
||||
begin
|
||||
FindFirst(mFile,faAnyFile,vSearchRec);
|
||||
mfileSize:=vSearchRec.Size;
|
||||
CreationTime:=CovFileDate(vSearchRec.FindData.ftCreationTime);//创建时间
|
||||
//vSearchRec.FindData.ftLastAccessTime//访问时间
|
||||
WriteTime:=CovFileDate(vSearchRec.FindData.ftLastWriteTime);//修改时间
|
||||
FindClose(vSearchRec);
|
||||
end;
|
||||
function TfrmLabelAdd.CovFileDate(Fd:_FileTime):TDateTime;
|
||||
var
|
||||
Tct:_SystemTime;
|
||||
Temp:_FileTime;
|
||||
begin
|
||||
FileTimeToLocalFileTime(Fd,Temp);
|
||||
FileTimeToSystemTime(Temp,Tct);
|
||||
CovFileDate:=SystemTimeToDateTime(Tct);
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//函数功能:保存数据
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function TfrmLabelAdd.SaveData():Boolean;
|
||||
begin
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from P_Label');
|
||||
sql.Add('where 1<>1');
|
||||
Open;
|
||||
|
||||
Append;
|
||||
fieldByName('filler').value:=DName;
|
||||
fieldByName('filltime').value:=DServerDate;
|
||||
fieldByName('beizhu').value:= trim(beizhu.text);
|
||||
fieldByName('LabelCaption').value:=trim(LabelCaption.text);
|
||||
fieldByName('LabelType').value:=trim(LabelType.text);
|
||||
fieldByName('LabelFileName').value:= trim(LabelFileName.text);
|
||||
//TBlobField(FieldByName('LabelFile')).LoadFromStream(fStream);
|
||||
RMGridReport1.SaveToBlobField(TBlobField(FieldByName('LabelFile')));
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from P_Label where LabelCaption='''+Trim(LabelCaption.text)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTmp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('标签名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result:=true;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=false;
|
||||
application.MessageBox('保存标签模板出错!','警告信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//函数功能:保存数据
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function TfrmLabelAdd.EditData():Boolean;
|
||||
begin
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from P_Label');
|
||||
sql.Add('where labelId='+fkeyNo);
|
||||
Open;
|
||||
Edit;
|
||||
fieldByName('LabelCaption').value:=trim(LabelCaption.text);
|
||||
fieldByName('LabelType').value:=trim(LabelType.text);
|
||||
fieldByName('LabelFileName').value:= trim(LabelFileName.text);
|
||||
RMGridReport1.SaveToBlobField(TBlobField(FieldByName('LabelFile')));
|
||||
fieldByName('Editer').value:=DName;
|
||||
fieldByName('EditTime').value:=DServerDate;
|
||||
fieldByName('beizhu').value:= trim(beizhu.text);
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from P_Label where LabelCaption='''+Trim(LabelCaption.text)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTmp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('标签名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result:=true;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=false;
|
||||
application.MessageBox('保存标签模板出错!','警告信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelAdd.LabelFileNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
if OpenDialog1.Execute() then
|
||||
begin
|
||||
LabelFileName.Text:=OpenDialog1.FileName;
|
||||
LabelCaption.Text:=Trim(ExtractFileName(OpenDialog1.FileName));
|
||||
RMGridReport1.LoadFromFile(LabelFileName.Text);
|
||||
RMGridReport1.Preview :=RMPreview1;
|
||||
RMGridReport1.ShowReport ;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelAdd.BtOpenClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
|
||||
end;
|
||||
////////////////////////////////////////////////////////////
|
||||
//初始化窗口数据
|
||||
////////////////////////////////////////////////////////////
|
||||
procedure TfrmLabelAdd.InitWinData();
|
||||
begin
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('select A.*');
|
||||
// sql.Add('customNoName=isnull((select customName from BC_customer where customNO=A.customNo),A.customNo)');
|
||||
sql.Add('from P_Label A');
|
||||
sql.Add('WHERE LabelId='+fkeyNo);
|
||||
Open;
|
||||
if isEmpty then
|
||||
begin
|
||||
close;
|
||||
exit;
|
||||
end;
|
||||
|
||||
SSetWinData(ADOQueryTmp,panel1);
|
||||
RMGridReport1.LoadFromBlobField(tblobfield(fieldbyname('labelFile')));
|
||||
RMGridReport2.FileName:=trim(fieldByName('labelFileName').AsString);
|
||||
RMGridReport2.LoadFromBlobField(tblobfield(fieldbyname('labelFile')));
|
||||
RMGridReport1.Preview :=RMPreview1;
|
||||
//RMGridReport1.PrepareReport;
|
||||
RMGridReport1.ShowReport ;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelAdd.FormShow(Sender: TObject);
|
||||
begin
|
||||
if fWinStatus>0 then
|
||||
InitWinData();
|
||||
end;
|
||||
|
||||
procedure TfrmLabelAdd.RMPreview1DblClick(Sender: TObject);
|
||||
begin
|
||||
//btOpen.Click ;
|
||||
end;
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
procedure TfrmLabelAdd.InitVarDictionary();
|
||||
var
|
||||
i:integer;
|
||||
begin
|
||||
{ try
|
||||
with RMGridReport2 do
|
||||
begin
|
||||
Dictionary.Variables.Clear ;
|
||||
Dictionary.Variables.AddCategory('客户单位信息');
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.clear;
|
||||
sql.Add('exec P_Label_CustPrintData');
|
||||
sql.Add(quotedStr(fCustomNo));
|
||||
Open;
|
||||
for i:=0 to FieldCount-1 do
|
||||
begin
|
||||
|
||||
Dictionary.Variables.Add(trim(fields[i].FieldName)
|
||||
,'');
|
||||
Dictionary.Variables.AsString[trim(fields[i].FieldName)]:=trim(fields[i].AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
|
||||
end; }
|
||||
end;
|
||||
/////////////////////////////////////////////////
|
||||
//
|
||||
/////////////////////////////////////////////////
|
||||
procedure TfrmLabelAdd.InitDataSetDictionary();
|
||||
begin
|
||||
{ with ADOQuery1 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('exec P_Label_PrintSet');
|
||||
sql.Add(quotedStr(''));
|
||||
//sql.Add(','+quotedStr(''));
|
||||
//sql.Add(','+quotedStr(''));
|
||||
//sql.Add(','+quotedStr(''));
|
||||
//sql.Add(','+quotedStr(''));
|
||||
OPen;
|
||||
end;
|
||||
with RMGridReport2 do
|
||||
begin
|
||||
Dictionary.FieldAliases.Clear;
|
||||
Dictionary.FieldAliases['RMDS_Main']:= '标签数据';
|
||||
Dictionary.FieldAliases['RMDS_Main."barcode"']:='标签条码';
|
||||
end; }
|
||||
end;
|
||||
|
||||
end.
|
||||
438
客户供应商管理(Company.dll)/U_LabelList.dfm
Normal file
438
客户供应商管理(Company.dll)/U_LabelList.dfm
Normal file
|
|
@ -0,0 +1,438 @@
|
|||
object frmLabelList: TfrmLabelList
|
||||
Left = 145
|
||||
Top = 10
|
||||
Width = 1057
|
||||
Height = 693
|
||||
BorderIcons = [biMaximize]
|
||||
Caption = #26631#31614#20449#24687
|
||||
Color = clBtnFace
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poOwnerFormCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Panel1: TPanel
|
||||
Left = 12
|
||||
Top = 80
|
||||
Width = 452
|
||||
Height = 561
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 0
|
||||
object Panel2: TPanel
|
||||
Left = 0
|
||||
Top = 3
|
||||
Width = 452
|
||||
Height = 558
|
||||
Align = alClient
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 0
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 448
|
||||
Height = 554
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object tv1: TcxGridDBTableView
|
||||
OnDblClick = tv1DblClick
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = tv1CellClick
|
||||
OnFocusedRecordChanged = tv1FocusedRecordChanged
|
||||
DataController.DataSource = DS_Label
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.GroupByBox = False
|
||||
object tv1labelId: TcxGridDBColumn
|
||||
Caption = #26631#31614'ID'
|
||||
DataBinding.FieldName = 'labelId'
|
||||
Visible = False
|
||||
Width = 53
|
||||
end
|
||||
object tv1labeltype: TcxGridDBColumn
|
||||
Caption = #26631#31614#31867#22411
|
||||
DataBinding.FieldName = 'labeltype'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderAlignmentVert = vaCenter
|
||||
Width = 107
|
||||
end
|
||||
object tv1labelCaption: TcxGridDBColumn
|
||||
Caption = #26631#31614#21517#31216
|
||||
DataBinding.FieldName = 'labelCaption'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderAlignmentVert = vaCenter
|
||||
Width = 261
|
||||
end
|
||||
object tv1labelFile: TcxGridDBColumn
|
||||
Caption = #25991#20214#21517
|
||||
DataBinding.FieldName = 'labelFile'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderAlignmentVert = vaCenter
|
||||
Width = 167
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = tv1
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 452
|
||||
Height = 3
|
||||
Align = alTop
|
||||
Caption = 'Panel3'
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
object Label1: TLabel
|
||||
Left = 40
|
||||
Top = 13
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #23458#25143#21517#31216#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 52
|
||||
Top = 35
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #19994#21153#21592#65306
|
||||
Visible = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 40
|
||||
Top = 61
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #30005#35805#21495#30721#65306
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 39
|
||||
Top = 86
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #20844#21496#21517#31216#65306
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 14
|
||||
Top = 108
|
||||
Width = 84
|
||||
Height = 12
|
||||
Caption = #20844#21496#33521#25991#21517#31216#65306
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 61
|
||||
Top = 133
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = #22320#22336#65306
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 37
|
||||
Top = 157
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #33521#25991#22320#22336#65306
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 61
|
||||
Top = 192
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = #22791#27880#65306
|
||||
end
|
||||
object Note: TMemo
|
||||
Left = 120
|
||||
Top = 175
|
||||
Width = 293
|
||||
Height = 63
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 0
|
||||
end
|
||||
object EngAddress: TEdit
|
||||
Left = 120
|
||||
Top = 151
|
||||
Width = 294
|
||||
Height = 20
|
||||
Enabled = False
|
||||
TabOrder = 1
|
||||
end
|
||||
object ChnAddress: TEdit
|
||||
Left = 120
|
||||
Top = 127
|
||||
Width = 293
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
end
|
||||
object engFactory: TEdit
|
||||
Left = 119
|
||||
Top = 104
|
||||
Width = 295
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
end
|
||||
object ChnFactory: TEdit
|
||||
Left = 119
|
||||
Top = 81
|
||||
Width = 294
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
end
|
||||
object TelePhone: TEdit
|
||||
Left = 119
|
||||
Top = 58
|
||||
Width = 294
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
end
|
||||
object ywy: TEdit
|
||||
Tag = 99
|
||||
Left = 119
|
||||
Top = 31
|
||||
Width = 295
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 6
|
||||
Text = 'ywy'
|
||||
Visible = False
|
||||
end
|
||||
object customNo: TBtnEditA
|
||||
Tag = 1
|
||||
Left = 120
|
||||
Top = 7
|
||||
Width = 295
|
||||
Height = 20
|
||||
Enabled = False
|
||||
ReadOnly = True
|
||||
TabOrder = 7
|
||||
OnBtnClick = customNoBtnClick
|
||||
end
|
||||
end
|
||||
end
|
||||
object RMPreview1: TRMPreview
|
||||
Left = 488
|
||||
Top = 85
|
||||
Width = 553
|
||||
Height = 569
|
||||
Align = alRight
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'Insert After'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
ParentShowHint = False
|
||||
ShowHint = False
|
||||
TabOrder = 1
|
||||
OnDblClick = RMPreview1DblClick
|
||||
Options.RulerUnit = rmutScreenPixels
|
||||
Options.RulerVisible = False
|
||||
Options.DrawBorder = False
|
||||
Options.BorderPen.Color = clGray
|
||||
Options.BorderPen.Style = psDash
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1041
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar2'
|
||||
Color = clBtnFace
|
||||
Flat = True
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
Transparent = False
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TOK: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #30830#23450
|
||||
ImageIndex = 10
|
||||
OnClick = TOkClick
|
||||
end
|
||||
object Tadd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686#26631#31614
|
||||
ImageIndex = 1
|
||||
OnClick = TaddClick
|
||||
end
|
||||
object Tupd: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913#26631#31614
|
||||
ImageIndex = 11
|
||||
OnClick = TupdClick
|
||||
end
|
||||
object Tdel: TToolButton
|
||||
Left = 300
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500#26631#31614
|
||||
ImageIndex = 3
|
||||
OnClick = TdelClick
|
||||
end
|
||||
object Tclose: TToolButton
|
||||
Left = 387
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TcloseClick
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1041
|
||||
Height = 53
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
object Label9: TLabel
|
||||
Left = 36
|
||||
Top = 20
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #26631#31614#31867#22411
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 280
|
||||
Top = 20
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #26631#31614#26631#39064
|
||||
end
|
||||
object LabelCaption: TEdit
|
||||
Left = 332
|
||||
Top = 16
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = LabelTypeChange
|
||||
end
|
||||
object LabelType: TFTComboBox
|
||||
Tag = 99
|
||||
Left = 88
|
||||
Top = 17
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
ItemIndex = 0
|
||||
TabOrder = 1
|
||||
OnChange = LabelTypeChange
|
||||
Items.Strings = (
|
||||
''
|
||||
#20013#25991#26631#31614
|
||||
#33521#25991#26631#31614
|
||||
#20013#33521#25991#26631#31614)
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
CommandTimeout = 300
|
||||
Parameters = <>
|
||||
Left = 508
|
||||
Top = 208
|
||||
end
|
||||
object OpenDialog1: TOpenDialog
|
||||
Filter = 'RMFl(*.rmf)|*.rmf'
|
||||
InitialDir = '.'
|
||||
Left = 316
|
||||
Top = 148
|
||||
end
|
||||
object RMGridReport1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
ModalPreview = False
|
||||
ShowProgress = False
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
Preview = RMPreview1
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 436
|
||||
Top = 152
|
||||
ReportData = {}
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
CommandTimeout = 300
|
||||
Parameters = <>
|
||||
Left = 528
|
||||
Top = 184
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 392
|
||||
Top = 228
|
||||
end
|
||||
object DS_Label: TDataSource
|
||||
DataSet = ADOQueryLabel
|
||||
Left = 66
|
||||
Top = 456
|
||||
end
|
||||
object ADOQueryLabel10: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
CommandTimeout = 300
|
||||
Parameters = <>
|
||||
Left = 234
|
||||
Top = 296
|
||||
end
|
||||
object ADOQueryLabel: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 156
|
||||
Top = 267
|
||||
end
|
||||
end
|
||||
591
客户供应商管理(Company.dll)/U_LabelList.pas
Normal file
591
客户供应商管理(Company.dll)/U_LabelList.pas
Normal file
|
|
@ -0,0 +1,591 @@
|
|||
unit U_LabelList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, StrUtils,Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, BtnEdit, ExtCtrls, DB, ADODB,
|
||||
RM_System, RM_Common, RM_Class, RM_GridReport, Buttons, FTComboBox,
|
||||
RM_Preview, RM_e_Xls, RM_e_Graphic, RM_e_bmp, RM_BarCode,
|
||||
RM_DsgGridReport, RM_Dataset, cxStyles, cxCustomData, cxGraphics,
|
||||
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, DBClient;
|
||||
|
||||
type
|
||||
TfrmLabelList = class(TForm)
|
||||
Panel1: TPanel;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
OpenDialog1: TOpenDialog;
|
||||
RMGridReport1: TRMGridReport;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
RMPreview1: TRMPreview;
|
||||
ADOQuery1: TADOQuery;
|
||||
Panel2: TPanel;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
tv1labeltype: TcxGridDBColumn;
|
||||
tv1labelCaption: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
tv1labelFile: TcxGridDBColumn;
|
||||
DS_Label: TDataSource;
|
||||
ADOQueryLabel10: TADOQuery;
|
||||
Panel3: TPanel;
|
||||
Note: TMemo;
|
||||
EngAddress: TEdit;
|
||||
ChnAddress: TEdit;
|
||||
engFactory: TEdit;
|
||||
ChnFactory: TEdit;
|
||||
TelePhone: TEdit;
|
||||
ywy: TEdit;
|
||||
customNo: TBtnEditA;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
Label3: TLabel;
|
||||
tv1labelId: TcxGridDBColumn;
|
||||
ToolBar2: TToolBar;
|
||||
Tadd: TToolButton;
|
||||
Tupd: TToolButton;
|
||||
Tdel: TToolButton;
|
||||
TOK: TToolButton;
|
||||
Tclose: TToolButton;
|
||||
Panel4: TPanel;
|
||||
ToolButton1: TToolButton;
|
||||
Label9: TLabel;
|
||||
Label10: TLabel;
|
||||
LabelCaption: TEdit;
|
||||
LabelType: TFTComboBox;
|
||||
ADOQueryLabel: TClientDataSet;
|
||||
procedure TcloseClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TsaveClick(Sender: TObject);
|
||||
procedure customNoBtnClick(Sender: TObject);
|
||||
procedure BtOpenClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure RMPreview1DblClick(Sender: TObject);
|
||||
procedure TaddClick(Sender: TObject);
|
||||
procedure TupdClick(Sender: TObject);
|
||||
procedure tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
procedure TdelClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure TOkClick(Sender: TObject);
|
||||
procedure tv1DblClick(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure LabelTypeChange(Sender: TObject);
|
||||
procedure tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
private
|
||||
isLoad:Boolean;
|
||||
function SaveData():Boolean;
|
||||
function EditData():Boolean;
|
||||
function IsCheckCustOk():Boolean;
|
||||
function DeleteData():Boolean;
|
||||
procedure InitWinData();
|
||||
procedure InitVarDictionary();
|
||||
procedure InitDataSetDictionary();
|
||||
procedure InitGrid();
|
||||
procedure OpenLabel();
|
||||
procedure SetWinStatus();
|
||||
procedure DoFilter();
|
||||
public
|
||||
fSelLabelId,LBName,LBInt,SLBName:String;
|
||||
fKeyNo:string;
|
||||
fchg:Boolean;
|
||||
fIsShowModal:Boolean;
|
||||
fWinStatus:integer;
|
||||
end;
|
||||
|
||||
var
|
||||
frmLabelList: TfrmLabelList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink, U_LabelAdd,U_RTFun;
|
||||
{$R *.dfm}
|
||||
procedure TfrmLabelList.DoFilter();
|
||||
var
|
||||
filterStr:string;
|
||||
begin
|
||||
filterStr:='';
|
||||
|
||||
if trim(LabelType.Text) <>'' then
|
||||
begin
|
||||
filterStr:=' and LabelType like '+quotedStr('%'+trim(LabelType.Text)+'%');
|
||||
end;
|
||||
//名称
|
||||
if trim(LabelCaption.Text)<>'' then
|
||||
begin
|
||||
filterStr:=filterStr+' and LabelCaption like '+quotedStr('%'+trim(LabelCaption.Text)+'%');
|
||||
end;
|
||||
try
|
||||
ADOQueryLabel10.DisableControls ;
|
||||
if trim(filterStr)='' then
|
||||
begin
|
||||
ADOQueryLabel.Filtered:=false;
|
||||
ADOQueryLabel.EnableControls;
|
||||
exit;
|
||||
end;
|
||||
filterStr:=trim(RightBStr(filterStr,length(filterStr)-4));
|
||||
with ADOQueryLabel do
|
||||
begin
|
||||
filtered:=false;
|
||||
filter:=filterStr;
|
||||
filtered:=true;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryLabel10,ADOQueryLabel);
|
||||
SInitCDSData20(ADOQueryLabel10,ADOQueryLabel);
|
||||
finally
|
||||
ADOQueryLabel10.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmLabelList.TcloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
panel1.Align :=alClient;
|
||||
// ClearWinData(panel3);
|
||||
fSelLabelId := '';
|
||||
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.TsaveClick(Sender: TObject);
|
||||
begin
|
||||
if trim(customNO.Text)='' then
|
||||
begin
|
||||
application.MessageBox('客户名称不能为空,请选择客户!','提示');
|
||||
customNo.SetFocus;
|
||||
exit;
|
||||
end;
|
||||
if application.MessageBox('确定要保存吗?','提示信息',1)=2 then exit;
|
||||
if fWinStatus=0 then
|
||||
begin
|
||||
if not IsCheckCustOk() then exit;
|
||||
if SaveData() then
|
||||
begin
|
||||
fWinStatus:=1;
|
||||
fchg:=true;
|
||||
SetWinStatus();
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if EditData() then
|
||||
begin
|
||||
fchg:=true;
|
||||
application.MessageBox('保存成功!','提示信息',0)
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//函数功能:保存数据
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function TfrmLabelList.SaveData():Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JD_Label');
|
||||
sql.Add('where 1<>1');
|
||||
Open;
|
||||
|
||||
Append;
|
||||
fieldByName('customno').value:=trim(customno.txtCode);
|
||||
fieldByName('ChnFactory').value:=trim(ChnFactory.text);
|
||||
fieldByName('engFactory').value:=trim(engFactory.text);
|
||||
fieldByName('TelePhone').value:=trim(TelePhone.text);
|
||||
fieldByName('ChnAddress').value:=trim(ChnAddress.text);
|
||||
fieldByName('EngAddress').value:=trim(EngAddress.text);
|
||||
fieldByName('filler').value:=Dname;
|
||||
fieldByName('filltime').value:=DServerDate;
|
||||
fieldByName('note').value:= trim(Note.text);
|
||||
Post;
|
||||
end;
|
||||
result:=true;
|
||||
except
|
||||
Result:=false;
|
||||
application.MessageBox('保存标签模板出错!','警告信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//函数功能:保存数据
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
function TfrmLabelList.EditData():Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JD_Label');
|
||||
sql.Add('where customNo='+fKeyNo);
|
||||
Open;
|
||||
|
||||
Edit;
|
||||
fieldByName('customno').value:=trim(customno.txtCode);
|
||||
fieldByName('ChnFactory').value:=trim(ChnFactory.text);
|
||||
fieldByName('engFactory').value:=trim(engFactory.text);
|
||||
fieldByName('TelePhone').value:=trim(TelePhone.text);
|
||||
fieldByName('ChnAddress').value:=trim(ChnAddress.text);
|
||||
fieldByName('EngAddress').value:=trim(EngAddress.text);
|
||||
fieldByName('note').value:= trim(Note.text);
|
||||
Post;
|
||||
end;
|
||||
result:=true;
|
||||
except
|
||||
Result:=false;
|
||||
application.MessageBox('保存标签模板出错!','警告信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.customNoBtnClick(Sender: TObject);
|
||||
begin
|
||||
{ FormGetCust:=TFormGetCust.Create(self);
|
||||
|
||||
if FormGetCust.ShowModal=mrok then
|
||||
begin
|
||||
customNo.TxtCode:=trim(FormGetCust.ADOQuery1.Fieldbyname('customno').AsString);
|
||||
customNo.Text:=trim(FormGetCust.ADOQuery1.Fieldbyname('shortname').AsString);
|
||||
end;
|
||||
FormGetCust.Free; }
|
||||
{ frmCustHelp:=TfrmCustHelp.create(self);
|
||||
with frmCustHelp do
|
||||
begin
|
||||
if showModal=1 then
|
||||
begin
|
||||
customNo.TxtCode:=trim(ADOQueryHelp.Fieldbyname('customno').AsString);
|
||||
customNo.Text:=trim(ADOQueryHelp.Fieldbyname('shortname').AsString);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.BtOpenClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
////////////////////////////////////////////////////////////
|
||||
//初始化窗口数据
|
||||
////////////////////////////////////////////////////////////
|
||||
procedure TfrmLabelList.InitWinData();
|
||||
begin
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('select A.* ,B.customName as customNoName');
|
||||
sql.Add('from JD_Label A');
|
||||
sql.Add('INNER JOIN BC_customer B ON A.customNO=B.customNo');
|
||||
sql.Add('WHERE B.customNo='''+fkeyNo+'''');
|
||||
Open;
|
||||
if isEmpty then
|
||||
begin
|
||||
close;
|
||||
exit;
|
||||
end;
|
||||
|
||||
// SetWinData(ADOQueryTmp,panel3);
|
||||
{
|
||||
RMGridReport1.LoadFromBlobField(tblobfield(fieldbyname('labelFile')));
|
||||
RMGridReport1.Preview :=RMPreview1;
|
||||
RMGridReport1.PrepareReport;
|
||||
RMGridReport1.ShowReport ;
|
||||
}
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.FormShow(Sender: TObject);
|
||||
begin
|
||||
if fWinStatus=1 then tok.Visible:=false;
|
||||
InitGrid();
|
||||
if Trim(SLBName)<>'' then
|
||||
begin
|
||||
ADOQueryLabel.Locate('labelCaption',SLBName,[]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.RMPreview1DblClick(Sender: TObject);
|
||||
begin
|
||||
//btOpen.Click ;
|
||||
end;
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
procedure TfrmLabelList.InitVarDictionary();
|
||||
var
|
||||
TmpList:Tstrings;
|
||||
mm:string;
|
||||
i:integer;
|
||||
begin
|
||||
try
|
||||
TmpList:=TstringList.Create();
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select distinct ItemType from JC_LabelSetItems ');
|
||||
sql.Add('where valid=''Y''');
|
||||
Open;
|
||||
TmpList.Clear ;
|
||||
while not Eof do
|
||||
begin
|
||||
TmpList.Add(trim(fieldByName('ItemType').AsString));
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
TmpList.Free ;
|
||||
end;
|
||||
end;
|
||||
/////////////////////////////////////////////////
|
||||
//
|
||||
/////////////////////////////////////////////////
|
||||
procedure TfrmLabelList.InitDataSetDictionary();
|
||||
begin
|
||||
{ with ADOQuery1 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('exec P_Get_LabelPrintData');
|
||||
sql.Add(quotedStr(''));
|
||||
sql.Add(','+quotedStr(''));
|
||||
sql.Add(','+quotedStr(''));
|
||||
OPen;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.TaddClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmLabelAdd:=TfrmLabelAdd.create(self);
|
||||
with frmLabelAdd do
|
||||
begin
|
||||
if showModal =1 then
|
||||
begin
|
||||
fchg:=true;
|
||||
InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmLabelAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.TupdClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryLabel.IsEmpty then exit;
|
||||
try
|
||||
frmLabelAdd:=TfrmLabelAdd.create(self);
|
||||
with frmLabelAdd do
|
||||
begin
|
||||
fKeyNo:=ADOQueryLabel.fieldByName('LabelId').AsString ;
|
||||
fWinstatus:=1;
|
||||
if showModal =1 then
|
||||
begin
|
||||
fchg:=true;
|
||||
InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmLabelAdd.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
/////////////////////////////////////////////
|
||||
//
|
||||
/////////////////////////////////////////////
|
||||
procedure TfrmLabelList.InitGrid();
|
||||
begin
|
||||
try
|
||||
isLoad:=false;
|
||||
ADOQueryLabel10.DisableControls ;
|
||||
with ADOQueryLabel10 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('select * from P_Label');
|
||||
sql.Add('where valid=''Y''');
|
||||
sql.Add(' order by labelCaption');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryLabel10,ADOQueryLabel);
|
||||
SInitCDSData20(ADOQueryLabel10,ADOQueryLabel);
|
||||
finally
|
||||
ADOQueryLabel10.EnableControls;
|
||||
isLoad:=true;
|
||||
//DoFilter();
|
||||
//OpenLabel();
|
||||
end;
|
||||
end;
|
||||
////////////////////////////////////////////////////////
|
||||
//函数功能:打开标签文件
|
||||
////////////////////////////////////////////////////////
|
||||
procedure TfrmLabelList.OpenLabel();
|
||||
begin
|
||||
if ADOQueryLabel.IsEmpty then exit;
|
||||
with RMGridReport1 do
|
||||
begin
|
||||
LoadFromBlobField(tblobfield(ADOQueryLabel.fieldbyname('labelFile')));
|
||||
//Preview :=RMPreview1;
|
||||
ShowReport ;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmLabelList.tv1FocusedRecordChanged(
|
||||
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||
AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
begin
|
||||
|
||||
end;
|
||||
//////////////////////////////////////////////////////////
|
||||
//函数功能:检查该客户的标签是否已存在
|
||||
/////////////////////////////////////////////////////////
|
||||
function TfrmLabelList.IsCheckCustOk():Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add('select count(customNO)as cnt from P_Label');
|
||||
sql.Add('where customNO='''+trim(customNO.TxtCode)+'''');
|
||||
Open;
|
||||
|
||||
if fieldByName('cnt').AsInteger>0 then
|
||||
begin
|
||||
Result:=false ;
|
||||
application.MessageBox('该客户标签信息已存!','警告信息',0);
|
||||
end
|
||||
else
|
||||
Result:=true;
|
||||
end;
|
||||
except
|
||||
result:=false;
|
||||
application.MessageBox('检查该客户标签信息是否已存在时发生错误!','警告信息',0);
|
||||
end;
|
||||
end;
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
function TfrmLabelList.DeleteData():Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.clear;
|
||||
sql.Add('delete P_Label');
|
||||
sql.Add('where labelId='+ADOQueryLabel.fieldByName('LabelID').asString);
|
||||
execSql;
|
||||
end;
|
||||
result:=true;
|
||||
except
|
||||
result:=false;
|
||||
application.MessageBox('删除失败!','警告信息',0);
|
||||
end;
|
||||
end;
|
||||
procedure TfrmLabelList.TdelClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryLabel.IsEmpty then exit;
|
||||
if application.MessageBox('确定要删除此标签吗?','警告信息',1)=2 then exit;
|
||||
if DeleteData() then
|
||||
begin
|
||||
fchg:=true;
|
||||
InitGrid();
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////
|
||||
//
|
||||
/////////////////////////////////////////////////////////
|
||||
procedure TfrmLabelList.SetWinStatus();
|
||||
begin
|
||||
case fWinStatus of
|
||||
0:
|
||||
begin
|
||||
// ToolBar2.Visible :=false;
|
||||
// tsave.Visible :=true;
|
||||
customNo.Enabled :=true;
|
||||
panel3.Enabled :=true;
|
||||
end;
|
||||
1:
|
||||
begin
|
||||
// ToolBar2.Visible :=true;
|
||||
// tsave.Visible :=false;
|
||||
customNo.Enabled :=false;
|
||||
panel3.Enabled :=false;
|
||||
TOK.Visible:=false;
|
||||
end;
|
||||
5:
|
||||
begin
|
||||
// ToolBar2.Visible :=false;
|
||||
// tsave.Visible :=false;
|
||||
panel1.Enabled :=false;
|
||||
panel3.Enabled :=false;
|
||||
end;
|
||||
end ;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
{if fIsShowModal then
|
||||
Application:=MainApplication ; }
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmLabelList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.TOkClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryLabel.IsEmpty then exit;
|
||||
LBName:=Trim(ADOQueryLabel.fieldbyname('labelCaption').AsString);
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.tv1DblClick(Sender: TObject);
|
||||
begin
|
||||
TOk.Click ;
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.LabelTypeChange(Sender: TObject);
|
||||
begin
|
||||
DoFilter();
|
||||
end;
|
||||
|
||||
procedure TfrmLabelList.tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if isLoad then
|
||||
OpenLabel();
|
||||
end;
|
||||
|
||||
end.
|
||||
181
客户供应商管理(Company.dll)/U_ModuleNote.dfm
Normal file
181
客户供应商管理(Company.dll)/U_ModuleNote.dfm
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
object frmModuleNote: TfrmModuleNote
|
||||
Left = 326
|
||||
Top = 178
|
||||
Width = 729
|
||||
Height = 528
|
||||
Align = alClient
|
||||
Caption = #25805#20316#35828#26126
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 73
|
||||
Width = 713
|
||||
Height = 416
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = TV1CellDblClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.GroupByBox = False
|
||||
object V1OrderNo: TcxGridDBColumn
|
||||
Caption = #26085#26399
|
||||
DataBinding.FieldName = 'MNDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 117
|
||||
end
|
||||
object V1Name: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #25805#20316#35828#26126
|
||||
DataBinding.FieldName = 'MNNOte'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1NamePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 513
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = TV1
|
||||
end
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 713
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 59
|
||||
Top = 0
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 118
|
||||
Top = 0
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 177
|
||||
Top = 0
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 236
|
||||
Top = 0
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 713
|
||||
Height = 44
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
object Label2: TLabel
|
||||
Left = -31
|
||||
Top = 13
|
||||
Width = 360
|
||||
Height = 16
|
||||
Caption = ' '#27880#65306#28966#28857#31163#24320#24403#21069#32534#36753#21333#20803#26684#20445#23384#25968#25454#12290
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 48
|
||||
Top = 136
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 80
|
||||
Top = 144
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 112
|
||||
Top = 152
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 280
|
||||
Top = 144
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 208
|
||||
Top = 144
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 168
|
||||
Top = 152
|
||||
end
|
||||
end
|
||||
220
客户供应商管理(Company.dll)/U_ModuleNote.pas
Normal file
220
客户供应商管理(Company.dll)/U_ModuleNote.pas
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
unit U_ModuleNote;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu,
|
||||
cxTimeEdit, cxCalendar;
|
||||
|
||||
type
|
||||
TfrmModuleNote = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
Panel1: TPanel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Label2: TLabel;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmModuleNote: TfrmModuleNote;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmModuleNote.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Module_Note A where A.MNType='''+flag+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmModuleNote.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('MNDate').Value:=Now;
|
||||
Post;
|
||||
end;
|
||||
|
||||
end;
|
||||
procedure TfrmModuleNote.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('MNID').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete SY_Module_Note where MNID='''+Trim(ClientDataSet1.fieldbyname('MNID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'模块说明');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
InitGrid();
|
||||
ReadCxGrid('自定义'+Trim(flag),TV1,'模块说明');
|
||||
frmModuleNote.Caption:=Trim(flag);
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'模块说明');
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmModuleNote.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno,mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
//Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('MNNote').Value:=Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if Trim(ClientDataSet1.FieldByName('MNID').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'SY','SY_Module_Note',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('MNID').AsString);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from SY_Module_Note ');
|
||||
sql.Add(' where MNID='''+Trim(ClientDataSet1.fieldbyname('MNID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('MNID').AsString)='' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
FieldByName('FillTime').Value:=Now;
|
||||
end
|
||||
else begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value:=Trim(DName);
|
||||
FieldByName('EditTime').Value:=Now;
|
||||
end;
|
||||
FieldByName('MNDate').Value:=ClientDataSet1.fieldbyname('MNDate').Value;
|
||||
FieldByName('MNID').Value:=Trim(maxno);
|
||||
FieldByName('MNNote').Value:=ClientDataSet1.fieldbyname('MNNote').AsString;
|
||||
FieldByName('MNType').Value:=flag;
|
||||
Post;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('MNID').Value:=Trim(maxno);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
342
客户供应商管理(Company.dll)/U_ModulePromptList.dfm
Normal file
342
客户供应商管理(Company.dll)/U_ModulePromptList.dfm
Normal file
|
|
@ -0,0 +1,342 @@
|
|||
object frmModulePromptList: TfrmModulePromptList
|
||||
Left = 131
|
||||
Top = 161
|
||||
Width = 1133
|
||||
Height = 547
|
||||
Caption = #25105#30340#31649#23478
|
||||
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 = 1117
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1117
|
||||
Height = 66
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 75
|
||||
Top = 11
|
||||
Width = 84
|
||||
Height = 12
|
||||
Caption = #38144#21806#21512#21516#26410#23457#26680
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 48
|
||||
Top = 8
|
||||
Width = 27
|
||||
Height = 16
|
||||
Caption = 'aa:'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 242
|
||||
Top = 11
|
||||
Width = 96
|
||||
Height = 12
|
||||
Caption = #29983#20135#25351#31034#21333#26410#23457#26680
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 215
|
||||
Top = 8
|
||||
Width = 27
|
||||
Height = 16
|
||||
Caption = 'bb:'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 457
|
||||
Top = 11
|
||||
Width = 120
|
||||
Height = 12
|
||||
Caption = #29983#20135#25351#31034#21333#24037#24207#26410#23450#20041
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 428
|
||||
Top = 8
|
||||
Width = 27
|
||||
Height = 16
|
||||
Caption = 'cc:'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 75
|
||||
Top = 40
|
||||
Width = 120
|
||||
Height = 12
|
||||
Caption = #29983#20135#25351#31034#21333#24037#24207#26410#23433#25490
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 48
|
||||
Top = 37
|
||||
Width = 27
|
||||
Height = 16
|
||||
Caption = 'dd:'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 241
|
||||
Top = 40
|
||||
Width = 168
|
||||
Height = 12
|
||||
Caption = #29983#20135#25351#31034#21333#37319#36141#21152#24037#21512#21516#26410#24405#20837
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 214
|
||||
Top = 37
|
||||
Width = 27
|
||||
Height = 16
|
||||
Caption = 'ee:'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 456
|
||||
Top = 40
|
||||
Width = 108
|
||||
Height = 12
|
||||
Caption = #29983#20135#25351#31034#21333#29983#20135#36229#26399
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 428
|
||||
Top = 37
|
||||
Width = 27
|
||||
Height = 16
|
||||
Caption = 'ff:'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label13: TLabel
|
||||
Left = 627
|
||||
Top = 11
|
||||
Width = 84
|
||||
Height = 12
|
||||
Caption = #26597' '#35810' '#26465' '#20214
|
||||
end
|
||||
object ModuleNote: TEdit
|
||||
Tag = 2
|
||||
Left = 608
|
||||
Top = 36
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = ModuleNoteChange
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 98
|
||||
Width = 1117
|
||||
Height = 410
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1Column5
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #24453#22788#29702#20107#39033
|
||||
DataBinding.FieldName = 'ModuleNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Footer = DataLink_DDMD.FoneRed
|
||||
Width = 843
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 1128
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1040
|
||||
Top = 8
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 815
|
||||
Top = 7
|
||||
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 = 475
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = CDS_PRT
|
||||
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 = 440
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 877
|
||||
Top = 9
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 506
|
||||
Top = 195
|
||||
end
|
||||
end
|
||||
257
客户供应商管理(Company.dll)/U_ModulePromptList.pas
Normal file
257
客户供应商管理(Company.dll)/U_ModulePromptList.pas
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
unit U_ModulePromptList;
|
||||
|
||||
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,
|
||||
cxTextEdit, cxPC;
|
||||
|
||||
type
|
||||
TfrmModulePromptList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
Label9: TLabel;
|
||||
Label10: TLabel;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
ModuleNote: TEdit;
|
||||
Label13: TLabel;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxPageControl1Change(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ModuleNoteChange(Sender: TObject);
|
||||
private
|
||||
FormID,FormType:Integer;
|
||||
canshu1,canshu2:string;
|
||||
formFile,FormPara,Formname,FFormPara:string;
|
||||
FormPara1,FormPara2,FormPara3,FormPara4,FormPara5:string;
|
||||
FormPara6,FormPara7,FormPara8,FormPara9,FormPara10:string;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure InitDllEvt(FromFile:String;FormID:Integer;Para:String;FormType:Integer; Title: String;
|
||||
Def1: String; Def2: String; Def3: String; Def4: String; Def5: String;
|
||||
Def6: String; Def7: String; Def8: String; Def9: String; Def10: string);
|
||||
|
||||
|
||||
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
userID,username,ADOConnString:string;
|
||||
end;
|
||||
|
||||
var
|
||||
frmModulePromptList: TfrmModulePromptList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
type
|
||||
TMyF = function(
|
||||
App: TApplication; //主应用程序 (对Delphi而言)
|
||||
FormH: HWND; //创建窗口的父窗口句柄 (对PB而言)
|
||||
FormID: Integer; //要调用dll中功能窗体的Id号; 如果只有一个功能窗口,FormID默认为0
|
||||
Language: Integer; //0=Delphi; 1=PB
|
||||
WinStyle: Integer; //0=子窗口; 1:普通窗口 (PB中都为普通窗口)
|
||||
UID: PChar; //用户Id
|
||||
UName: PChar; //用户名
|
||||
Para: PChar;
|
||||
Title: PChar;
|
||||
Defstr1: PChar;
|
||||
Defstr2: PChar;
|
||||
Defstr3: PChar;
|
||||
Defstr4: PChar;
|
||||
Defstr5: PChar;
|
||||
Defstr6: PChar;
|
||||
Defstr7: PChar;
|
||||
Defstr8: PChar;
|
||||
Defstr9: PChar;
|
||||
Defstr10: PChar;
|
||||
Datalink: PChar
|
||||
): HWND; stdcall;
|
||||
var
|
||||
TP: FARPROC;
|
||||
Tf: TMyF;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmModulePromptList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmModulePromptList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('工作列表',Tv1,'我的管家');
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' exec P_Chk_Tishi :DName,:DCode');
|
||||
Parameters.ParamByName('DName').Value:=Trim(DName);
|
||||
Parameters.ParamByName('DCode').Value:=Trim(DCode);
|
||||
ExecSQL;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.InitForm();
|
||||
begin
|
||||
FFormPara:=Trim(DConString);
|
||||
ReadCxGrid('工作列表',Tv1,'我的管家');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.cxPageControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
end;
|
||||
procedure TfrmModulePromptList.InitDllEvt(FromFile:String;FormID:Integer;Para:String;FormType:Integer; Title: String;
|
||||
Def1: String; Def2: String; Def3: String; Def4: String; Def5: String;
|
||||
Def6: String; Def7: String; Def8: String; Def9: String; Def10: string);
|
||||
var
|
||||
Th: HMODULE;
|
||||
begin
|
||||
Th := LoadLibrary(PChar(FromFile));
|
||||
if Th > 0 then
|
||||
begin
|
||||
TP := GetProcAddress(Th, 'GetDllForm');
|
||||
if TP <> nil then
|
||||
begin
|
||||
Tf := TMyF(Tp);
|
||||
Tf(Application, 0, FormID, 0, FormType, PChar(DCode), PChar(DName), PChar(Para), PChar(Title),
|
||||
PChar(Def1), PChar(Def2),PChar(Def3),PChar(Def4),PChar(Def5),
|
||||
PChar(Def6),PChar(Def7),PChar(Def8),PChar(Def9),PChar(Def10),
|
||||
pchar(FFormPara));
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Application.MessageBox(PChar('打不开文件' + FromFile + '!'), '错误', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmModulePromptList.Tv1CellDblClick(
|
||||
Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
{ with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_ModuleSub where ModuleId='''+Trim(Order_Main.fieldbyname('ModuleId').AsString)+'''');
|
||||
sql.Add(' and ModuleSubId='''+Trim(Order_Main.fieldbyname('ModuleSubId').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
//FormID,FormType:Integer;
|
||||
// formFile,FormPara,Formname:string;
|
||||
// FormPara1,FormPara2,FormPara3,FormPara4,FormPara5:string;
|
||||
//FormPara6,FormPara7,FormPara8,FormPara9,FormPara10:string;
|
||||
formFile:=Trim(ADOQueryTemp.fieldbyname('FormFile').AsString);
|
||||
FormID:=ADOQueryTemp.fieldbyname('FormID').AsInteger;
|
||||
FormType:=ADOQueryTemp.fieldbyname('FormType').AsInteger;
|
||||
Formname:=Trim(ADOQueryTemp.fieldbyname('Formname').AsString);
|
||||
FormPara:=Trim(ADOQueryTemp.fieldbyname('FormPara').AsString);
|
||||
// ShowMessage(FormPara);
|
||||
FormPara1:=Trim(ADOQueryTemp.fieldbyname('FormPara1').AsString);
|
||||
FormPara2:=Trim(ADOQueryTemp.fieldbyname('FormPara2').AsString);
|
||||
FormPara3:=Trim(ADOQueryTemp.fieldbyname('FormPara3').AsString);
|
||||
FormPara4:=Trim(ADOQueryTemp.fieldbyname('FormPara4').AsString);
|
||||
FormPara5:=Trim(ADOQueryTemp.fieldbyname('FormPara5').AsString);
|
||||
FormPara6:=Trim(ADOQueryTemp.fieldbyname('FormPara6').AsString);
|
||||
FormPara7:=Trim(ADOQueryTemp.fieldbyname('FormPara7').AsString);
|
||||
FormPara8:=Trim(ADOQueryTemp.fieldbyname('FormPara8').AsString);
|
||||
FormPara9:=Trim(ADOQueryTemp.fieldbyname('FormPara9').AsString);
|
||||
FormPara10:=Trim(ADOQueryTemp.fieldbyname('FormPara10').AsString);
|
||||
InitDllEvt(formFile,FormID,FormPara,FormType,Formname,FormPara1,FormPara2,
|
||||
FormPara3,FormPara4,FormPara5,FormPara6,FormPara7,FormPara8,
|
||||
FormPara9,FormPara10); }
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.ModuleNoteChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
end;
|
||||
|
||||
end.
|
||||
311
客户供应商管理(Company.dll)/U_SYDept.dfm
Normal file
311
客户供应商管理(Company.dll)/U_SYDept.dfm
Normal file
|
|
@ -0,0 +1,311 @@
|
|||
object frmSYDept: TfrmSYDept
|
||||
Left = 73
|
||||
Top = 128
|
||||
Width = 1004
|
||||
Height = 509
|
||||
Caption = #32452#32455#32467#26500
|
||||
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 = 988
|
||||
Height = 33
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_DDMD.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686#23376#31867
|
||||
ImageIndex = 12
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 150
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 13
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #32452#32455#20998#37197
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 363
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 249
|
||||
Height = 437
|
||||
Align = alLeft
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'DPParent'
|
||||
DataController.KeyField = 'DPID'
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
Styles.Inactive = DataLink_DDMD.Red
|
||||
Styles.Selection = DataLink_DDMD.Red
|
||||
Styles.IncSearch = DataLink_DDMD.Red
|
||||
TabOrder = 1
|
||||
OnClick = cxDBTreeList1Click
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'DPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 249
|
||||
Top = 33
|
||||
Width = 315
|
||||
Height = 437
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 41
|
||||
Top = 40
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #19978#32423#32452#32455
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 41
|
||||
Top = 81
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #32452#32455#21517#31216
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 41
|
||||
Top = 121
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #32452#32455#32534#30721
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 24
|
||||
Top = 16
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #32452#32455#32467#26500
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 41
|
||||
Top = 159
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #39034' '#24207' '#21495
|
||||
end
|
||||
object DPTopName: TEdit
|
||||
Left = 104
|
||||
Top = 37
|
||||
Width = 169
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object DPName: TEdit
|
||||
Left = 104
|
||||
Top = 77
|
||||
Width = 169
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnKeyPress = DPNameKeyPress
|
||||
end
|
||||
object DPNo: TEdit
|
||||
Left = 104
|
||||
Top = 117
|
||||
Width = 169
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
end
|
||||
object DPOrder: TEdit
|
||||
Left = 104
|
||||
Top = 155
|
||||
Width = 169
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object cxGrid4: TcxGrid
|
||||
Left = 564
|
||||
Top = 33
|
||||
Width = 424
|
||||
Height = 437
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv4: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSUser
|
||||
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_DDMD.SHuangSe
|
||||
Styles.IncSearch = DataLink_DDMD.SHuangSe
|
||||
Styles.Selection = DataLink_DDMD.SHuangSe
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #21592#24037#32534#21495
|
||||
DataBinding.FieldName = 'UserId'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 84
|
||||
end
|
||||
object cxGridDBColumn7: TcxGridDBColumn
|
||||
Caption = #30331#24405#21517#31216
|
||||
DataBinding.FieldName = 'UserName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 87
|
||||
end
|
||||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #21592#24037#32452#32455
|
||||
DataBinding.FieldName = 'dept'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 74
|
||||
end
|
||||
object v4Column1: TcxGridDBColumn
|
||||
Caption = #31995#32479#21517#31216
|
||||
DataBinding.FieldName = 'MoneyUserName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
Properties.OnEditValueChanged = v4Column1PropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 91
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = Tv4
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Tree
|
||||
Left = 147
|
||||
Top = 219
|
||||
end
|
||||
object ADOQueryTree: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 117
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 528
|
||||
Top = 215
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 258
|
||||
end
|
||||
object CDS_Tree: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 96
|
||||
Top = 256
|
||||
end
|
||||
object CDS_User: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 680
|
||||
Top = 272
|
||||
end
|
||||
object DSUser: TDataSource
|
||||
DataSet = CDS_User
|
||||
Left = 675
|
||||
Top = 211
|
||||
end
|
||||
end
|
||||
353
客户供应商管理(Company.dll)/U_SYDept.pas
Normal file
353
客户供应商管理(Company.dll)/U_SYDept.pas
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
unit U_SYDept;
|
||||
|
||||
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, DBClient, cxFilter, cxData, cxDataStorage, cxEdit,
|
||||
cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid, cxTextEdit;
|
||||
|
||||
type
|
||||
TfrmSYDept = 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;
|
||||
DPTopName: TEdit;
|
||||
DPName: TEdit;
|
||||
DPNo: TEdit;
|
||||
CDS_Tree: TClientDataSet;
|
||||
cxGrid4: TcxGrid;
|
||||
Tv4: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn7: TcxGridDBColumn;
|
||||
cxGridDBColumn8: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
Label4: TLabel;
|
||||
ToolButton2: TToolButton;
|
||||
CDS_User: TClientDataSet;
|
||||
DSUser: TDataSource;
|
||||
Label5: TLabel;
|
||||
DPOrder: TEdit;
|
||||
v4Column1: TcxGridDBColumn;
|
||||
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 DPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure v4Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmSYDept: TfrmSYDept;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmSYDept.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
try
|
||||
ADOQueryTree.DisableControls;
|
||||
with ADOQueryTree do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from SY_Dept order by DPlevel,DPOrder,DPName');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTree,CDS_Tree);
|
||||
SInitCDSData20(ADOQueryTree,CDS_Tree);
|
||||
//cxDBTreeList1.Items[0].Expand(false);
|
||||
cxDBTreeList1.Items[0].Expand(True);
|
||||
finally
|
||||
ADOQueryTree.EnableControls;
|
||||
end;
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSYDept:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
PState:=11;
|
||||
DPTopName.Text:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
//FTopID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPID:='';
|
||||
DPName.Text:='';
|
||||
DPNo.Text:='';
|
||||
DPName.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
PState:=22;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+Trim(CDS_Tree.fieldbyname('DPParent').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
FCPID:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
DPTopName.Text:=Trim(ADOQueryTemp.fieldbyname('DPName').AsString);
|
||||
DPName.Text:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
DPNo.Text:=Trim(CDS_Tree.fieldbyname('DPNo').AsString);
|
||||
DPOrder.Text:=Trim(CDS_Tree.fieldbyname('DPOrder').AsString);
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
maxId:String;
|
||||
FInt:Integer;
|
||||
begin
|
||||
if Trim(DPName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('本级名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
{if Trim(DPNo.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('类别编码不能为空!','提示',0);
|
||||
Exit;
|
||||
end;}
|
||||
if Trim(DPOrder.Text)='' then
|
||||
begin
|
||||
DPOrder.Text:='99';
|
||||
end;
|
||||
if TryStrToInt(Trim(DPOrder.Text),FInt)=False then
|
||||
begin
|
||||
Application.MessageBox('顺序号非法数字!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if PState=11 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'DP','SY_Dept',3,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 SY_Dept where DPID='''+Trim(FCPID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if PState=11 then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('DPID').Value:=Trim(maxId);
|
||||
FieldByName('DPName').Value:=Trim(DPName.Text);
|
||||
FieldByName('DPNo').Value:=Trim(DPNo.Text);
|
||||
FieldByName('DPParent').Value:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
FieldByName('DPLevel').Value:=CDS_Tree.fieldbyname('DPLevel').AsInteger+1;
|
||||
FieldByName('DPOrder').Value:=StrToInt(Trim(DPOrder.Text));
|
||||
Post;
|
||||
end else
|
||||
if PState=22 then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('DPID').Value:=Trim(maxId);
|
||||
FieldByName('DPName').Value:=Trim(DPName.Text);
|
||||
FieldByName('DPNo').Value:=Trim(DPNo.Text);
|
||||
FieldByName('DPOrder').Value:=StrToInt(Trim(DPOrder.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 TfrmSYDept.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTree.FieldByName('DPLevel').AsInteger=0 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPParent='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('已经定义下级组织不能删除!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where DPID='''+Trim(CDS_Tree.fieldbyname('DPID').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 SY_Dept where DPID='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
sql.Add('delete SY_Dept where DPParent='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.DPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
DPNo.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Tree.IsEmpty=False then
|
||||
begin
|
||||
if CDS_User.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要进行组织分配吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update SY_User Set DPID='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
sql.Add(' where UserId='''+Trim(CDS_User.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with CDS_User do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Dept').Value:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Tree.FieldByName('DPLevel').Value=0 then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select A.*,Dept=(select DPName from SY_Dept where DPID=A.DPID) ');
|
||||
SQL.Add(' from SY_User A where UserId not in(''Admin'',''Test'') ');
|
||||
SQL.Add(' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_User);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_User);
|
||||
end else
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Select_Dept_User :CYType');
|
||||
Parameters.ParamByName('CYType').Value:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_User);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_User);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDept.v4Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
with CDS_User do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('MoneyUserName').Value:=Trim(mvalue);
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update SY_User Set MoneyUserName='''+Trim(mvalue)+'''');
|
||||
sql.Add(' where UserId='''+Trim(CDS_User.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
296
客户供应商管理(Company.dll)/U_SYDeptUserView.dfm
Normal file
296
客户供应商管理(Company.dll)/U_SYDeptUserView.dfm
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
object frmSYDeptUserView: TfrmSYDeptUserView
|
||||
Left = 233
|
||||
Top = 146
|
||||
Width = 927
|
||||
Height = 536
|
||||
Caption = #32452#32455#32467#26500#20154#21592#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 = 911
|
||||
Height = 33
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_CYZZ.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_CYZZ.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686#23376#31867
|
||||
ImageIndex = 12
|
||||
Visible = False
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 150
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
Visible = False
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 13
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
Caption = #32452#32455#20998#37197
|
||||
ImageIndex = 22
|
||||
Visible = False
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 359
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 249
|
||||
Height = 464
|
||||
Align = alLeft
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'DPParent'
|
||||
DataController.KeyField = 'DPID'
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
Styles.Inactive = DataLink_CYZZ.Red
|
||||
Styles.Selection = DataLink_CYZZ.Red
|
||||
Styles.IncSearch = DataLink_CYZZ.Red
|
||||
TabOrder = 1
|
||||
OnClick = cxDBTreeList1Click
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'DPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 249
|
||||
Top = 33
|
||||
Width = 315
|
||||
Height = 464
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object Label1: TLabel
|
||||
Left = 66
|
||||
Top = 40
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #19978#32423#32452#32455
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 66
|
||||
Top = 81
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #32452#32455#21517#31216
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 66
|
||||
Top = 121
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #32452#32455#32534#30721
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 24
|
||||
Top = 16
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #32452#32455#32467#26500
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 66
|
||||
Top = 159
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #39034' '#24207' '#21495
|
||||
end
|
||||
object DPTopName: TEdit
|
||||
Left = 129
|
||||
Top = 37
|
||||
Width = 121
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object DPName: TEdit
|
||||
Left = 129
|
||||
Top = 77
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnKeyPress = DPNameKeyPress
|
||||
end
|
||||
object DPNo: TEdit
|
||||
Left = 129
|
||||
Top = 117
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
end
|
||||
object DPOrder: TEdit
|
||||
Left = 129
|
||||
Top = 155
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object cxGrid4: TcxGrid
|
||||
Left = 564
|
||||
Top = 33
|
||||
Width = 347
|
||||
Height = 464
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv4: TcxGridDBTableView
|
||||
OnDblClick = Tv4DblClick
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSUser
|
||||
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_CYZZ.SHuangSe
|
||||
Styles.IncSearch = DataLink_CYZZ.SHuangSe
|
||||
Styles.Selection = DataLink_CYZZ.SHuangSe
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #21592#24037#32534#21495
|
||||
DataBinding.FieldName = 'UserId'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_CYZZ.Default
|
||||
Width = 84
|
||||
end
|
||||
object cxGridDBColumn7: TcxGridDBColumn
|
||||
Caption = #21592#24037#21517#31216
|
||||
DataBinding.FieldName = 'UserName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_CYZZ.Default
|
||||
Width = 87
|
||||
end
|
||||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #21592#24037#32452#32455
|
||||
DataBinding.FieldName = 'dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_CYZZ.Default
|
||||
Width = 74
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = Tv4
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Tree
|
||||
Left = 147
|
||||
Top = 219
|
||||
end
|
||||
object ADOQueryTree: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 117
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 111
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 146
|
||||
end
|
||||
object CDS_Tree: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 96
|
||||
Top = 256
|
||||
end
|
||||
object CDS_User: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 680
|
||||
Top = 272
|
||||
end
|
||||
object DSUser: TDataSource
|
||||
DataSet = CDS_User
|
||||
Left = 675
|
||||
Top = 211
|
||||
end
|
||||
end
|
||||
336
客户供应商管理(Company.dll)/U_SYDeptUserView.pas
Normal file
336
客户供应商管理(Company.dll)/U_SYDeptUserView.pas
Normal file
|
|
@ -0,0 +1,336 @@
|
|||
unit U_SYDeptUserView;
|
||||
|
||||
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, DBClient, cxFilter, cxData, cxDataStorage, cxEdit,
|
||||
cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid;
|
||||
|
||||
type
|
||||
TfrmSYDeptUserView = 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;
|
||||
DPTopName: TEdit;
|
||||
DPName: TEdit;
|
||||
DPNo: TEdit;
|
||||
CDS_Tree: TClientDataSet;
|
||||
cxGrid4: TcxGrid;
|
||||
Tv4: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn7: TcxGridDBColumn;
|
||||
cxGridDBColumn8: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
Label4: TLabel;
|
||||
ToolButton2: TToolButton;
|
||||
CDS_User: TClientDataSet;
|
||||
DSUser: TDataSource;
|
||||
Label5: TLabel;
|
||||
DPOrder: 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 DPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure Tv4DblClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmSYDeptUserView: TfrmSYDeptUserView;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmSYDeptUserView.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
try
|
||||
ADOQueryTree.DisableControls;
|
||||
with ADOQueryTree do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from SY_Dept order by DPlevel,DPOrder,DPName');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTree,CDS_Tree);
|
||||
SInitCDSData20(ADOQueryTree,CDS_Tree);
|
||||
//cxDBTreeList1.Items[0].Expand(false);
|
||||
cxDBTreeList1.Items[0].Expand(True);
|
||||
finally
|
||||
ADOQueryTree.EnableControls;
|
||||
end;
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSYDeptUserView:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
PState:=11;
|
||||
DPTopName.Text:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
//FTopID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPID:='';
|
||||
DPName.Text:='';
|
||||
DPNo.Text:='';
|
||||
DPName.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
PState:=22;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+Trim(CDS_Tree.fieldbyname('DPParent').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
FCPID:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
DPTopName.Text:=Trim(ADOQueryTemp.fieldbyname('DPName').AsString);
|
||||
DPName.Text:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
DPNo.Text:=Trim(CDS_Tree.fieldbyname('DPNo').AsString);
|
||||
DPOrder.Text:=Trim(CDS_Tree.fieldbyname('DPOrder').AsString);
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
maxId:String;
|
||||
FInt:Integer;
|
||||
begin
|
||||
if Trim(DPName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('本级名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
{if Trim(DPNo.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('类别编码不能为空!','提示',0);
|
||||
Exit;
|
||||
end;}
|
||||
if Trim(DPOrder.Text)='' then
|
||||
begin
|
||||
DPOrder.Text:='99';
|
||||
end;
|
||||
if TryStrToInt(Trim(DPOrder.Text),FInt)=False then
|
||||
begin
|
||||
Application.MessageBox('顺序号非法数字!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if PState=11 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'DP','SY_Dept',3,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 SY_Dept where DPID='''+Trim(FCPID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if PState=11 then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('DPID').Value:=Trim(maxId);
|
||||
FieldByName('DPName').Value:=Trim(DPName.Text);
|
||||
FieldByName('DPNo').Value:=Trim(DPNo.Text);
|
||||
FieldByName('DPParent').Value:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
FieldByName('DPLevel').Value:=CDS_Tree.fieldbyname('DPLevel').AsInteger+1;
|
||||
FieldByName('DPOrder').Value:=StrToInt(Trim(DPOrder.Text));
|
||||
Post;
|
||||
end else
|
||||
if PState=22 then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('DPID').Value:=Trim(maxId);
|
||||
FieldByName('DPName').Value:=Trim(DPName.Text);
|
||||
FieldByName('DPNo').Value:=Trim(DPNo.Text);
|
||||
FieldByName('DPOrder').Value:=StrToInt(Trim(DPOrder.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 TfrmSYDeptUserView.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTree.FieldByName('DPLevel').AsInteger=0 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPParent='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('已经定义下级组织不能删除!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where DPID='''+Trim(CDS_Tree.fieldbyname('DPID').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 SY_Dept where DPID='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
sql.Add('delete SY_Dept where DPParent='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.DPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
DPNo.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Tree.IsEmpty=False then
|
||||
begin
|
||||
if CDS_User.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要进行组织分配吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update SY_User Set DPID='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
sql.Add(' where UserId='''+Trim(CDS_User.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with CDS_User do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Dept').Value:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Tree.FieldByName('DPLevel').Value=0 then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select A.*,Dept=(select DPName from SY_Dept where DPID=A.DPID) ');
|
||||
SQL.Add(' from SY_User A where UserId not in(''Admin'',''Test'') ');
|
||||
SQL.Add(' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_User);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_User);
|
||||
end else
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Select_Dept_User :CYType');
|
||||
Parameters.ParamByName('CYType').Value:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_User);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_User);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptUserView.Tv4DblClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
304
客户供应商管理(Company.dll)/U_SYDeptView.dfm
Normal file
304
客户供应商管理(Company.dll)/U_SYDeptView.dfm
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
object frmSYDeptView: TfrmSYDeptView
|
||||
Left = 233
|
||||
Top = 146
|
||||
Width = 927
|
||||
Height = 536
|
||||
Caption = #32452#32455#32467#26500#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 = 911
|
||||
Height = 33
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_KangChi.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_KangChi.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686#23376#31867
|
||||
ImageIndex = 12
|
||||
Visible = False
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
Visible = False
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 13
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
Caption = #32452#32455#20998#37197
|
||||
ImageIndex = 22
|
||||
Visible = False
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 422
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 315
|
||||
Top = 33
|
||||
Width = 596
|
||||
Height = 464
|
||||
Align = alClient
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'DPParent'
|
||||
DataController.KeyField = 'DPID'
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
Styles.Inactive = DataLink_KangChi.Red
|
||||
Styles.Selection = DataLink_KangChi.Red
|
||||
Styles.IncSearch = DataLink_KangChi.Red
|
||||
TabOrder = 1
|
||||
OnClick = cxDBTreeList1Click
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'DPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 315
|
||||
Height = 464
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object Label1: TLabel
|
||||
Left = 66
|
||||
Top = 40
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #19978#32423#32452#32455
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 66
|
||||
Top = 81
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #32452#32455#21517#31216
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 66
|
||||
Top = 121
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #32452#32455#32534#30721
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 24
|
||||
Top = 16
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #32452#32455#32467#26500
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 66
|
||||
Top = 159
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #39034' '#24207' '#21495
|
||||
end
|
||||
object DPTopName: TEdit
|
||||
Left = 129
|
||||
Top = 37
|
||||
Width = 121
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object DPName: TEdit
|
||||
Left = 129
|
||||
Top = 77
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnKeyPress = DPNameKeyPress
|
||||
end
|
||||
object DPNo: TEdit
|
||||
Left = 129
|
||||
Top = 117
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
end
|
||||
object DPOrder: TEdit
|
||||
Left = 129
|
||||
Top = 155
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
end
|
||||
end
|
||||
object cxGrid4: TcxGrid
|
||||
Left = 352
|
||||
Top = 64
|
||||
Width = 359
|
||||
Height = 273
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object Tv4: TcxGridDBTableView
|
||||
OnDblClick = Tv4DblClick
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DSUser
|
||||
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_KangChi.SHuangSe
|
||||
Styles.IncSearch = DataLink_KangChi.SHuangSe
|
||||
Styles.Selection = DataLink_KangChi.SHuangSe
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #21592#24037#32534#21495
|
||||
DataBinding.FieldName = 'UserId'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_KangChi.Default
|
||||
Width = 84
|
||||
end
|
||||
object cxGridDBColumn7: TcxGridDBColumn
|
||||
Caption = #21592#24037#21517#31216
|
||||
DataBinding.FieldName = 'UserName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_KangChi.Default
|
||||
Width = 87
|
||||
end
|
||||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #21592#24037#32452#32455
|
||||
DataBinding.FieldName = 'dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_KangChi.Default
|
||||
Width = 74
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = Tv4
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Tree
|
||||
Left = 147
|
||||
Top = 219
|
||||
end
|
||||
object ADOQueryTree: TADOQuery
|
||||
Connection = DataLink_KangChi.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 117
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_KangChi.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 111
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_KangChi.ADOLink
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 146
|
||||
end
|
||||
object CDS_Tree: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 96
|
||||
Top = 256
|
||||
end
|
||||
object CDS_User: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 680
|
||||
Top = 272
|
||||
end
|
||||
object DSUser: TDataSource
|
||||
DataSet = CDS_User
|
||||
Left = 675
|
||||
Top = 211
|
||||
end
|
||||
end
|
||||
344
客户供应商管理(Company.dll)/U_SYDeptView.pas
Normal file
344
客户供应商管理(Company.dll)/U_SYDeptView.pas
Normal file
|
|
@ -0,0 +1,344 @@
|
|||
unit U_SYDeptView;
|
||||
|
||||
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, DBClient, cxFilter, cxData, cxDataStorage, cxEdit,
|
||||
cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid;
|
||||
|
||||
type
|
||||
TfrmSYDeptView = 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;
|
||||
DPTopName: TEdit;
|
||||
DPName: TEdit;
|
||||
DPNo: TEdit;
|
||||
CDS_Tree: TClientDataSet;
|
||||
cxGrid4: TcxGrid;
|
||||
Tv4: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn7: TcxGridDBColumn;
|
||||
cxGridDBColumn8: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
Label4: TLabel;
|
||||
ToolButton2: TToolButton;
|
||||
CDS_User: TClientDataSet;
|
||||
DSUser: TDataSource;
|
||||
Label5: TLabel;
|
||||
DPOrder: TEdit;
|
||||
ToolButton3: TToolButton;
|
||||
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 DPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure Tv4DblClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmSYDeptView: TfrmSYDeptView;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmSYDeptView.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
try
|
||||
ADOQueryTree.DisableControls;
|
||||
with ADOQueryTree do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from SY_Dept order by DPlevel,DPOrder,DPName');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTree,CDS_Tree);
|
||||
SInitCDSData20(ADOQueryTree,CDS_Tree);
|
||||
//cxDBTreeList1.Items[0].Expand(false);
|
||||
cxDBTreeList1.Items[0].Expand(True);
|
||||
finally
|
||||
ADOQueryTree.EnableControls;
|
||||
end;
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSYDeptView:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
PState:=11;
|
||||
DPTopName.Text:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
//FTopID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPID:='';
|
||||
DPName.Text:='';
|
||||
DPNo.Text:='';
|
||||
DPName.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
PState:=22;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+Trim(CDS_Tree.fieldbyname('DPParent').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
FCPID:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
DPTopName.Text:=Trim(ADOQueryTemp.fieldbyname('DPName').AsString);
|
||||
DPName.Text:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
DPNo.Text:=Trim(CDS_Tree.fieldbyname('DPNo').AsString);
|
||||
DPOrder.Text:=Trim(CDS_Tree.fieldbyname('DPOrder').AsString);
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
maxId:String;
|
||||
FInt:Integer;
|
||||
begin
|
||||
if Trim(DPName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('本级名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
{if Trim(DPNo.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('类别编码不能为空!','提示',0);
|
||||
Exit;
|
||||
end;}
|
||||
if Trim(DPOrder.Text)='' then
|
||||
begin
|
||||
DPOrder.Text:='99';
|
||||
end;
|
||||
if TryStrToInt(Trim(DPOrder.Text),FInt)=False then
|
||||
begin
|
||||
Application.MessageBox('顺序号非法数字!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if PState=11 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'DP','SY_Dept',3,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 SY_Dept where DPID='''+Trim(FCPID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if PState=11 then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('DPID').Value:=Trim(maxId);
|
||||
FieldByName('DPName').Value:=Trim(DPName.Text);
|
||||
FieldByName('DPNo').Value:=Trim(DPNo.Text);
|
||||
FieldByName('DPParent').Value:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
FieldByName('DPLevel').Value:=CDS_Tree.fieldbyname('DPLevel').AsInteger+1;
|
||||
FieldByName('DPOrder').Value:=StrToInt(Trim(DPOrder.Text));
|
||||
Post;
|
||||
end else
|
||||
if PState=22 then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('DPID').Value:=Trim(maxId);
|
||||
FieldByName('DPName').Value:=Trim(DPName.Text);
|
||||
FieldByName('DPNo').Value:=Trim(DPNo.Text);
|
||||
FieldByName('DPOrder').Value:=StrToInt(Trim(DPOrder.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 TfrmSYDeptView.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTree.FieldByName('DPLevel').AsInteger=0 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPParent='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('已经定义下级组织不能删除!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where DPID='''+Trim(CDS_Tree.fieldbyname('DPID').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 SY_Dept where DPID='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
sql.Add('delete SY_Dept where DPParent='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.DPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
DPNo.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Tree.IsEmpty=False then
|
||||
begin
|
||||
if CDS_User.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要进行组织分配吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update SY_User Set DPID='''+Trim(CDS_Tree.fieldbyname('DPID').AsString)+'''');
|
||||
sql.Add(' where UserId='''+Trim(CDS_User.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with CDS_User do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Dept').Value:=Trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Tree.FieldByName('DPLevel').Value=0 then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select A.*,Dept=(select DPName from SY_Dept where DPID=A.DPID) ');
|
||||
SQL.Add(' from SY_User A where UserId not in(''Admin'',''Test'') ');
|
||||
SQL.Add(' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_User);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_User);
|
||||
end else
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Select_Dept_User :CYType');
|
||||
Parameters.ParamByName('CYType').Value:=Trim(CDS_Tree.fieldbyname('DPID').AsString);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_User);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_User);
|
||||
end;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.Tv4DblClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmSYDeptView.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
557
客户供应商管理(Company.dll)/U_UserModuleNameList.dfm
Normal file
557
客户供应商管理(Company.dll)/U_UserModuleNameList.dfm
Normal file
|
|
@ -0,0 +1,557 @@
|
|||
object frmUserModuleNameList: TfrmUserModuleNameList
|
||||
Left = 97
|
||||
Top = 61
|
||||
Width = 1201
|
||||
Height = 618
|
||||
Caption = #21592#24037#27169#22359#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 = 1185
|
||||
Height = 33
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_CYZZ.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_CYZZ.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBFind: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = TBFindClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 16
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 1185
|
||||
Height = 37
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
end
|
||||
object cxPageControl1: TcxPageControl
|
||||
Left = 0
|
||||
Top = 70
|
||||
Width = 1185
|
||||
Height = 509
|
||||
ActivePage = cxTabSheet1
|
||||
Align = alClient
|
||||
Style = 8
|
||||
TabOrder = 2
|
||||
OnChange = cxPageControl1Change
|
||||
ClientRectBottom = 509
|
||||
ClientRectRight = 1185
|
||||
ClientRectTop = 23
|
||||
object cxTabSheet1: TcxTabSheet
|
||||
Caption = #27169#22359#34920
|
||||
ImageIndex = 0
|
||||
object cxGrid3: TcxGrid
|
||||
Left = 0
|
||||
Top = 37
|
||||
Width = 1185
|
||||
Height = 449
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object Tv3: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'DefStr1'
|
||||
end
|
||||
item
|
||||
Format = 'YCLCode'
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_CYZZ.SHuangSe
|
||||
Styles.IncSearch = DataLink_CYZZ.SHuangSe
|
||||
Styles.Selection = DataLink_CYZZ.SHuangSe
|
||||
Styles.Header = DataLink_CYZZ.Default
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #27169#22359#21517#31216
|
||||
DataBinding.FieldName = 'FormName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Content = DataLink_CYZZ.FoneRed
|
||||
Styles.Footer = DataLink_CYZZ.FoneRed
|
||||
Styles.Header = DataLink_CYZZ.FoneRed
|
||||
Width = 256
|
||||
end
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #20351#29992#24773#20917
|
||||
DataBinding.FieldName = 'FormNameNote'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_CYZZ.FontBlue
|
||||
Styles.Footer = DataLink_CYZZ.FontBlue
|
||||
Styles.Header = DataLink_CYZZ.FontBlue
|
||||
Width = 917
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = Tv3
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1185
|
||||
Height = 37
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 20
|
||||
Top = 12
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #27169#22359#21517#31216
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 284
|
||||
Top = 12
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20351#29992#24773#20917
|
||||
end
|
||||
object FormName: TEdit
|
||||
Tag = 2
|
||||
Left = 70
|
||||
Top = 9
|
||||
Width = 179
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
object FormNameNote: TEdit
|
||||
Tag = 2
|
||||
Left = 334
|
||||
Top = 9
|
||||
Width = 179
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxTabSheet2: TcxTabSheet
|
||||
Caption = #37096#38376#27169#22359#34920
|
||||
ImageIndex = 1
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 37
|
||||
Width = 1185
|
||||
Height = 449
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object Tv2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'DefStr1'
|
||||
end
|
||||
item
|
||||
Format = 'YCLCode'
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_CYZZ.SHuangSe
|
||||
Styles.IncSearch = DataLink_CYZZ.SHuangSe
|
||||
Styles.Selection = DataLink_CYZZ.SHuangSe
|
||||
Styles.Header = DataLink_CYZZ.Default
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'DPName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_CYZZ.FontBlue
|
||||
Styles.Footer = DataLink_CYZZ.FontBlue
|
||||
Styles.Header = DataLink_CYZZ.FontBlue
|
||||
Width = 116
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #27169#22359#21517#31216
|
||||
DataBinding.FieldName = 'DFormName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Content = DataLink_CYZZ.FoneRed
|
||||
Styles.Footer = DataLink_CYZZ.FoneRed
|
||||
Styles.Header = DataLink_CYZZ.FoneRed
|
||||
Width = 263
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1185
|
||||
Height = 37
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 242
|
||||
Top = 12
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #27169#22359#21517#31216
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 20
|
||||
Top = 12
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #37096#38376
|
||||
end
|
||||
object DFormName: TEdit
|
||||
Tag = 2
|
||||
Left = 292
|
||||
Top = 9
|
||||
Width = 179
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
object DPName: TEdit
|
||||
Tag = 2
|
||||
Left = 45
|
||||
Top = 9
|
||||
Width = 179
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxTabSheet3: TcxTabSheet
|
||||
Caption = #21592#24037#27169#22359#34920
|
||||
ImageIndex = 2
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 37
|
||||
Width = 1185
|
||||
Height = 449
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'DefStr1'
|
||||
end
|
||||
item
|
||||
Format = 'YCLCode'
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
Column = v1ShortName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1ShortName
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_CYZZ.SHuangSe
|
||||
Styles.IncSearch = DataLink_CYZZ.SHuangSe
|
||||
Styles.Selection = DataLink_CYZZ.SHuangSe
|
||||
Styles.Header = DataLink_CYZZ.Default
|
||||
object v1ShortName: TcxGridDBColumn
|
||||
Caption = #21592#24037#32534#21495
|
||||
DataBinding.FieldName = 'UserId'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 108
|
||||
end
|
||||
object v1UnitName: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #30331#24405#21517#31216
|
||||
DataBinding.FieldName = 'UserName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 90
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'UDPName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_CYZZ.FontBlue
|
||||
Styles.Footer = DataLink_CYZZ.FontBlue
|
||||
Styles.Header = DataLink_CYZZ.FontBlue
|
||||
Width = 106
|
||||
end
|
||||
object v1Quantity: TcxGridDBColumn
|
||||
Caption = #27169#22359#21517#31216
|
||||
DataBinding.FieldName = 'UFormName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Content = DataLink_CYZZ.FoneRed
|
||||
Styles.Footer = DataLink_CYZZ.FoneRed
|
||||
Styles.Header = DataLink_CYZZ.FoneRed
|
||||
Width = 241
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1185
|
||||
Height = 37
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 20
|
||||
Top = 12
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #21592#24037#32534#21495
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 212
|
||||
Top = 12
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #30331#24405#21517#31216
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 412
|
||||
Top = 12
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #37096#38376
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 585
|
||||
Top = 12
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #27169#22359#21517#31216
|
||||
end
|
||||
object UserId: TEdit
|
||||
Tag = 2
|
||||
Left = 70
|
||||
Top = 9
|
||||
Width = 127
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
object UserName: TEdit
|
||||
Tag = 2
|
||||
Left = 262
|
||||
Top = 9
|
||||
Width = 127
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
object UDPName: TEdit
|
||||
Tag = 2
|
||||
Left = 437
|
||||
Top = 9
|
||||
Width = 127
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
object UFormName: TEdit
|
||||
Tag = 2
|
||||
Left = 635
|
||||
Top = 9
|
||||
Width = 127
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = UserIdChange
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 680
|
||||
Top = 8
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
Parameters = <>
|
||||
Left = 432
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 464
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_CYZZ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 200
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 600
|
||||
Top = 8
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 636
|
||||
Top = 8
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = ClientDataSet2
|
||||
Left = 448
|
||||
Top = 8
|
||||
end
|
||||
object ClientDataSet2: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 476
|
||||
Top = 8
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 504
|
||||
Top = 8
|
||||
end
|
||||
object DataSource3: TDataSource
|
||||
DataSet = ClientDataSet3
|
||||
Left = 296
|
||||
end
|
||||
object ClientDataSet3: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 332
|
||||
end
|
||||
object cxGridPopupMenu3: TcxGridPopupMenu
|
||||
Grid = cxGrid3
|
||||
PopupMenus = <>
|
||||
Left = 368
|
||||
end
|
||||
end
|
||||
221
客户供应商管理(Company.dll)/U_UserModuleNameList.pas
Normal file
221
客户供应商管理(Company.dll)/U_UserModuleNameList.pas
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
unit U_UserModuleNameList; //
|
||||
|
||||
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, Menus, cxSplitter, cxTextEdit, RM_Common, RM_Class,
|
||||
RM_GridReport, RM_System, RM_Dataset, RM_e_Xls, dxPSGlbl, dxPSUtl,
|
||||
dxPSEngn, dxPrnPg, dxBkgnd, dxWrap, dxPrnDev, dxPSCompsProvider,
|
||||
dxPSFillPatterns, dxPSEdgePatterns, dxPSCore, dxPScxCommon, dxPScxGridLnk,
|
||||
cxPC;
|
||||
|
||||
type
|
||||
TfrmUserModuleNameList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBFind: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Panel1: TPanel;
|
||||
CDS_Main: TClientDataSet;
|
||||
DataSource2: TDataSource;
|
||||
ClientDataSet2: TClientDataSet;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
cxPageControl1: TcxPageControl;
|
||||
cxTabSheet1: TcxTabSheet;
|
||||
cxTabSheet2: TcxTabSheet;
|
||||
cxTabSheet3: TcxTabSheet;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1ShortName: TcxGridDBColumn;
|
||||
v1UnitName: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Quantity: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid3: TcxGrid;
|
||||
Tv3: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource3: TDataSource;
|
||||
ClientDataSet3: TClientDataSet;
|
||||
cxGridPopupMenu3: TcxGridPopupMenu;
|
||||
Panel2: TPanel;
|
||||
Label1: TLabel;
|
||||
FormName: TEdit;
|
||||
Panel3: TPanel;
|
||||
Label2: TLabel;
|
||||
DFormName: TEdit;
|
||||
Panel4: TPanel;
|
||||
Label3: TLabel;
|
||||
UserId: TEdit;
|
||||
Label4: TLabel;
|
||||
FormNameNote: TEdit;
|
||||
Label5: TLabel;
|
||||
DPName: TEdit;
|
||||
Label6: TLabel;
|
||||
UserName: TEdit;
|
||||
Label7: TLabel;
|
||||
UDPName: TEdit;
|
||||
Label8: TLabel;
|
||||
UFormName: 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 TBRafreshClick(Sender: TObject);
|
||||
procedure UserIdChange(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxPageControl1Change(Sender: TObject);
|
||||
private
|
||||
canshu1,canshu2:String;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmUserModuleNameList: TfrmUserModuleNameList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmUserModuleNameList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmUserModuleNameList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('员工模块列表',Tv1,'系统管理');
|
||||
WriteCxGrid('部门模块列表',Tv2,'系统管理');
|
||||
WriteCxGrid('模块列表',Tv3,'系统管理');
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.InitGrid();
|
||||
begin
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
begin
|
||||
SQL.Add(' exec P_View_ModuleName ');
|
||||
end else
|
||||
if cxPageControl1.ActivePageIndex=1 then
|
||||
begin
|
||||
SQL.Add(' exec P_View_DeptModuleName ');
|
||||
end else
|
||||
if cxPageControl1.ActivePageIndex=2 then
|
||||
begin
|
||||
SQL.Add(' exec P_View_UserModuleName ');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.InitForm();
|
||||
begin
|
||||
ReadCxGrid('员工模块列表',Tv1,'系统管理');
|
||||
ReadCxGrid('部门模块列表',Tv2,'系统管理');
|
||||
ReadCxGrid('模块列表',Tv3,'系统管理');
|
||||
cxPageControl1.ActivePageIndex:=0;
|
||||
//InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel2,1,2))
|
||||
else if cxPageControl1.ActivePageIndex=1 then
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel3,1,2))
|
||||
else if cxPageControl1.ActivePageIndex=2 then
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel4,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
TcxGridToExcel('模块列表',cxGrid3)
|
||||
else if cxPageControl1.ActivePageIndex=1 then
|
||||
TcxGridToExcel('部门模块列表',cxGrid2)
|
||||
else if cxPageControl1.ActivePageIndex=2 then
|
||||
TcxGridToExcel('员工模块列表',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TfrmUserModuleNameList.UserIdChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel2,1,2))
|
||||
else if cxPageControl1.ActivePageIndex=1 then
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel3,1,2))
|
||||
else if cxPageControl1.ActivePageIndex=2 then
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel4,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmUserModuleNameList.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmUserModuleNameList.cxPageControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
end.
|
||||
17994
客户供应商管理(Company.dll)/U_YWYSel.dfm
Normal file
17994
客户供应商管理(Company.dll)/U_YWYSel.dfm
Normal file
File diff suppressed because it is too large
Load Diff
148
客户供应商管理(Company.dll)/U_YWYSel.pas
Normal file
148
客户供应商管理(Company.dll)/U_YWYSel.pas
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
unit U_YWYSel;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu;
|
||||
|
||||
type
|
||||
TfrmYWYSel = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
sql_str:string;
|
||||
flag,flagname,snote,MainType:string;
|
||||
fnote,forderno,fZdyFlag,ViewFlag,fnote1:Boolean;
|
||||
PPSTE:integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmYWYSel: TfrmYWYSel;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmYWYSel.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
{if Application.MessageBox('网络连接失败,是否要再次连接?','提示',32+4)=IDYES then
|
||||
begin
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='23242';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end; }
|
||||
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select UserID,UserName ,UType from SY_User');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.FormShow(Sender: TObject);
|
||||
|
||||
begin
|
||||
frmZDYHelp.Caption:=Trim(flagname);
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.ZDYNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmYWYSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmYWYSel:=nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
275
客户供应商管理(Company.dll)/U_ZDYHelp.dfm
Normal file
275
客户供应商管理(Company.dll)/U_ZDYHelp.dfm
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
object frmZDYHelp: TfrmZDYHelp
|
||||
Left = 466
|
||||
Top = 188
|
||||
Width = 465
|
||||
Height = 528
|
||||
Caption = #39033#30446#32500#25252
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 73
|
||||
Width = 449
|
||||
Height = 416
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = TV1CellDblClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.GroupByBox = False
|
||||
object V1Code: TcxGridDBColumn
|
||||
Caption = #32534#21495
|
||||
DataBinding.FieldName = 'ZDYNo'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 97
|
||||
end
|
||||
object V1OrderNo: TcxGridDBColumn
|
||||
Caption = #39034#24207#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1OrderNoPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 49
|
||||
end
|
||||
object V1Name: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #21517#31216
|
||||
DataBinding.FieldName = 'ZDYName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1NamePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 326
|
||||
end
|
||||
object V1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1NotePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 109
|
||||
end
|
||||
object V1ZdyFlag: TcxGridDBColumn
|
||||
Caption = #26631#24535
|
||||
DataBinding.FieldName = 'ZdyFlag'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1Column1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 57
|
||||
end
|
||||
object V1HelpType: TcxGridDBColumn
|
||||
Caption = #24110#21161#31867#27604
|
||||
DataBinding.FieldName = 'HelpType'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1HelpTypePropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 55
|
||||
end
|
||||
object V1ZdyStr1: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ZdyStr1'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1ZdyStr1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 61
|
||||
end
|
||||
object V1ZdyStr2: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ZdyStr2'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1ZdyStr1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object V1ZdyStr3: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ZdyStr3'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1ZdyStr1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 57
|
||||
end
|
||||
object V1ZdyStr4: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ZdyStr4'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1ZdyStr1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 61
|
||||
end
|
||||
object V1ZdyStr5: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'ZdyStr5'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1ZdyStr1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 61
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = TV1
|
||||
end
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 449
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_PBMDDJ.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 59
|
||||
Top = 0
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 118
|
||||
Top = 0
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 177
|
||||
Top = 0
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object TBSave: TToolButton
|
||||
Left = 236
|
||||
Top = 0
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
Visible = False
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 295
|
||||
Top = 0
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 449
|
||||
Height = 44
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 18
|
||||
Top = 17
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #21517#31216
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 240
|
||||
Top = 11
|
||||
Width = 120
|
||||
Height = 24
|
||||
Caption = #27880#65306#28966#28857#31163#24320#24403#21069#32534#36753#13#10' '#21333#20803#26684#20445#23384#25968#25454#12290
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object ZDYName: TEdit
|
||||
Tag = 2
|
||||
Left = 53
|
||||
Top = 12
|
||||
Width = 169
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = ZDYNameChange
|
||||
end
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_PBMDDJ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 48
|
||||
Top = 136
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_PBMDDJ.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 80
|
||||
Top = 144
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_PBMDDJ.ADOLink
|
||||
Parameters = <>
|
||||
Left = 112
|
||||
Top = 152
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 280
|
||||
Top = 144
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 208
|
||||
Top = 144
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 168
|
||||
Top = 152
|
||||
end
|
||||
end
|
||||
724
客户供应商管理(Company.dll)/U_ZDYHelp.pas
Normal file
724
客户供应商管理(Company.dll)/U_ZDYHelp.pas
Normal file
|
|
@ -0,0 +1,724 @@
|
|||
unit U_ZDYHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu,
|
||||
cxTimeEdit;
|
||||
|
||||
type
|
||||
TfrmZDYHelp = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
Label2: TLabel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
V1ZdyFlag: TcxGridDBColumn;
|
||||
V1HelpType: TcxGridDBColumn;
|
||||
V1ZdyStr1: TcxGridDBColumn;
|
||||
V1ZdyStr2: TcxGridDBColumn;
|
||||
V1ZdyStr3: TcxGridDBColumn;
|
||||
V1ZdyStr4: TcxGridDBColumn;
|
||||
V1ZdyStr5: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1OrderNoPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1HelpTypePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1ZdyStr1PropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote,MainType:string;
|
||||
fnote,forderno,fZdyFlag,ViewFlag:Boolean;
|
||||
PPSTE:integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYHelp: TfrmZDYHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZDYHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
{try
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
{if Application.MessageBox('网络连接失败,是否要再次连接?','提示',32+4)=IDYES then
|
||||
begin
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='23242';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end; }
|
||||
|
||||
{frmRTZDYHelp.Free;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,ZJM=dbo.getPinYin(A.ZdyName) from KH_ZDY A where A.Type='''+flag+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
begin
|
||||
sql.Add(' and A.MainType='''+Trim(MainType)+'''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmZDYHelp.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
for i:=0 to 5 do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
procedure TfrmZDYHelp.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
ZDYName.SetFocus;
|
||||
|
||||
if ClientDataSet1.Locate('ZDYName',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if ClientDataSet1.Locate('ZDYName','',[]) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
ClientDataSet1.DisableControls;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').Value;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
TV1.OptionsData.Editing:=False;
|
||||
TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('ZDYname').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||
SQL.Add(' and Type='''+Trim(flag)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
{if PPSTE=1 then
|
||||
begin
|
||||
Application.Terminate;
|
||||
Exit;
|
||||
end; }
|
||||
InitGrid();
|
||||
fsj:=Trim(flag)+'01';
|
||||
fsj1:=Trim(flagname)+'01';
|
||||
{if ClientDataSet1.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYname,Type,note)');
|
||||
sql.Add('select '''+Trim(fsj)+'''');
|
||||
sql.Add(','''+Trim(fsj1)+'''');
|
||||
SQL.Add(','''+Trim(flag)+'''');
|
||||
sql.Add(','''+Trim(snote)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;}
|
||||
//frmZDYHelp.Caption:=Trim(flagname)+'<'+Trim(flag)+'>';
|
||||
//ReadCxGrid('自定义',TV1,'自定义数据');
|
||||
ReadCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
frmZDYHelp.Caption:=Trim(flagname);
|
||||
V1Note.Visible:=fnote;
|
||||
V1ZdyFlag.Visible:=fZdyFlag;
|
||||
V1OrderNo.Visible:=forderno;
|
||||
if ViewFlag=True then
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TBSave.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
Label2.Visible:=False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.ZDYNameChange(Sender: TObject);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
if Trim(ZDYName.Text)<>'' then
|
||||
begin
|
||||
fsj:=' zdyname like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or Note like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or ZJM like '''+'%'+Trim(ZDYName.Text)+'%'+'''';
|
||||
end;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
// SDofilter(ADOQueryMain,fsj);
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
if Trim(fsj)='' then
|
||||
begin
|
||||
Filtered:=False;
|
||||
end else
|
||||
begin
|
||||
Filtered:=False;
|
||||
Filter:=fsj;
|
||||
Filtered:=True;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno,mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
//Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyName').Value:=Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
//ClientDataSet1.DisableControls;
|
||||
//with ClientDataSet1 do
|
||||
//begin
|
||||
//First;
|
||||
//while not eof do
|
||||
//begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
//ClientDataSet1.Post;
|
||||
// Next;
|
||||
//end;
|
||||
//end;
|
||||
// ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('保存成功!','提示',0);
|
||||
//TV1.OptionsData.Editing:=False;
|
||||
//TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1OrderNoPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('OrderNo').Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set OrderNo='+mvalue);
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Note').Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set Note='''+Trim(mvalue)+'''');
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:String;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyFlag').Value:=StrToInt(mvalue);
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set ZdyFlag='+Trim(mvalue));
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1HelpTypePropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('HelpType').Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set HelpType='''+Trim(mvalue)+'''');
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1ZdyStr1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue,FFieldName:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
FFieldName:=TV1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FFieldName).Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set '+FFieldName+'='''+Trim(mvalue)+'''');
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
224
客户供应商管理(Company.dll)/U_ZDYHelpSel.dfm
Normal file
224
客户供应商管理(Company.dll)/U_ZDYHelpSel.dfm
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
object frmZDYHelpSel: TfrmZDYHelpSel
|
||||
Left = 392
|
||||
Top = 169
|
||||
Width = 574
|
||||
Height = 598
|
||||
Caption = #39033#30446#32500#25252
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 73
|
||||
Width = 558
|
||||
Height = 486
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = TV1CellDblClick
|
||||
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 V1Code: TcxGridDBColumn
|
||||
Caption = #32534#21495
|
||||
DataBinding.FieldName = 'ZDYNo'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 97
|
||||
end
|
||||
object V1Column1: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 48
|
||||
end
|
||||
object V1Name: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #21517#31216
|
||||
DataBinding.FieldName = 'ZDYName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1NamePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 208
|
||||
end
|
||||
object V1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 57
|
||||
end
|
||||
object V1OrderNo: TcxGridDBColumn
|
||||
Caption = #39034#24207#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 53
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = TV1
|
||||
end
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 558
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = #30830#23450
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 59
|
||||
Top = 0
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 118
|
||||
Top = 0
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 177
|
||||
Top = 0
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object TBSave: TToolButton
|
||||
Left = 236
|
||||
Top = 0
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
Visible = False
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 295
|
||||
Top = 0
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 558
|
||||
Height = 44
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 19
|
||||
Top = 17
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #21517#31216
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 240
|
||||
Top = 11
|
||||
Width = 120
|
||||
Height = 24
|
||||
Caption = #27880#65306#28966#28857#31163#24320#24403#21069#32534#36753#13#10' '#21333#20803#26684#20445#23384#25968#25454#12290
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object ZDYName: TEdit
|
||||
Tag = 2
|
||||
Left = 54
|
||||
Top = 12
|
||||
Width = 169
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = ZDYNameChange
|
||||
end
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 48
|
||||
Top = 136
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 80
|
||||
Top = 144
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 112
|
||||
Top = 152
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 280
|
||||
Top = 144
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 200
|
||||
Top = 144
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 352
|
||||
Top = 248
|
||||
end
|
||||
end
|
||||
465
客户供应商管理(Company.dll)/U_ZDYHelpSel.pas
Normal file
465
客户供应商管理(Company.dll)/U_ZDYHelpSel.pas
Normal file
|
|
@ -0,0 +1,465 @@
|
|||
unit U_ZDYHelpSel;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxCheckBox, cxTextEdit, cxGridCustomPopupMenu,
|
||||
cxGridPopupMenu;
|
||||
|
||||
type
|
||||
TfrmZDYHelpSel = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
V1Column1: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote,MainType,ReturnStr,FGStr:string;
|
||||
fnote,forderno:Boolean;
|
||||
PPSTE,JiangeStr:integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYHelpSel: TfrmZDYHelpSel;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZDYHelpSel.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where Type='''+flag+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
begin
|
||||
sql.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
for i:=0 to 5 do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYName').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
// TV1.OptionsData.Editing:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('ZDYname').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||
SQL.Add(' and Type='''+Trim(flag)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
{if PPSTE=1 then
|
||||
begin
|
||||
Application.Terminate;
|
||||
Exit;
|
||||
end; }
|
||||
InitGrid();
|
||||
fsj:=Trim(flag)+'01';
|
||||
fsj1:=Trim(flagname)+'01';
|
||||
ReadCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
{if ClientDataSet1.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYname,Type,note)');
|
||||
sql.Add('select '''+Trim(fsj)+'''');
|
||||
sql.Add(','''+Trim(fsj1)+'''');
|
||||
SQL.Add(','''+Trim(flag)+'''');
|
||||
sql.Add(','''+Trim(snote)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;}
|
||||
//frmZDYHelp.Caption:=Trim(flagname)+'<'+Trim(flag)+'>';
|
||||
frmZDYHelpSel.Caption:=Trim(flagname);
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ReturnStr:='';
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
if JiangeStr<>99 then
|
||||
begin
|
||||
if FGStr<>'' then
|
||||
ReturnStr:=ReturnStr+Trim(fieldbyname('ZDYName').AsString)+FGStr
|
||||
else
|
||||
ReturnStr:=ReturnStr+Trim(fieldbyname('ZDYName').AsString)+';'
|
||||
end
|
||||
else
|
||||
ReturnStr:=ReturnStr+Trim(fieldbyname('ZDYName').AsString);
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
if JiangeStr<>99 then
|
||||
ReturnStr:=Copy(ReturnStr,1,Length(ReturnStr)-1);
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.ZDYNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno,mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
//Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyName').Value:=Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
//ClientDataSet1.DisableControls;
|
||||
//with ClientDataSet1 do
|
||||
//begin
|
||||
//First;
|
||||
//while not eof do
|
||||
//begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
//ClientDataSet1.Post;
|
||||
// Next;
|
||||
//end;
|
||||
//end;
|
||||
// ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('保存成功!','提示',0);
|
||||
//TV1.OptionsData.Editing:=False;
|
||||
//TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
17
客户供应商管理(Company.dll)/U_ZdyInput.dfm
Normal file
17
客户供应商管理(Company.dll)/U_ZdyInput.dfm
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
object frmZdyInput: TfrmZdyInput
|
||||
Left = 165
|
||||
Top = 188
|
||||
Width = 870
|
||||
Height = 500
|
||||
Caption = #23458#25143#36164#26009#24405#20837
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnDestroy = FormDestroy
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
end
|
||||
30
客户供应商管理(Company.dll)/U_ZdyInput.pas
Normal file
30
客户供应商管理(Company.dll)/U_ZdyInput.pas
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
unit U_ZdyInput;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs;
|
||||
|
||||
type
|
||||
TfrmZdyInput = class(TForm)
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZdyInput: TfrmZdyInput;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZdyInput.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmZdyInput:=nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
65
客户供应商管理(Company.dll)/U_iniParam.pas
Normal file
65
客户供应商管理(Company.dll)/U_iniParam.pas
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
|
||||
unit U_iniParam;
|
||||
|
||||
interface
|
||||
uses
|
||||
IniFiles,SysUtils;
|
||||
var
|
||||
Filename:string; //文件名
|
||||
iParam2:integer;
|
||||
bParam1:Boolean;
|
||||
bParam2:Boolean;
|
||||
SCXFlag:String; //生产线 根据此标志获取卷条码前缀 不能包含字母 1,2
|
||||
SCXCount:String; //机台个数
|
||||
PortNoStr:string;//端口号
|
||||
DllName:string;//端口Dll文件
|
||||
Function IsINIFile():Boolean; //判断InI配置文件是否存在
|
||||
procedure ReadINIFile();
|
||||
procedure WriteINIFile();
|
||||
implementation
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//读取ini文件设置参数
|
||||
//参数:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
procedure ReadINIFile();
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
begin
|
||||
FileName:=ExtractFilePath(Paramstr(0))+'File.INI';
|
||||
programIni:=Tinifile.create(FileName);
|
||||
SCXFlag:=programIni.ReadString('生产车间配置','卷条码机台标志','1');
|
||||
SCXCount:=programIni.ReadString('生产车间配置','机台个数','1');
|
||||
PortNoStr:=programIni.ReadString('生产车间配置','端口号','com1');
|
||||
DllName:=programIni.ReadString('生产车间配置','端口Dll文件','JZCRS323C.DLL');
|
||||
programIni.Free;
|
||||
end;
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//写设置信息到INI文件
|
||||
//参数
|
||||
//////////////////////////////////////////////////////////////////
|
||||
procedure WriteINIFile();
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
begin
|
||||
FileName:=ExtractFilePath(Paramstr(0))+'File.INI';
|
||||
programIni:=Tinifile.create(FileName);
|
||||
programIni.WriteString('生产车间配置','卷条码机台标志',SCXFlag);
|
||||
programIni.WriteString('生产车间配置','机台个数',SCXCount);
|
||||
programIni.WriteString('生产车间配置','端口号',PortNoStr);
|
||||
programIni.WriteString('生产车间配置','端口Dll文件',DllName);
|
||||
programIni.Free;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//判断InI文件是否存在
|
||||
//////////////////////////////////////////////////////////////////
|
||||
Function IsINIFile():Boolean;
|
||||
begin
|
||||
FileName:=ExtractFilePath(Paramstr(0))+'File.INI';
|
||||
if FileExists(FileName) then
|
||||
Result:=true
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
end.
|
||||
221
客户供应商管理(Company.dll)/U_testdll.dfm
Normal file
221
客户供应商管理(Company.dll)/U_testdll.dfm
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
object Form1: TForm1
|
||||
Left = 203
|
||||
Top = 121
|
||||
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 = 775
|
||||
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
客户供应商管理(Company.dll)/U_testdll.pas
Normal file
106
客户供应商管理(Company.dll)/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('Company.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('ygcode'),
|
||||
PChar('ygname'),
|
||||
PChar('datebase'),
|
||||
PChar('title'),
|
||||
PChar(''),
|
||||
PChar(''),
|
||||
'','','','','','','','',''
|
||||
);
|
||||
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
客户供应商管理(Company.dll)/consvr.ini
Normal file
2
客户供应商管理(Company.dll)/consvr.ini
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[SERVER]
|
||||
SERVER=192.168.88.254
|
||||
38
客户供应商管理(Company.dll)/testDll.cfg
Normal file
38
客户供应商管理(Company.dll)/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 (x86)\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
||||
136
客户供应商管理(Company.dll)/testDll.dof
Normal file
136
客户供应商管理(Company.dll)/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=D:\selfware_83398\selfware\马国钢开发代码\项目代码\self\坯布码单待检DDMD.dll)\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
客户供应商管理(Company.dll)/testDll.dpr
Normal file
14
客户供应商管理(Company.dll)/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
客户供应商管理(Company.dll)/testDll.res
Normal file
BIN
客户供应商管理(Company.dll)/testDll.res
Normal file
Binary file not shown.
38
客户供应商管理(Company.dll)/testDllDJ.cfg
Normal file
38
客户供应商管理(Company.dll)/testDllDJ.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
|
||||
136
客户供应商管理(Company.dll)/testDllDJ.dof
Normal file
136
客户供应商管理(Company.dll)/testDllDJ.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=D:\selfware_83398\selfware\马国钢开发代码\项目代码\self\长阳针织(CYZZ.dll)\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=
|
||||
BIN
客户供应商管理(Company.dll)/testDllDJ.res
Normal file
BIN
客户供应商管理(Company.dll)/testDllDJ.res
Normal file
Binary file not shown.
4
布匹仓库2/File.INI
Normal file
4
布匹仓库2/File.INI
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[生产车间配置]
|
||||
卷条码机台标志=99
|
||||
成品DLL文件=CYZZ.dll
|
||||
成品DLL调用号=11
|
||||
7
布匹仓库2/FileHelp.ini
Normal file
7
布匹仓库2/FileHelp.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[FILEPATH]
|
||||
FileClass=YP,AA,BB,HT
|
||||
YP=D:\YP
|
||||
AA=D:\AA
|
||||
BB=D:\BB
|
||||
HT=D:\HT
|
||||
OTHER=D:\OTHER
|
||||
7
布匹仓库2/JCYData.INI
Normal file
7
布匹仓库2/JCYData.INI
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[系统配置]
|
||||
串口号=com1
|
||||
波特率=9600
|
||||
校验位=0
|
||||
数据位=8
|
||||
停止位=0
|
||||
频率=100
|
||||
7
布匹仓库2/JZCRS323C.INI
Normal file
7
布匹仓库2/JZCRS323C.INI
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[系统配置]
|
||||
串口号=com2
|
||||
波特率=1200
|
||||
校验位=0
|
||||
数据位=8
|
||||
停止位=0
|
||||
频率=100
|
||||
0
布匹仓库2/JZCRS323CList.txt
Normal file
0
布匹仓库2/JZCRS323CList.txt
Normal file
23
布匹仓库2/ProjectGroup1.bpg
Normal file
23
布匹仓库2/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)
|
||||
|
||||
|
||||
36
布匹仓库2/ProjectGroup1.groupproj
Normal file
36
布匹仓库2/ProjectGroup1.groupproj
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{81E44A4B-34A6-458A-A2FC-E3AB93F7C9F8}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Projects Include="testDll.dproj">
|
||||
<Dependencies/>
|
||||
</Projects>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Default.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType/>
|
||||
<BorlandProject>
|
||||
<Default.Personality/>
|
||||
</BorlandProject>
|
||||
</ProjectExtensions>
|
||||
<Target Name="testDll">
|
||||
<MSBuild Projects="testDll.dproj"/>
|
||||
</Target>
|
||||
<Target Name="testDll:Clean">
|
||||
<MSBuild Projects="testDll.dproj" Targets="Clean"/>
|
||||
</Target>
|
||||
<Target Name="testDll:Make">
|
||||
<MSBuild Projects="testDll.dproj" Targets="Make"/>
|
||||
</Target>
|
||||
<Target Name="Build">
|
||||
<CallTarget Targets="testDll"/>
|
||||
</Target>
|
||||
<Target Name="Clean">
|
||||
<CallTarget Targets="testDll:Clean"/>
|
||||
</Target>
|
||||
<Target Name="Make">
|
||||
<CallTarget Targets="testDll:Make"/>
|
||||
</Target>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
|
||||
</Project>
|
||||
6
布匹仓库2/ProjectGroup1.groupproj.local
Normal file
6
布匹仓库2/ProjectGroup1.groupproj.local
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject>
|
||||
<Default.Personality>
|
||||
<Projects ActiveProject="D:\Dp7Repo\项目代码\呈协\布匹仓库2\testDll.dproj"/>
|
||||
</Default.Personality>
|
||||
</BorlandProject>
|
||||
42
布匹仓库2/Repertory.cfg
Normal file
42
布匹仓库2/Repertory.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
布匹仓库2/Repertory.dof
Normal file
138
布匹仓库2/Repertory.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:\Dp7Repo\淃커덜쯤\너葵\꼈튈꾑욋2\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
|
||||
49
布匹仓库2/Repertory.dpr
Normal file
49
布匹仓库2/Repertory.dpr
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
library Repertory;
|
||||
|
||||
uses
|
||||
SysUtils,
|
||||
classes,
|
||||
forms,
|
||||
WinTypes,
|
||||
WinProcs,
|
||||
MidasLib,
|
||||
U_GetDllForm in 'U_GetDllForm.pas',
|
||||
U_RTFun in '..\..\..\RTFunAndForm\Fun\U_RTFun.pas',
|
||||
U_ModuleNote in 'U_ModuleNote.pas' {frmModuleNote},
|
||||
U_DataLink in 'U_DataLink.pas' {DataLink_Repertory: TDataModule},
|
||||
U_ZDYHelpSel in 'U_ZDYHelpSel.pas' {frmZDYHelpSel},
|
||||
U_iniParam in 'U_iniParam.pas',
|
||||
U_ZDYHelp in 'U_ZDYHelp.pas' {frmZDYHelp},
|
||||
U_Fun10 in '..\..\..\ThreeFun\Fun\U_Fun10.pas',
|
||||
U_RTZDYHelp in '..\..\..\RTFunAndForm\Form\U_RTZDYHelp.pas' {frmRTZDYHelp},
|
||||
U_Fun in '..\..\..\ThreeFun\Fun\U_Fun.pas',
|
||||
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_SelPrintField in '..\..\..\ThreeFun\Form\U_SelPrintField.pas' {frmSelPrintField},
|
||||
U_SelPrintFieldNew in '..\..\..\ThreeFun\Form\U_SelPrintFieldNew.pas' {frmSelPrintFieldNew};
|
||||
|
||||
{$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
布匹仓库2/Repertory.res
Normal file
BIN
布匹仓库2/Repertory.res
Normal file
Binary file not shown.
3
布匹仓库2/SYSTEMSET.ini
Normal file
3
布匹仓库2/SYSTEMSET.ini
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[SERVER]
|
||||
服务器地址=172.168.1.246
|
||||
软件名称=欣戈纺织
|
||||
253
布匹仓库2/U_CPCKMXLR.dfm
Normal file
253
布匹仓库2/U_CPCKMXLR.dfm
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
object frmCPCKMXLR: TfrmCPCKMXLR
|
||||
Left = 360
|
||||
Top = 179
|
||||
Width = 1000
|
||||
Height = 601
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = #25104#21697#20986#24211#26126#32454#21015#34920
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 984
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
Caption = #19968#38190#26367#25442
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 272
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 984
|
||||
Height = 534
|
||||
Align = alClient
|
||||
Caption = 'Panel3'
|
||||
TabOrder = 1
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 982
|
||||
Height = 532
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TvMX: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
Column = cxGridDBColumn8
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn8
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn8
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
OptionsView.IndicatorWidth = 33
|
||||
OnCustomDrawIndicatorCell = TvMXCustomDrawIndicatorCell
|
||||
object vMXColumn1: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'MXGangHao'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 102
|
||||
end
|
||||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'MXQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 117
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TvMX
|
||||
end
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 372
|
||||
Top = 234
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 411
|
||||
Top = 234
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 663
|
||||
Top = 391
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 592
|
||||
Top = 393
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 188
|
||||
Top = 229
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 447
|
||||
Top = 235
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 158
|
||||
Top = 229
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 401
|
||||
Top = 279
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = 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 = 475
|
||||
Top = 278
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 439
|
||||
Top = 278
|
||||
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 = 508
|
||||
Top = 277
|
||||
end
|
||||
end
|
||||
306
布匹仓库2/U_CPCKMXLR.pas
Normal file
306
布匹仓库2/U_CPCKMXLR.pas
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
unit U_CPCKMXLR;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, MMSystem,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit,
|
||||
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, BtnEdit, cxContainer,
|
||||
cxTextEdit, cxCurrencyEdit, cxCheckBox, Menus, RM_Common, RM_Class, RM_e_Xls,
|
||||
RM_Dataset, RM_System, RM_GridReport;
|
||||
|
||||
type
|
||||
TfrmCPCKMXLR = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Panel3: TPanel;
|
||||
ADOQueryMain: TADOQuery;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
cxGrid2: TcxGrid;
|
||||
TvMX: TcxGridDBTableView;
|
||||
vMXColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn8: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
ToolButton3: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FHAddressBtnDnClick(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
function savedate(): Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO, FMXGangHao: string;
|
||||
FType: integer;
|
||||
fCKName: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPCKMXLR: TfrmCPCKMXLR;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_CPKcList, U_ZdyAttachment, U_ZDYHelpSel,
|
||||
U_ClothGMListSel, U_ZdyAttachGYS, U_CPManageSel;
|
||||
{$R *.dfm}
|
||||
|
||||
function TfrmCPCKMXLR.savedate(): Boolean;
|
||||
var
|
||||
MaxNo: string;
|
||||
begin
|
||||
result := false;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
CDS_Main.DisableControls;
|
||||
CDS_Main.First;
|
||||
with CDS_Main do
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CRMX');
|
||||
sql.Add('where MXID=' + quotedstr(Trim(CDS_Main.FieldByName('MXID').AsString)));
|
||||
open;
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTmp, MaxNo, 'MCM', 'CK_ML_CRMX', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxNo := Trim(CDS_Main.FieldByName('MXID').AsString);
|
||||
ADOQueryCmd.Edit;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
//保存明细
|
||||
RTSetSaveDataCDS(ADOQueryCmd, TvMX, CDS_Main, 'CK_ML_CRMX', 0);
|
||||
|
||||
//保存隐藏ID
|
||||
ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNo);
|
||||
ADOQueryCmd.FieldByName('MXID').Value := trim(MaxNo);
|
||||
|
||||
ADOQueryCmd.Post;
|
||||
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.FieldByName('MXID').Value := trim(MaxNo);
|
||||
CDS_Main.post;
|
||||
|
||||
//更新库存
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MlKcByMx ' + quotedstr(trim(fkeyNo)));
|
||||
Open;
|
||||
end;
|
||||
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('入库数量少于出库数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CDS_Main.next;
|
||||
end;
|
||||
end;
|
||||
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result := true;
|
||||
except
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.InitGrid();
|
||||
begin
|
||||
try
|
||||
with adoqueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CRMX where CRNO=' + quotedstr(trim(fkeyNO)));
|
||||
sql.Add(' order by MXID');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryMain, CDS_Main);
|
||||
SInitCDSData20(adoqueryMain, CDS_Main);
|
||||
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPCKMXLR := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.FormShow(Sender: TObject);
|
||||
var
|
||||
fbhType, fInoutNo: string;
|
||||
begin
|
||||
readCxGrid(self.Caption, TvMX, '面料仓库');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
ToolBar1.SetFocus;
|
||||
if savedate() then
|
||||
begin
|
||||
application.MessageBox('数据保存成功!', '提示信息');
|
||||
end
|
||||
else
|
||||
begin
|
||||
application.MessageBox('数据保存失败!', '提示信息', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'Cloth';
|
||||
flagname := '坯布名称';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
writeCxGrid(self.Caption, TvMX, '面料仓库');
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.FHAddressBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text := '';
|
||||
TBtnEditC(Sender).TxtCode := '';
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 1 to 10 do
|
||||
begin
|
||||
with CDS_Main do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('MXGangHao').Value := FMXGangHao;
|
||||
FieldByName('MXQty').Value := 0;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CK_ML_CRMX where MXID=' + quotedstr(Trim(CDS_Main.FieldByName('MXID').AsString)));
|
||||
ExecSQL;
|
||||
end;
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||||
var
|
||||
FValue: string;
|
||||
FBounds: TRect;
|
||||
begin
|
||||
FBounds := AViewInfo.Bounds;
|
||||
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
||||
begin
|
||||
ACanvas.FillRect(FBounds);
|
||||
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
|
||||
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
||||
InflateRect(FBounds, -1, -1); //Platform specific. May not work on Linux.
|
||||
ACanvas.Font.Color := clBlack;
|
||||
ACanvas.Brush.Style := bsClear;
|
||||
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
||||
ADone := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCKMXLR.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
OneKeyPost(TvMX,CDS_Main);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
1054
布匹仓库2/U_CPCKlist.dfm
Normal file
1054
布匹仓库2/U_CPCKlist.dfm
Normal file
File diff suppressed because it is too large
Load Diff
1001
布匹仓库2/U_CPCKlist.pas
Normal file
1001
布匹仓库2/U_CPCKlist.pas
Normal file
File diff suppressed because it is too large
Load Diff
567
布匹仓库2/U_CPCk.dfm
Normal file
567
布匹仓库2/U_CPCk.dfm
Normal file
|
|
@ -0,0 +1,567 @@
|
|||
object frmCPCk: TfrmCPCk
|
||||
Left = 254
|
||||
Top = 89
|
||||
Width = 1230
|
||||
Height = 638
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = #25104#21697#20986#24211
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1214
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 1214
|
||||
Height = 92
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#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 = 224
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 38
|
||||
Top = 43
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 224
|
||||
Top = 43
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#21040#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label26: TLabel
|
||||
Left = 415
|
||||
Top = 19
|
||||
Width = 47
|
||||
Height = 12
|
||||
Caption = #24065' '#31181
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 414
|
||||
Top = 44
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #21457#24448#21333#20301
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object CRTime: TDateTimePicker
|
||||
Left = 90
|
||||
Top = 13
|
||||
Width = 100
|
||||
Height = 20
|
||||
Date = 41509.970132187500000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 41509.970132187500000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object CRType: TComboBox
|
||||
Left = 280
|
||||
Top = 12
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
TabOrder = 0
|
||||
Items.Strings = (
|
||||
#29983#20135#20986#24211
|
||||
#21152#24037#20986#24211
|
||||
#38144#21806#20986#24211
|
||||
#25439#32791#20986#24211
|
||||
#36864#36135#20986#24211
|
||||
#22238#20462#20986#24211
|
||||
#26080#35746#21333#21495#20986#24211)
|
||||
end
|
||||
object InoutNo: TEdit
|
||||
Left = 90
|
||||
Top = 39
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
end
|
||||
object ToFactoryName: TBtnEditA
|
||||
Left = 280
|
||||
Top = 39
|
||||
Width = 101
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 4
|
||||
OnBtnClick = ToFactoryNameBtnClick
|
||||
end
|
||||
object BZType: TComboBox
|
||||
Left = 471
|
||||
Top = 15
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
ItemIndex = 0
|
||||
TabOrder = 2
|
||||
Text = 'RMB'
|
||||
Visible = False
|
||||
Items.Strings = (
|
||||
'RMB'
|
||||
'USD'
|
||||
'EUR')
|
||||
end
|
||||
object fwdw: TEdit
|
||||
Left = 468
|
||||
Top = 41
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 121
|
||||
Width = 1214
|
||||
Height = 30
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 151
|
||||
Width = 1214
|
||||
Height = 448
|
||||
Align = alClient
|
||||
Caption = 'Panel3'
|
||||
TabOrder = 3
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 1212
|
||||
Height = 446
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 0
|
||||
object Tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
Column = v1P_CodeName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Qty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Money
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1MJID
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #25351#31034#21333#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = False
|
||||
Properties.OnButtonClick = v1Column3PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #23384#25918#24037#21378
|
||||
DataBinding.FieldName = 'FactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 64
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #26469#33258#24037#21378
|
||||
DataBinding.FieldName = 'fromFactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 61
|
||||
end
|
||||
object v1P_Code: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'P_Code'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 73
|
||||
end
|
||||
object v1P_CodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_CodeName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1P_CodeNamePropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 86
|
||||
end
|
||||
object v1P_SPEC: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'P_SPEC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 73
|
||||
end
|
||||
object v1P_Color: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'P_Color'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 60
|
||||
end
|
||||
object v1P_MF: TcxGridDBColumn
|
||||
Caption = #38376#24133'(cm)'
|
||||
DataBinding.FieldName = 'P_MF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
VisibleForCustomization = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_KZ: TcxGridDBColumn
|
||||
Caption = #20811#37325'(g/'#13217')'
|
||||
DataBinding.FieldName = 'P_KZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
VisibleForCustomization = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #23458#25143#27454#21495
|
||||
DataBinding.FieldName = 'KeHuKuanHao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 78
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'ganghao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1MJID: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'Rollnum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 60
|
||||
end
|
||||
object v1QtyUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'QtyUnit'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
'M'
|
||||
'Kg')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 65
|
||||
end
|
||||
object v1Price: TcxGridDBColumn
|
||||
Caption = #21333#20215
|
||||
DataBinding.FieldName = 'Price'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Money: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'Money'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 64
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24211#20301
|
||||
DataBinding.FieldName = 'kuwei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 132
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 372
|
||||
Top = 234
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 411
|
||||
Top = 234
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 663
|
||||
Top = 391
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 592
|
||||
Top = 393
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 192
|
||||
Top = 257
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 447
|
||||
Top = 235
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 162
|
||||
Top = 258
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 401
|
||||
Top = 282
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = 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 = 478
|
||||
Top = 278
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 443
|
||||
Top = 278
|
||||
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 = 514
|
||||
Top = 279
|
||||
end
|
||||
end
|
||||
544
布匹仓库2/U_CPCk.pas
Normal file
544
布匹仓库2/U_CPCk.pas
Normal file
|
|
@ -0,0 +1,544 @@
|
|||
unit U_CPCk;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, MMSystem,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit,
|
||||
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, BtnEdit, cxContainer,
|
||||
cxTextEdit, cxCurrencyEdit, cxCheckBox, Menus, RM_Common, RM_Class, RM_e_Xls,
|
||||
RM_Dataset, RM_System, RM_GridReport, cxLookAndFeels,
|
||||
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
|
||||
dxSkinscxPCPainter, cxNavigator, dxSkinBlack, dxSkinBlue,
|
||||
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
||||
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle,
|
||||
dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary,
|
||||
dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin,
|
||||
dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
||||
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
||||
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
||||
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
||||
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
||||
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
||||
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
||||
dxSkinTheAsphaltWorld, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
|
||||
dxSkinXmas2008Blue;
|
||||
|
||||
type
|
||||
TfrmCPCk = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
CRTime: TDateTimePicker;
|
||||
Label2: TLabel;
|
||||
CRType: TComboBox;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Label8: TLabel;
|
||||
InoutNo: TEdit;
|
||||
Label9: TLabel;
|
||||
ToFactoryName: TBtnEditA;
|
||||
Panel3: TPanel;
|
||||
ADOQueryMain: TADOQuery;
|
||||
Label26: TLabel;
|
||||
BZType: TComboBox;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1MJID: TcxGridDBColumn;
|
||||
v1P_Code: TcxGridDBColumn;
|
||||
v1P_CodeName: TcxGridDBColumn;
|
||||
v1P_SPEC: TcxGridDBColumn;
|
||||
v1P_Color: TcxGridDBColumn;
|
||||
v1Price: TcxGridDBColumn;
|
||||
v1P_MF: TcxGridDBColumn;
|
||||
v1P_KZ: TcxGridDBColumn;
|
||||
v1Qty: TcxGridDBColumn;
|
||||
v1QtyUnit: TcxGridDBColumn;
|
||||
v1Money: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
fwdw: TEdit;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure ToFactoryNameBtnClick(Sender: TObject);
|
||||
procedure v1QtyPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure FHAddressBtnDnClick(Sender: TObject);
|
||||
procedure v1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure v1Column5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
function savedate(): Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO: string;
|
||||
FType: integer;
|
||||
fCKName: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPCk: TfrmCPCk;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_CPKcList, U_ZdyAttachment, U_ZDYHelpSel,
|
||||
U_ClothGMListSel, U_ZdyAttachGYS;
|
||||
{$R *.dfm}
|
||||
|
||||
function TfrmCPCk.savedate(): Boolean;
|
||||
var
|
||||
MaxNo: string;
|
||||
begin
|
||||
result := false;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
CDS_Main.DisableControls;
|
||||
CDS_Main.First;
|
||||
with CDS_Main do
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CR');
|
||||
sql.Add('where CRNO=' + quotedstr(Trim(CDS_Main.FieldByName('CRNO').AsString)));
|
||||
open;
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTmp, MaxNo, 'MC', 'CK_ML_CR', 3, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('Filler').Value := trim(DName);
|
||||
ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(SGetServerDateTime(adoqueryTmp));
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxNo := Trim(CDS_Main.FieldByName('CRNO').AsString);
|
||||
ADOQueryCmd.Edit;
|
||||
ADOQueryCmd.FieldByName('editer').Value := trim(dName);
|
||||
ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp);
|
||||
end;
|
||||
|
||||
ADOQueryCmd.FieldByName('inoutNo').Value := trim(inoutNo.Text);
|
||||
ADOQueryCmd.FieldByName('CRNO').Value := trim(MaxNo);
|
||||
ADOQueryCmd.FieldByName('CKName').Value := '成品';
|
||||
ADOQueryCmd.FieldByName('BZType').Value := trim(BZType.Text);
|
||||
ADOQueryCmd.FieldByName('ToFactoryName').Value := trim(ToFactoryName.Text);
|
||||
ADOQueryCmd.FieldByName('fwdw').Value := trim(fwdw.Text);
|
||||
ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date);
|
||||
ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text);
|
||||
ADOQueryCmd.FieldByName('CRFlag').Value := '出库';
|
||||
ADOQueryCmd.FieldByName('CRQtyFlag').Value := -1;
|
||||
|
||||
//保存明细
|
||||
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Main, 'CK_ML_CR', 0);
|
||||
|
||||
//保存隐藏ID
|
||||
ADOQueryCmd.FieldByName('mainID').Value := trim(fieldbyname('mainID').AsString);
|
||||
ADOQueryCmd.FieldByName('subID').Value := trim(fieldbyname('subID').AsString);
|
||||
ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString);
|
||||
ADOQueryCmd.FieldByName('ISRCCK').Value := trim(fieldbyname('ISRCCK').AsString);
|
||||
ADOQueryCmd.Post;
|
||||
|
||||
//插入库存
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MLKc ' + quotedstr(trim(CDS_Main.fieldbyname('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('入库数量少于出库数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Edit;
|
||||
FieldByName('CRNO').Value := trim(MaxNo);
|
||||
post;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result := true;
|
||||
except
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.InitGrid();
|
||||
begin
|
||||
try
|
||||
with adoqueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* from CK_ML_CR A');
|
||||
sql.Add('where A.CRNO=' + quotedstr(trim(fkeyNO)));
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryMain, CDS_Main);
|
||||
SInitCDSData20(adoqueryMain, CDS_Main);
|
||||
if not CDS_Main.IsEmpty then
|
||||
begin
|
||||
CRTime.Date := CDS_Main.fieldbyname('CRTime').AsDateTime;
|
||||
CRType.ItemIndex := CRType.Items.IndexOf(trim(CDS_Main.fieldbyname('CRType').AsString));
|
||||
BZType.ItemIndex := BZType.Items.IndexOf(trim(CDS_Main.fieldbyname('BZType').AsString));
|
||||
InoutNO.Text := trim(CDS_Main.fieldbyname('InoutNO').AsString);
|
||||
ToFactoryName.Text := trim(CDS_Main.fieldbyname('ToFactoryName').AsString);
|
||||
fwdw.Text := trim(CDS_Main.fieldbyname('fwdw').AsString);
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPCk := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.FormCreate(Sender: TObject);
|
||||
begin
|
||||
CRTime.Date := SGetServerDate10(ADOQueryTmp);
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.FormShow(Sender: TObject);
|
||||
var
|
||||
fbhType, fInoutNo: string;
|
||||
begin
|
||||
readCxGrid(self.Caption + tv1.Name, Tv1, '面料仓库');
|
||||
InitGrid();
|
||||
if fType = 0 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd, fkeyNo, 'MCK', 'CK_ML_CR', 3, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
inoutNo.Text := trim(fkeyNo);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
CRTime.SetFocus;
|
||||
if trim(CRType.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('出库类型不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if trim(ToFactoryName.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('出到工厂不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if cds_main.Locate('QtyUnit', '', []) then
|
||||
begin
|
||||
application.MessageBox('数量单位不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if cds_main.Locate('QtyUnit', NULL, []) then
|
||||
begin
|
||||
application.MessageBox('数量单位不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if savedate() then
|
||||
begin
|
||||
application.MessageBox('数据保存成功!', '提示信息');
|
||||
end
|
||||
else
|
||||
begin
|
||||
application.MessageBox('数据保存失败!', '提示信息', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'Cloth';
|
||||
flagname := '坯布名称';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FMJID: string;
|
||||
begin
|
||||
frmCPKcList := TfrmCPKcList.create(self);
|
||||
with frmCPKcList do
|
||||
begin
|
||||
fType := 10;
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
cds_main.DisableControls;
|
||||
cds_main.First;
|
||||
while not cds_main.Eof do
|
||||
begin
|
||||
if (cds_main.fieldbyname('ssel').AsBoolean) and (not self.cds_main.Locate('MJID', trim(cds_main.fieldbyname('MJID').AsString), [])) then
|
||||
begin
|
||||
self.cds_main.Append;
|
||||
self.cds_main.FieldByName('OrderNo').Value := trim(cds_main.fieldbyname('OrderNo').AsString);
|
||||
self.cds_main.FieldByName('mainID').Value := trim(cds_main.fieldbyname('mainID').AsString);
|
||||
self.cds_main.FieldByName('subID').Value := trim(cds_main.fieldbyname('subID').AsString);
|
||||
self.cds_main.fieldbyname('JGId').Value := trim(cds_main.fieldbyname('JGId').AsString);
|
||||
self.cds_main.fieldbyname('fromFactoryName').Value := trim(cds_main.fieldbyname('fromFactoryName').AsString);
|
||||
self.cds_main.fieldbyname('FactoryName').Value := trim(cds_main.fieldbyname('FactoryName').AsString);
|
||||
self.cds_main.FieldByName('MJID').Value := trim(cds_main.fieldbyname('MJID').AsString);
|
||||
self.cds_main.FieldByName('MJXH').Value := trim(cds_main.fieldbyname('MJXH').AsString);
|
||||
self.cds_main.FieldByName('CPTYPE').Value := trim(cds_main.fieldbyname('CPTYPE').AsString);
|
||||
self.cds_main.FieldByName('P_Code').Value := trim(cds_main.fieldbyname('P_Code').AsString);
|
||||
self.cds_main.FieldByName('P_CodeName').Value := trim(cds_main.fieldbyname('P_CodeName').AsString);
|
||||
self.cds_main.FieldByName('kuwei').Value := trim(cds_main.fieldbyname('kuwei').AsString);
|
||||
self.cds_main.FieldByName('P_spec').Value := trim(cds_main.fieldbyname('P_spec').AsString);
|
||||
self.cds_main.FieldByName('P_Color').Value := trim(cds_main.fieldbyname('P_Color').AsString);
|
||||
self.cds_main.FieldByName('KeHuKuanHao').Value := trim(cds_main.fieldbyname('PrtKuanNO').AsString);
|
||||
self.cds_main.FieldByName('P_MF').Value := trim(cds_main.fieldbyname('P_MF').AsString);
|
||||
self.cds_main.FieldByName('P_KZ').Value := trim(cds_main.fieldbyname('P_KZ').AsString);
|
||||
self.cds_main.FieldByName('ganghao').Value := trim(cds_main.fieldbyname('ganghao').AsString);
|
||||
self.cds_main.FieldByName('RollNum').Value := cds_main.fieldbyname('RollNum').AsFloat;
|
||||
self.cds_main.FieldByName('Qty').Value := cds_main.fieldbyname('Qty').AsFloat;
|
||||
self.cds_main.FieldByName('QtyUnit').Value := trim(cds_main.fieldbyname('QtyUnit').AsString);
|
||||
self.cds_main.FieldByName('ISRCCK').Value := trim(cds_main.fieldbyname('ISRCCK').AsString);
|
||||
self.cds_main.FieldByName('Price').Value := 0;
|
||||
self.cds_main.FieldByName('Money').Value := 0;
|
||||
self.cds_main.Post;
|
||||
end;
|
||||
cds_main.Next;
|
||||
end;
|
||||
cds_main.EnableControls;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
writeCxGrid(self.Caption + tv1.Name, Tv1, '面料仓库');
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.ToFactoryNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (trim(CRType.Text) = '加工出库') or (trim(CRType.Text) = '生产出库') or (trim(CRType.Text) = '退货出库') or (trim(CRType.Text) = '回修出库') then
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
ToFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
fwdw.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachGYS.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
try
|
||||
frmZdyAttachment := TfrmZdyAttachment.Create(Application);
|
||||
with frmZdyAttachment do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
ToFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
fwdw.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachment.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.v1QtyPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue, FFieldName: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '0';
|
||||
end;
|
||||
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||
with CDS_Main do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FFieldName).Value := Trim(mvalue);
|
||||
FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]);
|
||||
Post;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.FHAddressBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text := '';
|
||||
TBtnEditC(Sender).TxtCode := '';
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.v1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmClothGMListSel := TfrmClothGMListSel.Create(Application);
|
||||
with frmClothGMListSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.fieldbyname('OrderNo').Value := trim(Order_Main.fieldbyname('OrderNo').AsString);
|
||||
CDS_Main.fieldbyname('MainID').Value := trim(Order_Main.fieldbyname('MainID').AsString);
|
||||
CDS_Main.fieldbyname('subID').Value := trim(Order_Main.fieldbyname('subID').AsString);
|
||||
CDS_Main.Post;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.v1Column5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'MLType';
|
||||
flagname := '面料类型';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.FieldByName('P_Type').Value := Trim(ClientDataSet1.fieldbyname('zdyName').AsString);
|
||||
CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if Trim(CDS_Main.FieldByName('CRNO').AsString) = '' then
|
||||
begin
|
||||
CDS_Main.Delete;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
if Trim(CDS_Main.FieldByName('ISRCCK').AsString) = '染厂发货' then
|
||||
begin
|
||||
sql.Add('update CK_ML_CR set Valid=''N'' where MJID=' + quotedstr(Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
end
|
||||
else
|
||||
begin
|
||||
sql.Add('update CK_ML_CR set Valid=''N'' where CRNO=' + quotedstr(Trim(CDS_Main.FieldByName('CRNO').AsString)));
|
||||
end;
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_mlKc ' + quotedstr(Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('出库数量超出库存数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmCPCk.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
657
布匹仓库2/U_CPKcList.dfm
Normal file
657
布匹仓库2/U_CPKcList.dfm
Normal file
|
|
@ -0,0 +1,657 @@
|
|||
object frmCPKcList: TfrmCPKcList
|
||||
Left = 182
|
||||
Top = 173
|
||||
Width = 1290
|
||||
Height = 643
|
||||
Caption = #24211#23384#20449#24687#34920
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
WindowState = wsMaximized
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Label7: TLabel
|
||||
Left = 268
|
||||
Top = 16
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35268#26684#22411#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1274
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 119
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TOk: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #30830#23450
|
||||
ImageIndex = 31
|
||||
Visible = False
|
||||
OnClick = TOkClick
|
||||
end
|
||||
object TBRafresh: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
Caption = #21152#24037#21378#30721#21333#30830#35748
|
||||
ImageIndex = 22
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 308
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #24211#20301#35843#25972
|
||||
ImageIndex = 102
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 395
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 68
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 458
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1274
|
||||
Height = 66
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 49
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 389
|
||||
Top = 16
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #39068' '#33394
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 389
|
||||
Top = 40
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #24211' '#20301
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 48
|
||||
Top = 16
|
||||
Width = 53
|
||||
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 Label13: TLabel
|
||||
Left = 445
|
||||
Top = 16
|
||||
Width = 6
|
||||
Height = 12
|
||||
end
|
||||
object Label18: TLabel
|
||||
Left = 213
|
||||
Top = 16
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label31: TLabel
|
||||
Left = 214
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #23384#25918#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 553
|
||||
Top = 16
|
||||
Width = 47
|
||||
Height = 12
|
||||
Caption = #32568' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl2: TLabel
|
||||
Left = 550
|
||||
Top = 41
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20837#24211#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object P_CodeName: TEdit
|
||||
Tag = 2
|
||||
Left = 105
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object P_Color: TEdit
|
||||
Tag = 2
|
||||
Left = 449
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object kuwei: TEdit
|
||||
Tag = 1
|
||||
Left = 449
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object orderNo: TEdit
|
||||
Tag = 2
|
||||
Left = 105
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object P_Code: TEdit
|
||||
Tag = 2
|
||||
Left = 269
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object FactoryName: TEdit
|
||||
Tag = 2
|
||||
Left = 269
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object ganghao: TEdit
|
||||
Tag = 2
|
||||
Left = 605
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object INoutNo: TEdit
|
||||
Tag = 2
|
||||
Left = 605
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 7
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 129
|
||||
Width = 1274
|
||||
Height = 475
|
||||
Align = alClient
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBtnShadow
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
OnCustomDrawCell = Tv1CustomDrawCell
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
Column = v1P_CodeName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Qty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1MJID
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
object v1Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 48
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #20837#24211#21333#21495
|
||||
DataBinding.FieldName = 'INoutNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #35746#21333#21495
|
||||
DataBinding.FieldName = 'orderNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1CRTime: TcxGridDBColumn
|
||||
Caption = #20837#24211#26085#26399
|
||||
DataBinding.FieldName = 'CRTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 74
|
||||
end
|
||||
object v1CRType: TcxGridDBColumn
|
||||
Caption = #20837#24211#31867#22411
|
||||
DataBinding.FieldName = 'CRType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 81
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'P_Code'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1P_CodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_CodeName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 91
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Caption = #23384#25918#24037#21378
|
||||
DataBinding.FieldName = 'FactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 93
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #27454#21495
|
||||
DataBinding.FieldName = 'PrtKuanNO'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 71
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'P_Color'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'p_mf'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1P_SPEC: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'P_SPEC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'p_kz'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #24211#20301
|
||||
DataBinding.FieldName = 'kuwei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
end
|
||||
object v1MJID: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'Rollnum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 70
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 70
|
||||
end
|
||||
object v1QtyUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'QtyUnit'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
'M'
|
||||
'Kg')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'isph'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
VisibleForCustomization = False
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #26469#33258#24037#21378
|
||||
DataBinding.FieldName = 'fromFactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 57
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'ganghao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 59
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #25968#25454#31867#22411
|
||||
DataBinding.FieldName = 'ISRCCK'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 69
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'IsXGKC'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object tt: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'tt'
|
||||
Visible = False
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 0
|
||||
Top = 98
|
||||
Width = 1274
|
||||
Height = 31
|
||||
Align = alTop
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object Label1: TLabel
|
||||
Left = 16
|
||||
Top = 10
|
||||
Width = 26
|
||||
Height = 12
|
||||
Caption = #24211#20301
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 323
|
||||
Top = 3
|
||||
Width = 75
|
||||
Height = 21
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object edtKuWei: TBtnEditA
|
||||
Left = 49
|
||||
Top = 6
|
||||
Width = 200
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 1
|
||||
OnBtnClick = edtKuWeiBtnClick
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 391
|
||||
Top = 230
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 352
|
||||
Top = 225
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 619
|
||||
Top = 233
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 569
|
||||
Top = 231
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 617
|
||||
Top = 307
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 427
|
||||
Top = 391
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 474
|
||||
Top = 391
|
||||
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 = 517
|
||||
Top = 392
|
||||
ReportData = {}
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 303
|
||||
Top = 223
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 381
|
||||
Top = 300
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N3: TMenuItem
|
||||
Caption = #22797#21046
|
||||
OnClick = N3Click
|
||||
end
|
||||
end
|
||||
end
|
||||
324
布匹仓库2/U_CPKcList.pas
Normal file
324
布匹仓库2/U_CPKcList.pas
Normal file
|
|
@ -0,0 +1,324 @@
|
|||
unit U_CPKcList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
||||
cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
|
||||
RM_Common, RM_Class, RM_GridReport, RM_System, RM_Dataset, MMSystem, Menus,
|
||||
BtnEdit, Clipbrd, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
|
||||
dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
||||
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans,
|
||||
dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
|
||||
dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
||||
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
||||
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
||||
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
||||
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
||||
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
||||
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
||||
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
||||
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
||||
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter,
|
||||
cxNavigator;
|
||||
|
||||
type
|
||||
TfrmCPKcList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBExport: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1P_CodeName: TcxGridDBColumn;
|
||||
v1P_SPEC: TcxGridDBColumn;
|
||||
v1Qty: TcxGridDBColumn;
|
||||
v1QtyUnit: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1CRType: TcxGridDBColumn;
|
||||
v1CRTime: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
P_CodeName: TEdit;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
TOk: TToolButton;
|
||||
v1Ssel: TcxGridDBColumn;
|
||||
v1MJID: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label7: TLabel;
|
||||
P_Color: TEdit;
|
||||
Label8: TLabel;
|
||||
Label9: TLabel;
|
||||
kuwei: TEdit;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
orderNo: TEdit;
|
||||
Label10: TLabel;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
RM1: TRMGridReport;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
ADOQueryMain: TADOQuery;
|
||||
Label13: TLabel;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
P_Code: TEdit;
|
||||
Label18: TLabel;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
Label31: TLabel;
|
||||
FactoryName: TEdit;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
ToolButton2: TToolButton;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
Panel2: TPanel;
|
||||
Label1: TLabel;
|
||||
Button1: TButton;
|
||||
edtKuWei: TBtnEditA;
|
||||
ToolButton1: TToolButton;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
ToolButton3: TToolButton;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
tt: TcxGridDBColumn;
|
||||
N3: TMenuItem;
|
||||
lbl1: TLabel;
|
||||
ganghao: TEdit;
|
||||
lbl2: TLabel;
|
||||
INoutNo: TEdit;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure P_CodeNameChange(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TOkClick(Sender: TObject);
|
||||
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure edtKuWeiBtnClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure N3Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
procedure SetStatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
fType: integer;
|
||||
fCKName: string;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPKcList: TfrmCPKcList;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_MLRk;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPKcList.SetStatus();
|
||||
begin
|
||||
if fType = 10 then
|
||||
begin
|
||||
TOk.Visible := true;
|
||||
v1Ssel.Visible := true;
|
||||
ToolButton1.Visible := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.InitGrid();
|
||||
begin
|
||||
CDS_Main.DisableControls;
|
||||
try
|
||||
with adoqueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
sql.Add(' ,PrtKuanNO=(select PrtKuanNO from JYOrder_Sub X where X.SubId=A.SubId) ');
|
||||
// sql.Add(' , pp=(select MIN(CRQtyFlag) from CK_ML_cr B where B.MJID=A.MJID AND B.CKName=''成品'' and B.Valid=''Y'')');
|
||||
sql.Add(',tt=(case when (select MIN(CRQtyFlag) from CK_ML_cr B where B.MJID=A.MJID AND B.CKName=''成品'' and B.Valid=''Y'')=''-1'' and qty>0 then 1 else 0 end )');
|
||||
SQL.Add(' from CK_ML_KC A ');
|
||||
sql.Add(' where A.Qty<>0 and CKName=''成品'' ');
|
||||
sql.ADD(' and exists(select * from CK_ML_CR X where X.Valid=''Y'' and X.MJID=A.MJID )');
|
||||
sql.Add(' order by A.CRTime desc,A.CRNO desc');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryMain, CDS_Main);
|
||||
SInitCDSData20(adoqueryMain, CDS_Main);
|
||||
finally
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
writeCxGrid(self.Caption + tv1.Name, Tv1, '面料仓库');
|
||||
if fType = 10 then
|
||||
Action := cahide
|
||||
else
|
||||
Action := cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPKcList := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.P_CodeNameChange(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 TfrmCPKcList.FormShow(Sender: TObject);
|
||||
begin
|
||||
readCxGrid(self.Caption + tv1.Name, Tv1, '面料仓库');
|
||||
SetStatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
TcxGridToExcel(self.Caption, cxgrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.TOkClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
||||
begin
|
||||
if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('ISRCCK').index] = '染厂发货' then
|
||||
// ACanvas.Brush.Color := $B9DAFF;
|
||||
ACanvas.Brush.Color := $00FFFF;
|
||||
// if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('IsXGKC').index] = '是' then
|
||||
// ACanvas.Brush.Color := $F0CAA6;
|
||||
if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('tt').index] = '1' then
|
||||
ACanvas.Brush.Color := $F0CAA6;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, true);
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, false);
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.edtKuWeiBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'kuwei';
|
||||
flagname := '库位';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
edtKuWei.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.ToolButton2Click(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 TfrmCPKcList.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if Panel2.Visible = False then
|
||||
Panel2.Visible := True
|
||||
else
|
||||
Panel2.Visible := False;
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.Button1Click(Sender: TObject);
|
||||
begin
|
||||
if trim(edtKuWei.Text) = '' then
|
||||
exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
while CDS_Main.Locate('SSel', true, []) do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update CK_ML_KC set kuwei=' + quotedstr(trim(edtKuWei.Text)));
|
||||
sql.Add(' where mjid=' + quotedstr(trim(CDS_Main.FieldByName('mjid').AsString)));
|
||||
execsql;
|
||||
end;
|
||||
with CDS_Main do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('SSel').Value := false;
|
||||
FieldByName('KuWei').Value := trim(edtKuWei.Text);
|
||||
|
||||
end;
|
||||
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
end
|
||||
end;
|
||||
|
||||
procedure TfrmCPKcList.N3Click(Sender: TObject);
|
||||
begin
|
||||
Clipboard.SetTextBuf(PChar(Trim(CDS_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString)));
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
527
布匹仓库2/U_CPManageSel.dfm
Normal file
527
布匹仓库2/U_CPManageSel.dfm
Normal file
|
|
@ -0,0 +1,527 @@
|
|||
object frmCPManageSel: TfrmCPManageSel
|
||||
Left = 351
|
||||
Top = 99
|
||||
Width = 1382
|
||||
Height = 754
|
||||
Align = alClient
|
||||
Caption = #26679#21697#20449#24687
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
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 = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_Repertory.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 220
|
||||
Top = 93
|
||||
Width = 8
|
||||
Height = 623
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
Control = Panel5
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1366
|
||||
Height = 62
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
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 = 364
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#21517#31216
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 216
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 732
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20811#37325
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 611
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #25104' '#20998
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 485
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #38376#24133
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 1088
|
||||
Top = 11
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 1088
|
||||
Top = 31
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
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 = 414
|
||||
Top = 11
|
||||
Width = 56
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = CYNoChange
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object CYKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 758
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
object CYCF: TEdit
|
||||
Tag = 2
|
||||
Left = 661
|
||||
Top = 11
|
||||
Width = 56
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYMF: TEdit
|
||||
Tag = 2
|
||||
Left = 511
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 512
|
||||
Top = 232
|
||||
Width = 185
|
||||
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 = 5
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 0
|
||||
Top = 93
|
||||
Width = 220
|
||||
Height = 623
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 216
|
||||
Height = 619
|
||||
Align = alClient
|
||||
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_Repertory.Red
|
||||
Styles.Selection = DataLink_Repertory.Red
|
||||
Styles.IncSearch = DataLink_Repertory.Red
|
||||
TabOrder = 0
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'CPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 230
|
||||
Top = 104
|
||||
Width = 1073
|
||||
Height = 609
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'Panel3'
|
||||
TabOrder = 4
|
||||
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
|
||||
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
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 40
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #31867#22411
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 54
|
||||
end
|
||||
object v1CYNo: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 92
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 96
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 56
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 81
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 77
|
||||
end
|
||||
object v1Column39: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 166
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree20: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 61
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 989
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1029
|
||||
Top = 1
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 432
|
||||
Top = 184
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 451
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 493
|
||||
Top = 193
|
||||
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
|
||||
ShowPrintDialog = 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 = 461
|
||||
Top = 188
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 513
|
||||
Top = 157
|
||||
end
|
||||
object DSCYNO: TDataSource
|
||||
DataSet = CDS_CYNO
|
||||
Left = 771
|
||||
Top = 235
|
||||
end
|
||||
object CDS_CYNO: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 712
|
||||
Top = 264
|
||||
end
|
||||
object ADOQueryTree: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 32
|
||||
Top = 200
|
||||
end
|
||||
object adoqueryPicture: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 479
|
||||
Top = 256
|
||||
end
|
||||
end
|
||||
471
布匹仓库2/U_CPManageSel.pas
Normal file
471
布匹仓库2/U_CPManageSel.pas
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
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;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree20: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
CYID: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
Label1: TLabel;
|
||||
CYName: TEdit;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
Label3: TLabel;
|
||||
CYNO: TEdit;
|
||||
Panel2: TPanel;
|
||||
DSCYNO: TDataSource;
|
||||
CDS_CYNO: TClientDataSet;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
Label8: TLabel;
|
||||
CYCF: TEdit;
|
||||
Label10: TLabel;
|
||||
CYMF: TEdit;
|
||||
ADOQueryTree: TClientDataSet;
|
||||
Panel5: TPanel;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
Panel3: TPanel;
|
||||
GroupBox1: TGroupBox;
|
||||
ScrollBox1: TScrollBox;
|
||||
adoqueryPicture: TADOQuery;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1CYNo: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column39: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
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 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 v1Column19PropertiesChange(Sender: TObject);
|
||||
procedure CYMFChange(Sender: TObject);
|
||||
procedure CYNameChange(Sender: TObject);
|
||||
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure Tv1DblClick(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.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
with ADOQueryTree20 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTree20,ADOQueryTree);
|
||||
SInitCDSData20(ADOQueryTree20,ADOQueryTree);
|
||||
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);
|
||||
// writeCxGrid(self.Caption+tv1.Name,tv1);
|
||||
// Application := mainApplication;
|
||||
action:=cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品列表SelLJ',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('样品列表SelLJ',Tv1,'样品管理');
|
||||
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYID='''' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_CYNO);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_CYNO);
|
||||
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:='XXXXXXX';
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
CDS_CYNO.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
InitGrid();
|
||||
//TJGS();
|
||||
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);
|
||||
// TJGS();
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
if Trim(CYID.Text)='' then Exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_Select_CP_YDang :Code,1,'''' ');
|
||||
Parameters.ParamByName('Code').Value:=Trim(CYID.Text);
|
||||
Open;
|
||||
end;
|
||||
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(TEdit(Sender).Text))<4 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
//TJGS();
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.ToolButton4Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
ModalResult:=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.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);
|
||||
IF CDS_Main.IsEmpty then exit;
|
||||
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.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.v1Column19PropertiesChange(Sender: TObject);
|
||||
var
|
||||
mvalue:Boolean;
|
||||
begin
|
||||
{ mvalue:=TcxCheckBox(Sender).EditingValue;
|
||||
if mvalue=True then
|
||||
begin
|
||||
with CDS_CYNO do
|
||||
begin
|
||||
if Locate('CYID',Trim(CDS_Main.fieldbyname('CYID').AsString),[])=False then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('CYID').Value:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
//with CDS_CYNO do
|
||||
//begin
|
||||
CDS_CYNO.Locate('CYID',Trim(CDS_Main.fieldbyname('CYID').AsString),[]);
|
||||
CDS_CYNO.Delete;
|
||||
//end;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYMFChange(Sender: TObject);
|
||||
begin
|
||||
//if Length(Trim(TEdit(Sender).Text))<2 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
//TJGS();
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYNameChange(Sender: TObject);
|
||||
begin
|
||||
//if Length(Trim(TEdit(Sender).Text))<2 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
// TJGS();
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
if Trim(CYNO.Text)='' then Exit;
|
||||
if Length(Trim(CYNO.Text))<4 then Exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_Select_CP_YDang :Code,2,'''' ');
|
||||
Parameters.ParamByName('Code').Value:='%'+Trim(CYNO.Text)+'%';
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
CYID.Text:='';
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
// TJGS();
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.Tv1DblClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
450
布匹仓库2/U_CPRk.dfm
Normal file
450
布匹仓库2/U_CPRk.dfm
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
object frmCPRk: TfrmCPRk
|
||||
Left = 294
|
||||
Top = 142
|
||||
Width = 1292
|
||||
Height = 658
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = #20837#24211#26126#32454#20449#24687
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Label6: TLabel
|
||||
Left = 756
|
||||
Top = 332
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = 'Label6'
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1276
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 1276
|
||||
Height = 92
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 73
|
||||
Top = 20
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20837#24211#26085#26399
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 407
|
||||
Top = 20
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20837#24211#31867#22411
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 249
|
||||
Top = 20
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20837#24211#21333#21495
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 249
|
||||
Top = 58
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #23384#25918#24037#21378
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 14
|
||||
Top = 57
|
||||
Width = 108
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830'/'#21152#24037#21378'/'#23458#25143
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 713
|
||||
Top = 36
|
||||
Width = 408
|
||||
Height = 24
|
||||
Caption = #27880#24847#65306#31995#25968#20026#21333#20301#38271#24230#25442#31639#25104#21333#20301#20844#26020
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -24
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object CRTime: TDateTimePicker
|
||||
Left = 125
|
||||
Top = 16
|
||||
Width = 100
|
||||
Height = 20
|
||||
Date = 41509.970132187500000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 41509.970132187500000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object CRType: TComboBox
|
||||
Left = 459
|
||||
Top = 17
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
TabOrder = 2
|
||||
Items.Strings = (
|
||||
#37319#36141#20837#24211
|
||||
#21152#24037#23436#25104
|
||||
#23458#25143#36864#36135
|
||||
#23436#24037#20837#24211
|
||||
#22238#20462#23436#25104
|
||||
#26399#21021#20837#24211
|
||||
#36864#36135#22238#20462)
|
||||
end
|
||||
object InoutNo: TEdit
|
||||
Left = 297
|
||||
Top = 16
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
end
|
||||
object FactoryName: TBtnEditA
|
||||
Left = 297
|
||||
Top = 54
|
||||
Width = 100
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 4
|
||||
OnBtnClick = FactoryNameBtnClick
|
||||
end
|
||||
object fromFactoryName: TBtnEditA
|
||||
Left = 126
|
||||
Top = 55
|
||||
Width = 100
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 3
|
||||
OnBtnClick = fromFactoryNameBtnClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 150
|
||||
Width = 1276
|
||||
Height = 469
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnMouseDown = Tv1MouseDown
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
Column = v1P_CodeName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Qty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Money
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
OnCustomDrawIndicatorCell = Tv1CustomDrawIndicatorCell
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #35746#21333#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1Column2PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 87
|
||||
end
|
||||
object v1P_Code: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'P_Code'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1P_CodePropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 93
|
||||
end
|
||||
object v1P_CodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_CodeName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 90
|
||||
end
|
||||
object v1PRTSpec: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'P_SPEC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 89
|
||||
end
|
||||
object v1P_Color: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'P_Color'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1P_ColorPropertiesButtonClick
|
||||
Properties.OnEditValueChanged = v1P_ColorPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 63
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'P_MF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 68
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'P_KZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 63
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'ganghao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 67
|
||||
end
|
||||
object v1MJId: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'Rollnum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 65
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'qty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 91
|
||||
end
|
||||
object v1QtyUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'qtyUnit'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
'M'
|
||||
'KG')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 86
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #31995#25968
|
||||
DataBinding.FieldName = 'xs'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 55
|
||||
end
|
||||
object v1Price: TcxGridDBColumn
|
||||
Caption = #21333#20215
|
||||
DataBinding.FieldName = 'Price'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Money: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'Money'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 80
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24211#20301
|
||||
DataBinding.FieldName = 'kuwei'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1Column1PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 86
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 179
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 121
|
||||
Width = 1276
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object btn1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#21333
|
||||
ImageIndex = 31
|
||||
OnClick = btn1Click
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 292
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 344
|
||||
Top = 4
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 400
|
||||
Top = 1
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 464
|
||||
Top = 1
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 556
|
||||
Top = 9
|
||||
end
|
||||
end
|
||||
685
布匹仓库2/U_CPRk.pas
Normal file
685
布匹仓库2/U_CPRk.pas
Normal file
|
|
@ -0,0 +1,685 @@
|
|||
unit U_CPRk;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, MMSystem,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit,
|
||||
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, BtnEdit,
|
||||
cxCheckBox, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack,
|
||||
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
||||
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
||||
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
||||
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
||||
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
||||
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
||||
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
||||
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
||||
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
||||
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
||||
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
|
||||
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
|
||||
dxSkinscxPCPainter, cxNavigator;
|
||||
|
||||
type
|
||||
TfrmCPRk = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
CRTime: TDateTimePicker;
|
||||
Label2: TLabel;
|
||||
CRType: TComboBox;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1P_CodeName: TcxGridDBColumn;
|
||||
v1PRTSpec: TcxGridDBColumn;
|
||||
v1Qty: TcxGridDBColumn;
|
||||
v1QtyUnit: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
v1MJId: TcxGridDBColumn;
|
||||
v1P_Color: TcxGridDBColumn;
|
||||
v1P_Code: TcxGridDBColumn;
|
||||
InoutNo: TEdit;
|
||||
Label8: TLabel;
|
||||
v1Price: TcxGridDBColumn;
|
||||
v1Money: TcxGridDBColumn;
|
||||
Label6: TLabel;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
Label9: TLabel;
|
||||
FactoryName: TBtnEditA;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
fromFactoryName: TBtnEditA;
|
||||
Label4: TLabel;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
btn1: TToolButton;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure v1P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure v1P_ColorPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1QtyPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure v1Column8PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure FactoryNameBtnClick(Sender: TObject);
|
||||
procedure Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||||
procedure v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure fromFactoryNameBtnClick(Sender: TObject);
|
||||
procedure btn1Click(Sender: TObject);
|
||||
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
private
|
||||
procedure InitGrid();
|
||||
function savedate(): Boolean;
|
||||
function CheckData(): Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO: string;
|
||||
FType: integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPRk: TfrmCPRk;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_ZdyAttachment, U_ZdyAttachGYS,
|
||||
U_ClothGMListSel;
|
||||
{$R *.dfm}
|
||||
|
||||
function TfrmCPRk.CheckData(): Boolean;
|
||||
begin
|
||||
try
|
||||
if Trim(CRType.Text) = '' then
|
||||
raise Exception.Create('入库类型不能为空!');
|
||||
if Trim(fromFactoryName.Text) = '' then
|
||||
raise Exception.Create('来自工厂不能为空!');
|
||||
if Trim(FactoryName.Text) = '' then
|
||||
raise Exception.Create('存放工厂不能为空!');
|
||||
if cds_main.IsEmpty then
|
||||
raise Exception.Create('产品信息不能为空!');
|
||||
// if cds_main.Locate('P_Code', NULL, []) then
|
||||
// raise Exception.Create('产品编号不能为空!');
|
||||
// if cds_main.Locate('P_Code', '', []) then
|
||||
// raise Exception.Create('产品编号不能为空!');
|
||||
if cds_main.Locate('P_CodeName', NULL, []) then
|
||||
raise Exception.Create('产品名称不能为空!');
|
||||
if cds_main.Locate('P_CodeName', '', []) then
|
||||
raise Exception.Create('产品名称不能为空!');
|
||||
if cds_main.Locate('qty', NULL, []) then
|
||||
raise Exception.Create('数量不能为空!');
|
||||
if cds_main.Locate('qty', 0, []) then
|
||||
raise Exception.Create('数量不能为0!');
|
||||
if cds_main.Locate('QtyUnit', NULL, []) then
|
||||
raise Exception.Create('数量单位不能为空!');
|
||||
if cds_main.Locate('QtyUnit', '', []) then
|
||||
raise Exception.Create('数量单位不能为空!');
|
||||
Result := True;
|
||||
except
|
||||
Result := false;
|
||||
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TfrmCPRk.savedate(): Boolean;
|
||||
var
|
||||
MaxNo: string;
|
||||
begin
|
||||
result := false;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
CDS_Main.DisableControls;
|
||||
CDS_Main.First;
|
||||
with CDS_Main do
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CR');
|
||||
sql.Add('where CRNO=' + quotedstr(Trim(CDS_Main.FieldByName('CRNO').AsString)));
|
||||
open;
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTmp, MaxNo, 'MR', 'CK_ML_CR', 3, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('Filler').Value := trim(DName);
|
||||
ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(SGetServerDateTime(adoqueryTmp));
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxNo := Trim(CDS_Main.FieldByName('CRNO').AsString);
|
||||
ADOQueryCmd.Edit;
|
||||
ADOQueryCmd.FieldByName('editer').Value := trim(dName);
|
||||
ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp);
|
||||
end;
|
||||
|
||||
//保存主表
|
||||
ADOQueryCmd.FieldByName('InOutNo').Value := trim(InOutNo.Text);
|
||||
ADOQueryCmd.FieldByName('FactoryName').Value := trim(FactoryName.Text);
|
||||
ADOQueryCmd.FieldByName('fromFactoryName').Value := trim(fromFactoryName.Text);
|
||||
ADOQueryCmd.FieldByName('CRNO').Value := trim(MaxNo);
|
||||
ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date);
|
||||
ADOQueryCmd.FieldByName('CKName').Value := trim('成品');
|
||||
ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text);
|
||||
ADOQueryCmd.FieldByName('CRFlag').Value := '入库';
|
||||
ADOQueryCmd.FieldByName('CRQtyFlag').Value := 1;
|
||||
|
||||
//保存明细
|
||||
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Main, 'CK_ML_CR', 0);
|
||||
|
||||
//保存隐藏ID
|
||||
ADOQueryCmd.FieldByName('mainID').Value := trim(fieldbyname('mainID').AsString);
|
||||
ADOQueryCmd.FieldByName('subID').Value := trim(fieldbyname('subID').AsString);
|
||||
ADOQueryCmd.fieldbyname('JGId').Value := trim(fieldbyname('JGId').AsString);
|
||||
ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString);
|
||||
ADOQueryCmd.Post;
|
||||
|
||||
//插入库存
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MLKc ' + quotedstr(trim(CDS_Main.Fieldbyname('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('入库数量少于出库数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.FieldByName('CRNO').Value := Trim(MaxNo);
|
||||
CDS_Main.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result := true;
|
||||
except
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.InitGrid();
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
try
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
SQL.Add(' from CK_ML_CR A');
|
||||
sql.Add('where A.CRNO=' + quotedstr(trim(fkeyNO)));
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryTmp, CDS_Main);
|
||||
SInitCDSData20(adoqueryTmp, CDS_Main);
|
||||
if not CDS_Main.IsEmpty then
|
||||
begin
|
||||
CRTime.Date := CDS_Main.fieldbyname('CRTime').AsDateTime;
|
||||
CRType.ItemIndex := CRType.Items.IndexOf(trim(CDS_Main.fieldbyname('CRType').AsString));
|
||||
inoutNo.Text := CDS_Main.fieldbyname('inoutNo').asstring;
|
||||
FactoryName.Text := trim(CDS_Main.fieldbyname('FactoryName').AsString);
|
||||
fromFactoryName.Text := trim(CDS_Main.fieldbyname('fromFactoryName').AsString);
|
||||
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPRk := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.FormCreate(Sender: TObject);
|
||||
begin
|
||||
CRTime.Date := SGetServerDate10(ADOQueryTmp);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
writeCxGrid(self.Caption + tv1.Name + '1', Tv1, '面料仓库');
|
||||
Action := cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.FormShow(Sender: TObject);
|
||||
begin
|
||||
readCxGrid(self.Caption + tv1.Name + '1', Tv1, '面料仓库');
|
||||
InitGrid();
|
||||
if fType = 0 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd, fkeyNo, 'MRK', 'CK_ML_CR', 3, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
inoutNo.Text := Trim(fkeyNo);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if CheckData() = false then
|
||||
exit;
|
||||
CRTime.SetFocus;
|
||||
|
||||
if savedate() then
|
||||
begin
|
||||
application.MessageBox('数据保存成功!', '提示信息');
|
||||
ModalResult := 1;
|
||||
end
|
||||
else
|
||||
begin
|
||||
application.MessageBox('数据保存失败!', '提示信息', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FMJID: string;
|
||||
begin
|
||||
FMJID := '';
|
||||
if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut1', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if CDS_Main.IsEmpty then
|
||||
begin
|
||||
with CDS_Main do
|
||||
begin
|
||||
append;
|
||||
FieldbyName('CPType').Value := '正品';
|
||||
FieldbyName('QtyUnit').Value := 'KG';
|
||||
FieldbyName('Rollnum').Value := 0;
|
||||
FieldbyName('qty').Value := 0;
|
||||
FieldbyName('Price').Value := 0;
|
||||
FieldbyName('MJID').Value := FMJID;
|
||||
post;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CopyAddRowCDS(CDS_Main);
|
||||
with CDS_Main do
|
||||
begin
|
||||
edit;
|
||||
FieldbyName('MJID').Value := FMJID;
|
||||
FieldbyName('CRNO').Value := '';
|
||||
post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if Trim(CDS_Main.FieldByName('CRNO').AsString) = '' then
|
||||
begin
|
||||
CDS_Main.Delete;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update CK_ML_CR set Valid=''N'' where CRNO=' + quotedstr(Trim(CDS_Main.FieldByName('CRNO').AsString)));
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MlKc ' + quotedstr(Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('出库数量超出库存数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1P_ColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'OrdColor';
|
||||
flagname := '颜色';
|
||||
V1Name.Caption := '中文名称';
|
||||
V1Note.Caption := '英文名称';
|
||||
MainType := Trim(DName);
|
||||
fnote := True;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('P_Color').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
Self.CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
self.tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
var
|
||||
FKuWei: string;
|
||||
begin
|
||||
// try
|
||||
// frmZdyAttachCP20:=TfrmZdyAttachCP20.Create(Application);
|
||||
// with frmZdyAttachCP20 do
|
||||
// begin
|
||||
// CKType.Text:='面料';
|
||||
// if ShowModal=1 then
|
||||
// begin
|
||||
// Self.CDS_Main.Edit;
|
||||
//// Self.CDS_Main.FieldByName('WLType').Value:=Trim(CDS_HZ.fieldbyname('WLType').AsString);
|
||||
// Self.CDS_Main.FieldByName('P_Code').Value:=Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
||||
// Self.CDS_Main.FieldByName('P_CodeName').Value:=Trim(CDS_HZ.fieldbyname('ZdyName').AsString);
|
||||
// Self.CDS_Main.FieldByName('P_SPEC').Value:=Trim(CDS_HZ.fieldbyname('DEFstr1').AsString);
|
||||
//// Self.CDS_Main.FieldByName('P_Color').Value:=Trim(CDS_HZ.fieldbyname('DEFstr1').AsString);
|
||||
// Self.CDS_Main.FieldByName('P_MF').Value:=Trim(CDS_HZ.fieldbyname('DEFstr7').AsString);
|
||||
// Self.CDS_Main.FieldByName('P_KZ').Value:=Trim(CDS_HZ.fieldbyname('DEFstr8').AsString);
|
||||
// Self.CDS_Main.FieldByName('qtyUnit').Value:=Trim(CDS_HZ.fieldbyname('DEFstr4').AsString);
|
||||
// end;
|
||||
// end;
|
||||
// finally
|
||||
// frmZdyAttachCP20.Free;
|
||||
// end;
|
||||
// self.tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1P_ColorPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue: string;
|
||||
begin
|
||||
{ mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
|
||||
IF trim(mvalue)='' then exit;
|
||||
|
||||
IF rightBstr(trim(mvalue),1)<>'#'THEN
|
||||
BEGIn
|
||||
mvalue:=trim(mvalue)+'#';
|
||||
END;
|
||||
|
||||
|
||||
|
||||
with CDS_Main do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('P_Color').Value:=Trim(mvalue);
|
||||
Post;
|
||||
end;
|
||||
self.tv1.Controller.EditingController.ShowEdit(); }
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1QtyPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue, FFieldName: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '0';
|
||||
end;
|
||||
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||
with CDS_Main do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FFieldName).Value := Trim(mvalue);
|
||||
FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]);
|
||||
Post;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmClothGMListSel := TfrmClothGMListSel.Create(Application);
|
||||
with frmClothGMListSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.fieldbyname('OrderNo').Value := trim(Order_Main.fieldbyname('OrderNo').AsString);
|
||||
CDS_Main.fieldbyname('MainID').Value := trim(Order_Main.fieldbyname('MainID').AsString);
|
||||
CDS_Main.fieldbyname('subID').Value := trim(Order_Main.fieldbyname('subID').AsString);
|
||||
CDS_Main.fieldbyname('P_Code').Value := trim(Order_Main.fieldbyname('MPRTCode').AsString);
|
||||
CDS_Main.fieldbyname('P_CodeName').Value := trim(Order_Main.fieldbyname('MPRTCodeName').AsString);
|
||||
CDS_Main.fieldbyname('P_SPEC').Value := trim(Order_Main.fieldbyname('MPRTSpec').AsString);
|
||||
CDS_Main.fieldbyname('P_Color').Value := trim(Order_Main.fieldbyname('PRTColor').AsString);
|
||||
CDS_Main.fieldbyname('P_MF').Value := trim(Order_Main.fieldbyname('MPRTMF').AsString);
|
||||
CDS_Main.fieldbyname('P_KZ').Value := trim(Order_Main.fieldbyname('MPRTKZ').AsString);
|
||||
CDS_Main.Post;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1Column8PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'CPProperty';
|
||||
flagname := '面料属性';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('CPProperty').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.FactoryNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
FactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachGYS.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.Tv1CustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||||
var
|
||||
FValue: string;
|
||||
FBounds: TRect;
|
||||
begin
|
||||
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
||||
begin
|
||||
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
||||
FBounds := AViewInfo.Bounds;
|
||||
ACanvas.FillRect(FBounds);
|
||||
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
|
||||
InflateRect(FBounds, -1, -1);
|
||||
ACanvas.Font.Color := clBlack;
|
||||
ACanvas.Brush.Style := bsClear;
|
||||
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
||||
ADone := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'kuwei';
|
||||
flagname := '库位';
|
||||
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('kuwei').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
Self.CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
self.tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.fromFactoryNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (trim(CRType.Text) = '客户退货') then
|
||||
begin
|
||||
try
|
||||
frmZdyAttachment := TfrmZdyAttachment.Create(Application);
|
||||
with frmZdyAttachment do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
fromFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachment.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
fromFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachGYS.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.btn1Click(Sender: TObject);
|
||||
var
|
||||
FMJID: string;
|
||||
begin
|
||||
frmClothGMListSel := TfrmClothGMListSel.Create(Application);
|
||||
with frmClothGMListSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
while frmClothGMListSel.Order_Main.Locate('SSel', True, []) do
|
||||
begin
|
||||
FMJID := '';
|
||||
if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut1', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with Self.CDS_Main do
|
||||
begin
|
||||
append;
|
||||
FieldbyName('CPType').Value := '正品';
|
||||
FieldbyName('QtyUnit').Value := 'KG';
|
||||
FieldbyName('Rollnum').Value := 0;
|
||||
FieldbyName('qty').Value := 0;
|
||||
FieldbyName('Price').Value := 0;
|
||||
FieldbyName('MJID').Value := FMJID;
|
||||
fieldbyname('OrderNo').Value := trim(Order_Main.fieldbyname('OrderNo').AsString);
|
||||
fieldbyname('MainID').Value := trim(Order_Main.fieldbyname('MainID').AsString);
|
||||
fieldbyname('subID').Value := trim(Order_Main.fieldbyname('subID').AsString);
|
||||
fieldbyname('P_Code').Value := trim(Order_Main.fieldbyname('MPRTCode').AsString);
|
||||
fieldbyname('P_CodeName').Value := trim(Order_Main.fieldbyname('MPRTCodeName').AsString);
|
||||
fieldbyname('P_SPEC').Value := trim(Order_Main.fieldbyname('MPRTSpec').AsString);
|
||||
fieldbyname('P_Color').Value := trim(Order_Main.fieldbyname('PRTColor').AsString);
|
||||
fieldbyname('P_MF').Value := trim(Order_Main.fieldbyname('MPRTMF').AsString);
|
||||
fieldbyname('P_KZ').Value := trim(Order_Main.fieldbyname('MPRTKZ').AsString);
|
||||
Post;
|
||||
end;
|
||||
frmClothGMListSel.Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRk.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
if CDS_Main.fieldbyname('ISRCCK').AsString = '染厂发货' then
|
||||
begin
|
||||
v1P_Code.Options.Editing := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
778
布匹仓库2/U_CPRklist.dfm
Normal file
778
布匹仓库2/U_CPRklist.dfm
Normal file
|
|
@ -0,0 +1,778 @@
|
|||
object frmCPRklist: TfrmCPRklist
|
||||
Left = 192
|
||||
Top = 127
|
||||
Width = 1382
|
||||
Height = 699
|
||||
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
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1366
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBFind: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
Visible = False
|
||||
OnClick = TBFindClick
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20837#24211
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 68
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1366
|
||||
Height = 77
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 23
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20837#24211#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 = 62
|
||||
Top = 40
|
||||
Width = 13
|
||||
Height = 12
|
||||
Caption = #33267
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 528
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 696
|
||||
Top = 15
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #39068' '#33394
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 188
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20837#24211#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 288
|
||||
Top = 100
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20179#24211
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 188
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20837#24211#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 696
|
||||
Top = 40
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #24211' '#20301
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 664
|
||||
Top = 120
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #32568' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label14: TLabel
|
||||
Left = 370
|
||||
Top = 15
|
||||
Width = 53
|
||||
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 Label15: TLabel
|
||||
Left = 528
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label17: TLabel
|
||||
Left = 370
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #23384#25918#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 848
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #26469#33258#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 874
|
||||
Top = 40
|
||||
Width = 26
|
||||
Height = 12
|
||||
Caption = #32568#21495
|
||||
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 = 76
|
||||
Top = 36
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 5
|
||||
end
|
||||
object P_CodeName: TEdit
|
||||
Tag = 2
|
||||
Left = 584
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 8
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object P_Color: TEdit
|
||||
Tag = 2
|
||||
Left = 752
|
||||
Top = 11
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object CRType: TComboBox
|
||||
Tag = 2
|
||||
Left = 244
|
||||
Top = 11
|
||||
Width = 80
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
TabOrder = 1
|
||||
OnChange = P_CodeNameChange
|
||||
Items.Strings = (
|
||||
''
|
||||
#37319#36141#20837#24211
|
||||
#21152#24037#23436#25104
|
||||
#23458#25143#36864#36135
|
||||
#23436#24037#20837#24211
|
||||
#22238#20462#23436#25104
|
||||
#26399#21021#20837#24211
|
||||
#36864#36135#22238#20462
|
||||
#23458#25143#36864#36135)
|
||||
end
|
||||
object ckName: TComboBox
|
||||
Left = 320
|
||||
Top = 96
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
ItemIndex = 0
|
||||
TabOrder = 10
|
||||
Text = #26679#21697#20179#24211
|
||||
Items.Strings = (
|
||||
#26679#21697#20179#24211)
|
||||
end
|
||||
object inoutNo: TEdit
|
||||
Tag = 2
|
||||
Left = 244
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object kuwei: TEdit
|
||||
Tag = 1
|
||||
Left = 752
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 9
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object gangNo: TEdit
|
||||
Tag = 2
|
||||
Left = 720
|
||||
Top = 116
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 11
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object OrderNo: TEdit
|
||||
Tag = 2
|
||||
Left = 428
|
||||
Top = 11
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object P_Code: TEdit
|
||||
Tag = 2
|
||||
Left = 584
|
||||
Top = 11
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object FactoryName: TEdit
|
||||
Tag = 2
|
||||
Left = 428
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 7
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object fromFactoryName: TEdit
|
||||
Tag = 2
|
||||
Left = 904
|
||||
Top = 11
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 12
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object ganghao: TEdit
|
||||
Tag = 2
|
||||
Left = 904
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 13
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 129
|
||||
Width = 1366
|
||||
Height = 531
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
OnCustomDrawCell = Tv1CustomDrawCell
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
Column = v1P_CodeName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Qty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1money
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1MJID
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 44
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #35746#21333#21495
|
||||
DataBinding.FieldName = 'orderNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1INoutNo: TcxGridDBColumn
|
||||
Caption = #20837#24211#21333#21495
|
||||
DataBinding.FieldName = 'INoutNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #23384#25918#24037#21378
|
||||
DataBinding.FieldName = 'FactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1CRTime: TcxGridDBColumn
|
||||
Caption = #20837#24211#26085#26399
|
||||
DataBinding.FieldName = 'CRTime'
|
||||
Options.Editing = False
|
||||
Width = 68
|
||||
end
|
||||
object v1CRType: TcxGridDBColumn
|
||||
Caption = #20837#24211#31867#22411
|
||||
DataBinding.FieldName = 'CRType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 71
|
||||
end
|
||||
object v1P_Code: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'P_Code'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1P_CodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_CodeName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_SPEC: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'P_SPEC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_Color: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'P_Color'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1P_MF: TcxGridDBColumn
|
||||
Caption = #38376#24133'(cm)'
|
||||
DataBinding.FieldName = 'P_MF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_KZ: TcxGridDBColumn
|
||||
Caption = #20811#37325'(g/'#13217')'
|
||||
DataBinding.FieldName = 'P_KZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'ganghao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 82
|
||||
end
|
||||
object v1MJID: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'RollNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 76
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 50
|
||||
end
|
||||
object v1QtyUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'QtyUnit'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
'M'
|
||||
'Kg')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Filler: TcxGridDBColumn
|
||||
Caption = #25805#20316#21592
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1FillTime: TcxGridDBColumn
|
||||
Caption = #25805#20316#26102#38388
|
||||
DataBinding.FieldName = 'FillTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Price: TcxGridDBColumn
|
||||
Caption = #21333#20215
|
||||
DataBinding.FieldName = 'Price'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1money: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'money'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #31995#25968
|
||||
DataBinding.FieldName = 'xs'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 55
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24211#20301
|
||||
DataBinding.FieldName = 'kuwei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #26469#33258#24037#21378
|
||||
DataBinding.FieldName = 'fromFactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 54
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #25968#25454#31867#22411
|
||||
DataBinding.FieldName = 'ISRCCK'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 58
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #26159#21542#20462#25913
|
||||
DataBinding.FieldName = 'ISXG'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 109
|
||||
Width = 1366
|
||||
Height = 20
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 3
|
||||
Properties.CustomButtons.Buttons = <>
|
||||
Properties.Style = 9
|
||||
Properties.TabIndex = 0
|
||||
Properties.Tabs.Strings = (
|
||||
#26410#29983#25104
|
||||
#24050#29983#25104
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectRight = 0
|
||||
ClientRectTop = 0
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 728
|
||||
Top = 152
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 979
|
||||
Top = 194
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 1093
|
||||
Top = 540
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1039
|
||||
Top = 539
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 301
|
||||
Top = 180
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 383
|
||||
Top = 343
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 353
|
||||
Top = 346
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = 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 = 425
|
||||
Top = 345
|
||||
ReportData = {}
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 268
|
||||
Top = 177
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N3: TMenuItem
|
||||
Caption = #22797#21046
|
||||
OnClick = N3Click
|
||||
end
|
||||
end
|
||||
end
|
||||
405
布匹仓库2/U_CPRklist.pas
Normal file
405
布匹仓库2/U_CPRklist.pas
Normal file
|
|
@ -0,0 +1,405 @@
|
|||
unit U_CPRklist;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
|
||||
cxButtonEdit, cxDropDownEdit, cxGridLevel, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, cxContainer,
|
||||
cxTextEdit, cxCurrencyEdit, cxCheckBox, RM_System, RM_Dataset, RM_Common,
|
||||
RM_Class, RM_GridReport, cxPC, Menus, Clipbrd, cxLookAndFeels,
|
||||
cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue,
|
||||
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
||||
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle,
|
||||
dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary,
|
||||
dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin,
|
||||
dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
||||
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
||||
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
||||
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
||||
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
||||
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
||||
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
||||
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
||||
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter,
|
||||
cxNavigator, dxBarBuiltInMenu;
|
||||
|
||||
type
|
||||
TfrmCPRklist = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBFind: TToolButton;
|
||||
TBAdd: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBExport: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1P_CodeName: TcxGridDBColumn;
|
||||
v1P_SPEC: TcxGridDBColumn;
|
||||
v1P_MF: TcxGridDBColumn;
|
||||
v1P_KZ: TcxGridDBColumn;
|
||||
v1Qty: TcxGridDBColumn;
|
||||
v1QtyUnit: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1CRType: TcxGridDBColumn;
|
||||
v1CRTime: TcxGridDBColumn;
|
||||
v1Filler: TcxGridDBColumn;
|
||||
v1FillTime: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
P_CodeName: TEdit;
|
||||
P_Color: TEdit;
|
||||
CRType: TComboBox;
|
||||
Label5: TLabel;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
v1MJID: TcxGridDBColumn;
|
||||
ckName: TComboBox;
|
||||
Label6: TLabel;
|
||||
v1P_Color: TcxGridDBColumn;
|
||||
v1P_Code: TcxGridDBColumn;
|
||||
v1INoutNo: TcxGridDBColumn;
|
||||
Label7: TLabel;
|
||||
inoutNo: TEdit;
|
||||
v1Price: TcxGridDBColumn;
|
||||
v1money: TcxGridDBColumn;
|
||||
kuwei: TEdit;
|
||||
Label9: TLabel;
|
||||
gangNo: TEdit;
|
||||
Label10: TLabel;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
OrderNo: TEdit;
|
||||
Label14: TLabel;
|
||||
P_Code: TEdit;
|
||||
Label15: TLabel;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
Label17: TLabel;
|
||||
FactoryName: TEdit;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
Label8: TLabel;
|
||||
fromFactoryName: TEdit;
|
||||
Label11: TLabel;
|
||||
ganghao: TEdit;
|
||||
N3: TMenuItem;
|
||||
cxTabControl1: TcxTabControl;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure P_CodeNameChange(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
||||
procedure N3Click(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
procedure SetStatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
fCKName, canshu1: string;
|
||||
fCRType: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPRklist: TfrmCPRklist;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_CPRk;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPRklist.SetStatus();
|
||||
begin
|
||||
TBEdit.Visible := False;
|
||||
TBDel.Visible := False;
|
||||
|
||||
if Trim(canshu1) = '高权限' then
|
||||
begin
|
||||
TBEdit.Visible := true;
|
||||
TBDel.Visible := true;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.InitGrid();
|
||||
begin
|
||||
try
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* from CK_ML_CR A');
|
||||
sql.Add(' where A.CRTime>=''' + formatdateTime('yyyy-MM-dd', begdate.Date) + ''' ');
|
||||
sql.Add(' and A.CRTime<''' + formatdateTime('yyyy-MM-dd', enddate.Date + 1) + ''' ');
|
||||
sql.Add(' and CKName=''成品'' and A.CRFlag=''入库'' and A.Valid=''Y'' ');
|
||||
|
||||
if cxTabControl1.TabIndex <> 2 then
|
||||
begin
|
||||
if cxTabControl1.TabIndex = 0 then
|
||||
SQL.Add(' and not exists(select YFPZNO from YF_Money_CR_Sub X where X.YFPZNO=A.CRNO ) ')
|
||||
else
|
||||
SQL.Add(' and exists(select YFPZNO from YF_Money_CR_Sub X where X.YFPZNO=A.CRNO )');
|
||||
end;
|
||||
sql.Add(' order by ISRCCK desc ');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryTmp, CDS_Main);
|
||||
SInitCDSData20(adoqueryTmp, CDS_Main);
|
||||
TBFind.Click;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPRklist := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
frmCPRk := TfrmCPRk.create(self);
|
||||
with frmCPRk do
|
||||
begin
|
||||
fkeyNo := '';
|
||||
fType := 0;
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
self.CDS_Main.Locate('crNo', trim(fkeyNo), []);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.P_CodeNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTmp.Active = False then
|
||||
Exit;
|
||||
SDofilter(ADOQueryTmp, SGetFilters(Panel1, 1, 2));
|
||||
SCreateCDS20(ADOQueryTmp, CDS_Main);
|
||||
SInitCDSData20(ADOQueryTmp, CDS_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.FormShow(Sender: TObject);
|
||||
begin
|
||||
readCxGrid(self.Caption, Tv1, '面料仓库');
|
||||
SetStatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.FormCreate(Sender: TObject);
|
||||
begin
|
||||
EndDate.Date := SGetServerDate10(ADOQueryTmp);
|
||||
BegDate.Date := EndDate.Date - 30;
|
||||
canshu1 := trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
writeCxGrid(self.Caption, Tv1, '面料仓库');
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
if cds_main.Locate('ssel', true, []) = false then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if trim(cds_main.fieldbyname('ISRCCK').AsString) <> '染厂发货' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add('from CK_ML_CR A');
|
||||
SQL.Add('inner join CK_ML_KC B on B.MJID=A.MJID ');
|
||||
SQL.Add('where A.CRNO=''' + trim(cds_main.fieldbyname('CRNO').AsString) + ''' ');
|
||||
SQL.Add('and B.Qty<>A.Qty and A.valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
if not ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('此单已经产生出库,不能修改!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update CK_ML_CR set ISXG=1 where CRNO=' + quotedstr('R' + Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
ExecSQL;
|
||||
end;
|
||||
frmCPRk := TfrmCPRk.create(self);
|
||||
with frmCPRk do
|
||||
begin
|
||||
fkeyNo := self.cds_main.fieldbyname('CRNO').AsString;
|
||||
fType := 1;
|
||||
fckName := self.fckName;
|
||||
fCRType := self.fCRType;
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
self.CDS_Main.Locate('crNo', trim(fkeyNo), []);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
if CDS_Main.Locate('ssel', true, []) = false then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(CDS_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
||||
begin
|
||||
Application.MessageBox('不能操作他人数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
try
|
||||
if Trim(CDS_Main.FieldByName('CRNO').AsString) <> '' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update CK_ML_CR set Valid=''N'' where CRNO=' + quotedstr(Trim(CDS_Main.FieldByName('CRNO').AsString)));
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MlKc ' + quotedstr(Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('出库数量超出入库数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
except
|
||||
Application.MessageBox('数据删除失败!', '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
TcxGridToExcel(self.Caption, cxgrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTmp.Active = False then
|
||||
Exit;
|
||||
SDofilter(ADOQueryTmp, SGetFilters(Panel1, 1, 2));
|
||||
SCreateCDS20(ADOQueryTmp, CDS_Main);
|
||||
SInitCDSData20(ADOQueryTmp, CDS_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
||||
begin
|
||||
if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('ISRCCK').index] = '染厂发货' then
|
||||
begin
|
||||
ACanvas.Font.Color := $0000FF;
|
||||
if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('Qty').index] <= 0 then
|
||||
begin
|
||||
ACanvas.Brush.Color := $00FFFF;
|
||||
end;
|
||||
if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('ISXG').index] = 1 then
|
||||
begin
|
||||
ACanvas.Brush.Color := $F0CAA6;
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.N3Click(Sender: TObject);
|
||||
begin
|
||||
Clipboard.SetTextBuf(PChar(Trim(CDS_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString)));
|
||||
end;
|
||||
|
||||
procedure TfrmCPRklist.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
613
布匹仓库2/U_CPTQCk.dfm
Normal file
613
布匹仓库2/U_CPTQCk.dfm
Normal file
|
|
@ -0,0 +1,613 @@
|
|||
object frmCPTQCk: TfrmCPTQCk
|
||||
Left = 251
|
||||
Top = 140
|
||||
Width = 1230
|
||||
Height = 638
|
||||
BorderIcons = [biSystemMenu]
|
||||
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
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1214
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 1214
|
||||
Height = 80
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#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 = 220
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 38
|
||||
Top = 43
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 403
|
||||
Top = 44
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#21040#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label26: TLabel
|
||||
Left = 837
|
||||
Top = 27
|
||||
Width = 47
|
||||
Height = 12
|
||||
Caption = #24065' '#31181
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 222
|
||||
Top = 44
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #21457#24448#21333#20301
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 403
|
||||
Top = 17
|
||||
Width = 53
|
||||
Height = 12
|
||||
Caption = #21152' '#24037' '#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 584
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #23384#25918#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object CRTime: TDateTimePicker
|
||||
Left = 90
|
||||
Top = 13
|
||||
Width = 100
|
||||
Height = 20
|
||||
Date = 41509.970132187500000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 41509.970132187500000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object CRType: TComboBox
|
||||
Left = 276
|
||||
Top = 13
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
TabOrder = 0
|
||||
Items.Strings = (
|
||||
#29983#20135#20986#24211
|
||||
#21152#24037#20986#24211
|
||||
#38144#21806#20986#24211
|
||||
#25439#32791#20986#24211
|
||||
#36864#36135#20986#24211
|
||||
#22238#20462#20986#24211)
|
||||
end
|
||||
object InoutNo: TEdit
|
||||
Left = 90
|
||||
Top = 39
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
end
|
||||
object ToFactoryName: TBtnEditA
|
||||
Left = 458
|
||||
Top = 40
|
||||
Width = 101
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 4
|
||||
OnBtnClick = ToFactoryNameBtnClick
|
||||
end
|
||||
object BZType: TComboBox
|
||||
Left = 888
|
||||
Top = 23
|
||||
Width = 100
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
ItemIndex = 0
|
||||
TabOrder = 2
|
||||
Text = 'RMB'
|
||||
Visible = False
|
||||
Items.Strings = (
|
||||
'RMB'
|
||||
'USD'
|
||||
'EUR')
|
||||
end
|
||||
object fwdw: TEdit
|
||||
Left = 276
|
||||
Top = 40
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
end
|
||||
object fromFactoryName: TBtnEditA
|
||||
Left = 457
|
||||
Top = 13
|
||||
Width = 100
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 6
|
||||
OnBtnClick = fromFactoryNameBtnClick
|
||||
end
|
||||
object FactoryName: TBtnEditA
|
||||
Left = 639
|
||||
Top = 13
|
||||
Width = 100
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 7
|
||||
OnBtnClick = FactoryNameBtnClick
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 109
|
||||
Width = 1214
|
||||
Height = 30
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton3: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22797#21046#22686#34892
|
||||
ImageIndex = 2
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 139
|
||||
Width = 1214
|
||||
Height = 460
|
||||
Align = alClient
|
||||
Caption = 'Panel3'
|
||||
TabOrder = 3
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 1212
|
||||
Height = 458
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 0
|
||||
object Tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
Column = v1P_CodeName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Qty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Money
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1MJID
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #25351#31034#21333#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = True
|
||||
Properties.OnButtonClick = v1Column3PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
object v1P_Code: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'P_Code'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1P_CodePropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 79
|
||||
end
|
||||
object v1P_CodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_CodeName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1P_CodeNamePropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 115
|
||||
end
|
||||
object v1P_SPEC: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'P_SPEC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 79
|
||||
end
|
||||
object v1P_Color: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'P_Color'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 66
|
||||
end
|
||||
object v1P_MF: TcxGridDBColumn
|
||||
Caption = #38376#24133'(cm)'
|
||||
DataBinding.FieldName = 'P_MF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
VisibleForCustomization = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_KZ: TcxGridDBColumn
|
||||
Caption = #20811#37325'(g/'#13217')'
|
||||
DataBinding.FieldName = 'P_KZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
VisibleForCustomization = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'ganghao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #27454#21495
|
||||
DataBinding.FieldName = 'KeHuKuanHao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 64
|
||||
end
|
||||
object v1MJID: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'Rollnum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 60
|
||||
end
|
||||
object v1QtyUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'QtyUnit'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
'M'
|
||||
'Kg')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 65
|
||||
end
|
||||
object v1Price: TcxGridDBColumn
|
||||
Caption = #21333#20215
|
||||
DataBinding.FieldName = 'Price'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1QtyPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Money: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'Money'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 64
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24211#20301
|
||||
DataBinding.FieldName = 'kuwei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 132
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 372
|
||||
Top = 234
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 411
|
||||
Top = 234
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 663
|
||||
Top = 391
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 592
|
||||
Top = 393
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 188
|
||||
Top = 229
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 447
|
||||
Top = 235
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 158
|
||||
Top = 229
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 401
|
||||
Top = 279
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = 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 = 475
|
||||
Top = 278
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 439
|
||||
Top = 278
|
||||
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 = 508
|
||||
Top = 277
|
||||
end
|
||||
end
|
||||
691
布匹仓库2/U_CPTQCk.pas
Normal file
691
布匹仓库2/U_CPTQCk.pas
Normal file
|
|
@ -0,0 +1,691 @@
|
|||
unit U_CPTQCk;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, MMSystem,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit,
|
||||
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, BtnEdit, cxContainer,
|
||||
cxTextEdit, cxCurrencyEdit, cxCheckBox, Menus, RM_Common, RM_Class, RM_e_Xls,
|
||||
RM_Dataset, RM_System, RM_GridReport, cxLookAndFeels, cxLookAndFeelPainters,
|
||||
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
|
||||
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
||||
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
|
||||
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
|
||||
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
||||
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
||||
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
||||
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
||||
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
|
||||
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
|
||||
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
|
||||
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
|
||||
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator;
|
||||
|
||||
type
|
||||
TfrmCPTQCk = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
CRTime: TDateTimePicker;
|
||||
Label2: TLabel;
|
||||
CRType: TComboBox;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Label8: TLabel;
|
||||
InoutNo: TEdit;
|
||||
Label9: TLabel;
|
||||
ToFactoryName: TBtnEditA;
|
||||
Panel3: TPanel;
|
||||
ADOQueryMain: TADOQuery;
|
||||
Label26: TLabel;
|
||||
BZType: TComboBox;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1MJID: TcxGridDBColumn;
|
||||
v1P_Code: TcxGridDBColumn;
|
||||
v1P_CodeName: TcxGridDBColumn;
|
||||
v1P_SPEC: TcxGridDBColumn;
|
||||
v1P_Color: TcxGridDBColumn;
|
||||
v1Price: TcxGridDBColumn;
|
||||
v1P_MF: TcxGridDBColumn;
|
||||
v1P_KZ: TcxGridDBColumn;
|
||||
v1Qty: TcxGridDBColumn;
|
||||
v1QtyUnit: TcxGridDBColumn;
|
||||
v1Money: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
fwdw: TEdit;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
Label4: TLabel;
|
||||
fromFactoryName: TBtnEditA;
|
||||
Label5: TLabel;
|
||||
FactoryName: TBtnEditA;
|
||||
ToolButton3: TToolButton;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
ToolButton4: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure ToFactoryNameBtnClick(Sender: TObject);
|
||||
procedure v1QtyPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure FHAddressBtnDnClick(Sender: TObject);
|
||||
procedure v1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure v1Column5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure fromFactoryNameBtnClick(Sender: TObject);
|
||||
procedure FactoryNameBtnClick(Sender: TObject);
|
||||
procedure v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
function savedate(): Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO: string;
|
||||
FType: integer;
|
||||
fCKName: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPTQCk: TfrmCPTQCk;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_CPKcList, U_ZdyAttachment, U_ZDYHelpSel,
|
||||
U_ClothGMListSel, U_ZdyAttachGYS, U_CPManageSel;
|
||||
{$R *.dfm}
|
||||
|
||||
function TfrmCPTQCk.savedate(): Boolean;
|
||||
var
|
||||
MaxNo: string;
|
||||
begin
|
||||
result := false;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
CDS_Main.DisableControls;
|
||||
CDS_Main.First;
|
||||
with CDS_Main do
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
MaxNo := 'C' + Trim(CDS_Main.FieldByName('MJID').AsString);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CR');
|
||||
sql.Add('where CRNO=' + quotedstr(MaxNo));
|
||||
open;
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('Filler').Value := trim(DName);
|
||||
ADOQueryCmd.FieldByName('FillTime').Value := dateTimetostr(SGetServerDateTime(adoqueryTmp));
|
||||
end
|
||||
else
|
||||
begin
|
||||
ADOQueryCmd.Edit;
|
||||
ADOQueryCmd.FieldByName('editer').Value := trim(dName);
|
||||
ADOQueryCmd.FieldByName('editTime').Value := SGetServerDateTime(adoqueryTmp);
|
||||
end;
|
||||
|
||||
ADOQueryCmd.FieldByName('inoutNo').Value := trim(inoutNo.Text);
|
||||
ADOQueryCmd.FieldByName('CRNO').Value := trim(MaxNo);
|
||||
ADOQueryCmd.FieldByName('CKName').Value := '成品';
|
||||
ADOQueryCmd.FieldByName('BZType').Value := trim(BZType.Text);
|
||||
ADOQueryCmd.FieldByName('ToFactoryName').Value := trim(ToFactoryName.Text);
|
||||
ADOQueryCmd.FieldByName('fwdw').Value := trim(fwdw.Text);
|
||||
ADOQueryCmd.FieldByName('FactoryName').Value := trim(ToFactoryName.Text);
|
||||
ADOQueryCmd.FieldByName('fromFactoryName').Value := trim(fromFactoryName.Text);
|
||||
ADOQueryCmd.FieldByName('CRTime').Value := formatdateTime('yyyy-MM-dd', CRTIme.Date);
|
||||
ADOQueryCmd.FieldByName('CRType').Value := trim(CRType.Text);
|
||||
ADOQueryCmd.FieldByName('CRFlag').Value := '出库';
|
||||
ADOQueryCmd.FieldByName('CRQtyFlag').Value := -1;
|
||||
|
||||
//保存明细
|
||||
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Main, 'CK_ML_CR', 0);
|
||||
|
||||
//保存隐藏ID
|
||||
ADOQueryCmd.FieldByName('mainID').Value := trim(fieldbyname('mainID').AsString);
|
||||
ADOQueryCmd.FieldByName('subID').Value := trim(fieldbyname('subID').AsString);
|
||||
ADOQueryCmd.FieldByName('MJID').Value := trim(fieldbyname('MJID').AsString);
|
||||
ADOQueryCmd.FieldByName('ISRCCK').Value := '染厂发货';
|
||||
|
||||
ADOQueryCmd.Post;
|
||||
|
||||
//插入库存
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MlKcCR @MJID=' + quotedstr(trim(CDS_Main.fieldbyname('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
|
||||
Edit;
|
||||
FieldByName('CRNO').Value := trim(MaxNo);
|
||||
post;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result := true;
|
||||
except
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.InitGrid();
|
||||
begin
|
||||
try
|
||||
with adoqueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* from CK_ML_CR A');
|
||||
sql.Add('where A.CRNO=' + quotedstr(trim(fkeyNO)));
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryMain, CDS_Main);
|
||||
SInitCDSData20(adoqueryMain, CDS_Main);
|
||||
if not CDS_Main.IsEmpty then
|
||||
begin
|
||||
CRTime.Date := CDS_Main.fieldbyname('CRTime').AsDateTime;
|
||||
CRType.ItemIndex := CRType.Items.IndexOf(trim(CDS_Main.fieldbyname('CRType').AsString));
|
||||
BZType.ItemIndex := BZType.Items.IndexOf(trim(CDS_Main.fieldbyname('BZType').AsString));
|
||||
InoutNO.Text := trim(CDS_Main.fieldbyname('InoutNO').AsString);
|
||||
ToFactoryName.Text := trim(CDS_Main.fieldbyname('ToFactoryName').AsString);
|
||||
fwdw.Text := trim(CDS_Main.fieldbyname('fwdw').AsString);
|
||||
fromFactoryName.Text := trim(CDS_Main.fieldbyname('fromFactoryName').AsString);
|
||||
FactoryName.Text := trim(CDS_Main.fieldbyname('FactoryName').AsString);
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPTQCk := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.FormCreate(Sender: TObject);
|
||||
begin
|
||||
CRTime.Date := SGetServerDate10(ADOQueryTmp);
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.FormShow(Sender: TObject);
|
||||
var
|
||||
fbhType, fInoutNo: string;
|
||||
begin
|
||||
readCxGrid(self.Caption + tv1.Name, Tv1, '面料仓库');
|
||||
InitGrid();
|
||||
if fType = 0 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd, fkeyNo, 'MCK', 'CK_ML_CR', 3, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
inoutNo.Text := trim(fkeyNo);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
CRTime.SetFocus;
|
||||
if trim(CRType.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('出库类型不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if trim(fromFactoryName.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('加工厂不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if trim(FactoryName.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('存放工厂不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if trim(ToFactoryName.Text) = '' then
|
||||
begin
|
||||
application.MessageBox('出到工厂不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if cds_main.Locate('QtyUnit', '', []) then
|
||||
begin
|
||||
application.MessageBox('数量单位不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if cds_main.Locate('QtyUnit', NULL, []) then
|
||||
begin
|
||||
application.MessageBox('数量单位不能为空!', '提示信息', 0);
|
||||
exit;
|
||||
end;
|
||||
if savedate() then
|
||||
begin
|
||||
application.MessageBox('数据保存成功!', '提示信息');
|
||||
end
|
||||
else
|
||||
begin
|
||||
application.MessageBox('数据保存失败!', '提示信息', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'Cloth';
|
||||
flagname := '坯布名称';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FMJID: string;
|
||||
begin
|
||||
FMJID := '';
|
||||
if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut1', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with Self.CDS_Main do
|
||||
begin
|
||||
append;
|
||||
FieldbyName('CPType').Value := '正品';
|
||||
FieldbyName('QtyUnit').Value := 'KG';
|
||||
FieldbyName('Rollnum').Value := 0;
|
||||
FieldbyName('qty').Value := 0;
|
||||
FieldbyName('Price').Value := 0;
|
||||
FieldbyName('MJID').Value := FMJID;
|
||||
|
||||
Post;
|
||||
end;
|
||||
|
||||
// frmClothGMListSel := TfrmClothGMListSel.Create(Application);
|
||||
// with frmClothGMListSel do
|
||||
// begin
|
||||
// if showmodal = 1 then
|
||||
// begin
|
||||
// while frmClothGMListSel.Order_Main.Locate('SSel', True, []) do
|
||||
// begin
|
||||
// FMJID := '';
|
||||
// if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut1', 4, 1) = False then
|
||||
// begin
|
||||
// Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
// Exit;
|
||||
// end;
|
||||
// with Self.CDS_Main do
|
||||
// begin
|
||||
// append;
|
||||
// FieldbyName('CPType').Value := '正品';
|
||||
// FieldbyName('QtyUnit').Value := 'M';
|
||||
// FieldbyName('Rollnum').Value := 0;
|
||||
// FieldbyName('qty').Value := 0;
|
||||
// FieldbyName('Price').Value := 0;
|
||||
// FieldbyName('MJID').Value := FMJID;
|
||||
// fieldbyname('OrderNo').Value := trim(Order_Main.fieldbyname('OrderNo').AsString);
|
||||
// fieldbyname('MainID').Value := trim(Order_Main.fieldbyname('MainID').AsString);
|
||||
// fieldbyname('subID').Value := trim(Order_Main.fieldbyname('subID').AsString);
|
||||
// fieldbyname('P_Code').Value := trim(Order_Main.fieldbyname('MPRTCode').AsString);
|
||||
// fieldbyname('P_CodeName').Value := trim(Order_Main.fieldbyname('MPRTCodeName').AsString);
|
||||
// fieldbyname('P_SPEC').Value := trim(Order_Main.fieldbyname('MPRTSpec').AsString);
|
||||
// fieldbyname('P_Color').Value := trim(Order_Main.fieldbyname('PRTColor').AsString);
|
||||
// fieldbyname('P_MF').Value := trim(Order_Main.fieldbyname('MPRTMF').AsString);
|
||||
// fieldbyname('P_KZ').Value := trim(Order_Main.fieldbyname('MPRTKZ').AsString);
|
||||
// Post;
|
||||
// end;
|
||||
// frmClothGMListSel.Order_Main.Delete;
|
||||
// end;
|
||||
// end;
|
||||
// free;
|
||||
// end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
writeCxGrid(self.Caption + tv1.Name, Tv1, '面料仓库');
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.ToFactoryNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
if (trim(CRType.Text) = '加工出库') or (trim(CRType.Text) = '生产出库') or (trim(CRType.Text) = '退货出库') or (trim(CRType.Text) = '回修出库') then
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
ToFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
fwdw.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachGYS.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
try
|
||||
frmZdyAttachment := TfrmZdyAttachment.Create(Application);
|
||||
with frmZdyAttachment do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
ToFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
fwdw.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachment.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.v1QtyPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue, FFieldName: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '0';
|
||||
end;
|
||||
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||
with CDS_Main do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FFieldName).Value := Trim(mvalue);
|
||||
FieldbyName('Money').Value := format('%.2f', [FieldByName('Qty').AsFloat * FieldByName('Price').AsFloat]);
|
||||
Post;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.FHAddressBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text := '';
|
||||
TBtnEditC(Sender).TxtCode := '';
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.v1Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmClothGMListSel := TfrmClothGMListSel.Create(Application);
|
||||
with frmClothGMListSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.fieldbyname('OrderNo').Value := trim(Order_Main.fieldbyname('OrderNo').AsString);
|
||||
CDS_Main.fieldbyname('MainID').Value := trim(Order_Main.fieldbyname('MainID').AsString);
|
||||
CDS_Main.fieldbyname('subID').Value := trim(Order_Main.fieldbyname('subID').AsString);
|
||||
CDS_Main.fieldbyname('P_Code').Value := trim(Order_Main.fieldbyname('MPRTCode').AsString);
|
||||
CDS_Main.fieldbyname('P_CodeName').Value := trim(Order_Main.fieldbyname('MPRTCodeName').AsString);
|
||||
CDS_Main.fieldbyname('P_SPEC').Value := trim(Order_Main.fieldbyname('MPRTSpec').AsString);
|
||||
CDS_Main.fieldbyname('P_Color').Value := trim(Order_Main.fieldbyname('PRTColor').AsString);
|
||||
CDS_Main.fieldbyname('P_MF').Value := trim(Order_Main.fieldbyname('MPRTMF').AsString);
|
||||
CDS_Main.fieldbyname('P_KZ').Value := trim(Order_Main.fieldbyname('MPRTKZ').AsString);
|
||||
CDS_Main.fieldbyname('KeHuKuanHao').Value := trim(Order_Main.fieldbyname('PrtKuanNO').AsString);
|
||||
CDS_Main.Post;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.v1Column5PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'MLType';
|
||||
flagname := '面料类型';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.FieldByName('P_Type').Value := Trim(ClientDataSet1.fieldbyname('zdyName').AsString);
|
||||
CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
exit;
|
||||
if Trim(CDS_Main.FieldByName('CRNO').AsString) = '' then
|
||||
begin
|
||||
CDS_Main.Delete;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('update CK_ml_CR set Valid=''N'' where MJID=' + quotedstr(Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_mlKc ' + quotedstr(Trim(CDS_Main.FieldByName('MJID').AsString)));
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('出库数量超出库存数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.fromFactoryNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
fromFactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
FactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachGYS.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.FactoryNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
||||
with frmZdyAttachGYS do
|
||||
begin
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
FactoryName.Text := Trim(CDS_HZ.fieldbyname('CoName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttachGYS.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.v1P_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmCPManageSel := TfrmCPManageSel.Create(self);
|
||||
with frmCPManageSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
self.CDS_Main.Edit;
|
||||
self.CDS_Main.fieldbyname('P_Code').Value := CDS_Main.fieldbyname('CYNo').asstring;
|
||||
self.CDS_Main.fieldbyname('P_CodeName').Value := CDS_Main.fieldbyname('CYName').asstring;
|
||||
self.CDS_Main.fieldbyname('P_SPEC').Value := CDS_Main.fieldbyname('CYSpec').asstring;
|
||||
self.CDS_Main.fieldbyname('P_MF').Value := CDS_Main.fieldbyname('CYMF').asstring;
|
||||
self.CDS_Main.fieldbyname('P_KZ').Value := CDS_Main.fieldbyname('CYKZ').asstring;
|
||||
self.CDS_Main.fieldbyname('P_Color').Value := CDS_Main.fieldbyname('CYColor').asstring;
|
||||
self.CDS_Main.Post;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.ToolButton3Click(Sender: TObject);
|
||||
var
|
||||
FMJID: string;
|
||||
begin
|
||||
frmClothGMListSel := TfrmClothGMListSel.Create(Application);
|
||||
with frmClothGMListSel do
|
||||
begin
|
||||
if showmodal = 1 then
|
||||
begin
|
||||
while Order_Main.Locate('SSel', True, []) do
|
||||
begin
|
||||
FMJID := '';
|
||||
if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut1', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
CDS_Main.append;
|
||||
CDS_Main.FieldbyName('CPType').Value := '正品';
|
||||
CDS_Main.FieldbyName('QtyUnit').Value := 'KG';
|
||||
CDS_Main.FieldbyName('Rollnum').Value := 0;
|
||||
CDS_Main.FieldbyName('qty').Value := 0;
|
||||
CDS_Main.FieldbyName('Price').Value := 0;
|
||||
CDS_Main.FieldbyName('MJID').Value := FMJID;
|
||||
CDS_Main.fieldbyname('OrderNo').Value := trim(Order_Main.fieldbyname('OrderNo').AsString);
|
||||
CDS_Main.fieldbyname('MainID').Value := trim(Order_Main.fieldbyname('MainID').AsString);
|
||||
CDS_Main.fieldbyname('subID').Value := trim(Order_Main.fieldbyname('subID').AsString);
|
||||
CDS_Main.fieldbyname('P_Code').Value := trim(Order_Main.fieldbyname('MPRTCode').AsString);
|
||||
CDS_Main.fieldbyname('P_CodeName').Value := trim(Order_Main.fieldbyname('MPRTCodeName').AsString);
|
||||
CDS_Main.fieldbyname('P_SPEC').Value := trim(Order_Main.fieldbyname('MPRTSpec').AsString);
|
||||
CDS_Main.fieldbyname('P_Color').Value := trim(Order_Main.fieldbyname('PRTColor').AsString);
|
||||
CDS_Main.fieldbyname('P_MF').Value := trim(Order_Main.fieldbyname('MPRTMF').AsString);
|
||||
CDS_Main.fieldbyname('P_KZ').Value := trim(Order_Main.fieldbyname('MPRTKZ').AsString);
|
||||
CDS_Main.fieldbyname('KeHuKuanHao').Value := trim(Order_Main.fieldbyname('PrtKuanNO').AsString);
|
||||
CDS_Main.Post;
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmCPTQCk.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
FMJID, fmainid, fsubid: string;
|
||||
begin
|
||||
FMJID := '';
|
||||
|
||||
if GetLSNo(self.ADOQueryCmd, FMJID, 'MJ', 'CP_InOut1', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with Self.CDS_Main do
|
||||
begin
|
||||
fmainid := Self.CDS_Main.fieldbyname('mainid').AsString;
|
||||
fsubid := Self.CDS_Main.fieldbyname('subid').AsString;
|
||||
CopyAddRow(Tv1, CDS_Main);
|
||||
EDIT;
|
||||
FieldbyName('CPType').Value := '正品';
|
||||
FieldbyName('QtyUnit').Value := 'KG';
|
||||
FieldbyName('Rollnum').Value := 0;
|
||||
FieldbyName('mainid').Value := fmainid;
|
||||
FieldbyName('subid').Value := fsubid;
|
||||
FieldbyName('qty').Value := 0;
|
||||
FieldbyName('Price').Value := 0;
|
||||
FieldbyName('MJID').Value := FMJID;
|
||||
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
472
布匹仓库2/U_ClothGMListSel.dfm
Normal file
472
布匹仓库2/U_ClothGMListSel.dfm
Normal file
|
|
@ -0,0 +1,472 @@
|
|||
object frmClothGMListSel: TfrmClothGMListSel
|
||||
Left = 459
|
||||
Top = 193
|
||||
Width = 1375
|
||||
Height = 566
|
||||
Caption = #36710#38388#29983#20135#35745#21010#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 = 1359
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 31
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBRafresh: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBFind: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
Visible = False
|
||||
OnClick = TBFindClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1359
|
||||
Height = 54
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 23
|
||||
Top = 22
|
||||
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 = 22
|
||||
Width = 18
|
||||
Height = 12
|
||||
Caption = '---'
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 283
|
||||
Top = 22
|
||||
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 = 549
|
||||
Top = 22
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 706
|
||||
Top = 22
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 860
|
||||
Top = 22
|
||||
Width = 39
|
||||
Height = 12
|
||||
Caption = #21512#21516#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 415
|
||||
Top = 22
|
||||
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 = 18
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 179
|
||||
Top = 18
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 1
|
||||
end
|
||||
object OrderNo: TEdit
|
||||
Tag = 2
|
||||
Left = 324
|
||||
Top = 18
|
||||
Width = 81
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 2
|
||||
OnKeyPress = conPress
|
||||
end
|
||||
object MPRTCodeName: TEdit
|
||||
Tag = 2
|
||||
Left = 603
|
||||
Top = 18
|
||||
Width = 83
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 3
|
||||
OnKeyPress = conPress
|
||||
end
|
||||
object MPRTCode: TEdit
|
||||
Tag = 2
|
||||
Left = 760
|
||||
Top = 18
|
||||
Width = 83
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 4
|
||||
OnKeyPress = conPress
|
||||
end
|
||||
object ConNo: TEdit
|
||||
Tag = 2
|
||||
Left = 904
|
||||
Top = 18
|
||||
Width = 83
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 5
|
||||
OnKeyPress = conPress
|
||||
end
|
||||
object CustomerNoName: TEdit
|
||||
Tag = 2
|
||||
Left = 445
|
||||
Top = 18
|
||||
Width = 81
|
||||
Height = 20
|
||||
ImeName = #20013#25991' - QQ'#25340#38899#36755#20837#27861
|
||||
TabOrder = 6
|
||||
OnKeyPress = conPress
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 86
|
||||
Width = 1359
|
||||
Height = 441
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsSelection.InvertSelect = False
|
||||
OptionsSelection.MultiSelect = True
|
||||
OptionsSelection.CellMultiSelect = True
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_Repertory.SHuangSe
|
||||
Styles.IncSearch = DataLink_Repertory.SHuangSe
|
||||
Styles.Selection = DataLink_Repertory.SHuangSe
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 51
|
||||
end
|
||||
object v1OrderNo: TcxGridDBColumn
|
||||
Caption = #25351#31034#21333#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1ConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1CustomerNoName: TcxGridDBColumn
|
||||
Caption = #23458#25143
|
||||
DataBinding.FieldName = 'CustomerNoName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 120
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #19994#21153#21592
|
||||
DataBinding.FieldName = 'YWY'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1OrdDate: TcxGridDBColumn
|
||||
Caption = #21046#21333#26085#26399
|
||||
DataBinding.FieldName = 'OrdDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'MPRTCode'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1DeliveryDate: TcxGridDBColumn
|
||||
Caption = #20132#36135#26085#26399
|
||||
DataBinding.FieldName = 'DlyDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #23458#25143#21697#21495
|
||||
DataBinding.FieldName = 'CustPRTCode'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 78
|
||||
end
|
||||
object v1MPRTCodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'MPRTCodeName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1MPRTSpec: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'MPRTSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1MPRTMF: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'MPRTMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1MPRTKZ: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'MPRTKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #27454#21495
|
||||
DataBinding.FieldName = 'prtkuanNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #33394#21495
|
||||
DataBinding.FieldName = 'PrtColorNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 98
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'PRTColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 55
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'PRTHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 59
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'OrderQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 58
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'OrderUnit'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 51
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 680
|
||||
Top = 184
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 600
|
||||
Top = 184
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 552
|
||||
Top = 184
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 640
|
||||
Top = 184
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 840
|
||||
Top = 232
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 808
|
||||
Top = 232
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 268
|
||||
Top = 177
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
end
|
||||
265
布匹仓库2/U_ClothGMListSel.pas
Normal file
265
布匹仓库2/U_ClothGMListSel.pas
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
unit U_ClothGMListSel;
|
||||
|
||||
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, cxTextEdit, ShellAPI,
|
||||
cxCheckBox, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack,
|
||||
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
||||
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
||||
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
||||
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
||||
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
||||
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
||||
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
||||
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
||||
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
||||
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
||||
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
|
||||
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
|
||||
dxSkinscxPCPainter, cxNavigator, Menus;
|
||||
|
||||
type
|
||||
TfrmClothGMListSel = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBFind: 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;
|
||||
OrderNo: TEdit;
|
||||
Label5: TLabel;
|
||||
MPRTCodeName: TEdit;
|
||||
Order_Main: TClientDataSet;
|
||||
Label10: TLabel;
|
||||
MPRTCode: TEdit;
|
||||
ToolButton1: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1OrderNo: TcxGridDBColumn;
|
||||
v1ConNo: TcxGridDBColumn;
|
||||
v1CustomerNoName: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1OrdDate: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1DeliveryDate: TcxGridDBColumn;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1MPRTCodeName: TcxGridDBColumn;
|
||||
v1MPRTSpec: TcxGridDBColumn;
|
||||
v1MPRTMF: TcxGridDBColumn;
|
||||
v1MPRTKZ: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
Label4: TLabel;
|
||||
ConNo: TEdit;
|
||||
Label6: TLabel;
|
||||
CustomerNoName: TEdit;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure OrderNoChange(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure conPress(Sender: TObject; var Key: Char);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure Tv1DblClick(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
private
|
||||
FInt, PFInt: Integer;
|
||||
canshu1: string;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmClothGMListSel: TfrmClothGMListSel;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmClothGMListSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('坯布生产计划单', Tv1, '坯布生产管理');
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.InitGrid();
|
||||
var
|
||||
WSql: string;
|
||||
begin
|
||||
WSql := SGetFilters(Panel1, 1, 2);
|
||||
if trim(WSql) <> '' then
|
||||
begin
|
||||
WSql := ' and ' + trim(WSql);
|
||||
end;
|
||||
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered := False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select A.*,B.* from JYOrder_Main A');
|
||||
sql.add(' inner join JYOrder_Sub B on A.MainId=B.MainId where 1=1 ');
|
||||
sql.Add(WSql);
|
||||
if OrderNo.Text = '' then
|
||||
begin
|
||||
sql.add(' and Filltime>=' + quotedstr(trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime))));
|
||||
sql.add(' and Filltime<' + quotedstr(trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1))));
|
||||
end;
|
||||
|
||||
|
||||
// sql.add(' and isnull(status,''0'')='+quotedstr(trim(inttostr(cxTabControl1.TabIndex)))) ;
|
||||
Open;
|
||||
end;
|
||||
|
||||
SCreateCDS20(ADOQueryMain, Order_Main);
|
||||
SInitCDSData20(ADOQueryMain, Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.InitForm();
|
||||
begin
|
||||
|
||||
ReadCxGrid('坯布生产计划单', Tv1, '坯布生产管理');
|
||||
BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 90;
|
||||
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.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 TfrmClothGMListSel.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.OrderNoChange(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 TfrmClothGMListSel.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.conPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key = #13 then
|
||||
begin
|
||||
// if Length(Trim(ConNo.Text))<4 then Exit;
|
||||
// try
|
||||
// ADOQueryMain.DisableControls;
|
||||
// with ADOQueryMain do
|
||||
// begin
|
||||
// Filtered:=False;
|
||||
// Close;
|
||||
// sql.Clear;
|
||||
// //sql.Add('exec Cloth_QryList :MainId,:WSql');
|
||||
// // Parameters.ParamByName('WSql').Value:=' and OM.conNo like '''+'%'+Trim(ConNoM.Text)+'%'+''''
|
||||
// // +' and ConType=''生产'' ';
|
||||
// sql.Add('select * from Cloth_Main A inner join CLoth_Sub B on A.Mainid=B.MainId');
|
||||
// sql.Add(' where A.ConNo like '''+'%'+Trim(ConNo.Text)+'%'+'''');
|
||||
//
|
||||
// Open;
|
||||
// end;
|
||||
// SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
// SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
// finally
|
||||
// ADOQueryMain.EnableControls;
|
||||
// end;
|
||||
InitGrid();
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1 := Trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmClothGMListSel := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if order_Main.IsEmpty then
|
||||
Exit;
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.Tv1DblClick(Sender: TObject);
|
||||
begin
|
||||
if order_Main.IsEmpty then
|
||||
Exit;
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmClothGMListSel.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main, false);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
253
布匹仓库2/U_DJBCKMXLR.dfm
Normal file
253
布匹仓库2/U_DJBCKMXLR.dfm
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
object frmDJBCKMXLR: TfrmDJBCKMXLR
|
||||
Left = 308
|
||||
Top = 220
|
||||
Width = 1000
|
||||
Height = 601
|
||||
BorderIcons = [biSystemMenu]
|
||||
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
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 984
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 57
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 113
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
Caption = #19968#38190#26367#25442
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 272
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 984
|
||||
Height = 533
|
||||
Align = alClient
|
||||
Caption = 'Panel3'
|
||||
TabOrder = 1
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 982
|
||||
Height = 531
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TvMX: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
Navigator.Buttons.Delete.Enabled = False
|
||||
Navigator.Buttons.Delete.Visible = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
Column = cxGridDBColumn8
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn8
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn8
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
OptionsView.IndicatorWidth = 33
|
||||
OnCustomDrawIndicatorCell = TvMXCustomDrawIndicatorCell
|
||||
object vMXColumn1: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'MXGangHao'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 102
|
||||
end
|
||||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'MXQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 117
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TvMX
|
||||
end
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 372
|
||||
Top = 234
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 411
|
||||
Top = 234
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 663
|
||||
Top = 391
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 592
|
||||
Top = 393
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 188
|
||||
Top = 229
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 447
|
||||
Top = 235
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 158
|
||||
Top = 229
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 401
|
||||
Top = 279
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = 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 = 475
|
||||
Top = 278
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 439
|
||||
Top = 278
|
||||
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 = 508
|
||||
Top = 277
|
||||
end
|
||||
end
|
||||
325
布匹仓库2/U_DJBCKMXLR.pas
Normal file
325
布匹仓库2/U_DJBCKMXLR.pas
Normal file
|
|
@ -0,0 +1,325 @@
|
|||
unit U_DJBCKMXLR;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, StrUtils, Variants, Classes, Graphics, Controls,
|
||||
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, MMSystem,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGrid, StdCtrls, ComCtrls, ExtCtrls, ToolWin, cxButtonEdit, cxDropDownEdit,
|
||||
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu, BtnEdit, cxContainer,
|
||||
cxTextEdit, cxCurrencyEdit, cxCheckBox, Menus, RM_Common, RM_Class, RM_e_Xls,
|
||||
RM_Dataset, RM_System, RM_GridReport, cxLookAndFeels,
|
||||
cxLookAndFeelPainters, cxNavigator;
|
||||
|
||||
type
|
||||
TfrmDJBCKMXLR = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
CDS_Main: TClientDataSet;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Panel3: TPanel;
|
||||
ADOQueryMain: TADOQuery;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
cxGrid2: TcxGrid;
|
||||
TvMX: TcxGridDBTableView;
|
||||
vMXColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn8: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
ToolButton3: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FHAddressBtnDnClick(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
function savedate(): Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO, FMXGangHao: string;
|
||||
FType: integer;
|
||||
fCKName: string;
|
||||
flx: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmDJBCKMXLR: TfrmDJBCKMXLR;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun10, U_ZDYHelp, U_CPKcList, U_ZdyAttachment, U_ZDYHelpSel,
|
||||
U_ClothGMListSel, U_ZdyAttachGYS, U_CPManageSel;
|
||||
{$R *.dfm}
|
||||
|
||||
function TfrmDJBCKMXLR.savedate(): Boolean;
|
||||
var
|
||||
MaxNo: string;
|
||||
begin
|
||||
result := false;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
CDS_Main.DisableControls;
|
||||
CDS_Main.First;
|
||||
with CDS_Main do
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CRMX');
|
||||
sql.Add('where MXID=' + quotedstr(Trim(CDS_Main.FieldByName('MXID').AsString)));
|
||||
open;
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTmp, MaxNo, 'MCM', 'CK_ML_CRMX', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
end
|
||||
else
|
||||
begin
|
||||
MaxNo := Trim(CDS_Main.FieldByName('MXID').AsString);
|
||||
ADOQueryCmd.Edit;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
//保存明细
|
||||
RTSetSaveDataCDS(ADOQueryCmd, TvMX, CDS_Main, 'CK_ML_CRMX', 0);
|
||||
|
||||
//保存隐藏ID
|
||||
ADOQueryCmd.FieldByName('CRNO').Value := trim(fkeyNo);
|
||||
ADOQueryCmd.FieldByName('MXID').Value := trim(MaxNo);
|
||||
|
||||
ADOQueryCmd.Post;
|
||||
|
||||
CDS_Main.Edit;
|
||||
CDS_Main.FieldByName('MXID').Value := trim(MaxNo);
|
||||
CDS_Main.post;
|
||||
|
||||
//更新库存
|
||||
if flx = '剪样出库' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MlKcByMx2 ' + quotedstr(trim(fkeyNo)));
|
||||
Open;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Up_MlKcByMx ' + quotedstr(trim(fkeyNo)));
|
||||
Open;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
if Trim(ADOQueryCmd.FieldByName('Msg').AsString) = '操作失败' then
|
||||
begin
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('入库数量少于出库数量!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
CDS_Main.next;
|
||||
end;
|
||||
end;
|
||||
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
result := true;
|
||||
except
|
||||
CDS_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.InitGrid();
|
||||
begin
|
||||
try
|
||||
with adoqueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CK_ML_CRMX where CRNO=' + quotedstr(trim(fkeyNO)));
|
||||
sql.Add(' order by MXID');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryMain, CDS_Main);
|
||||
SInitCDSData20(adoqueryMain, CDS_Main);
|
||||
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmDJBCKMXLR := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.FormShow(Sender: TObject);
|
||||
var
|
||||
fbhType, fInoutNo: string;
|
||||
begin
|
||||
readCxGrid(self.Caption, TvMX, '面料仓库');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
ToolBar1.SetFocus;
|
||||
if savedate() then
|
||||
begin
|
||||
application.MessageBox('数据保存成功!', '提示信息');
|
||||
end
|
||||
else
|
||||
begin
|
||||
application.MessageBox('数据保存失败!', '提示信息', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.v1P_CodeNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := 'Cloth';
|
||||
flagname := '坯布名称';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
Self.CDS_Main.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
Self.CDS_Main.FieldByName('P_Code').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
writeCxGrid(self.Caption, TvMX, '面料仓库');
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.FHAddressBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text := '';
|
||||
TBtnEditC(Sender).TxtCode := '';
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, True);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main, False);
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
|
||||
for i := 1 to 10 do
|
||||
begin
|
||||
with CDS_Main do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('MXGangHao').Value := FMXGangHao;
|
||||
FieldByName('MXQty').Value := 0;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if cds_main.IsEmpty then
|
||||
exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CK_ML_CRMX where MXID=' + quotedstr(Trim(CDS_Main.FieldByName('MXID').AsString)));
|
||||
ExecSQL;
|
||||
end;
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.TvMXCustomDrawIndicatorCell(Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
|
||||
var
|
||||
FValue: string;
|
||||
FBounds: TRect;
|
||||
begin
|
||||
FBounds := AViewInfo.Bounds;
|
||||
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
|
||||
begin
|
||||
ACanvas.FillRect(FBounds);
|
||||
ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1);
|
||||
FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1);
|
||||
InflateRect(FBounds, -1, -1); //Platform specific. May not work on Linux.
|
||||
ACanvas.Font.Color := clBlack;
|
||||
ACanvas.Brush.Style := bsClear;
|
||||
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
|
||||
ADone := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDJBCKMXLR.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
OneKeyPost(TvMX, CDS_Main);
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
17985
布匹仓库2/U_DataLink.dfm
Normal file
17985
布匹仓库2/U_DataLink.dfm
Normal file
File diff suppressed because it is too large
Load Diff
85
布匹仓库2/U_DataLink.pas
Normal file
85
布匹仓库2/U_DataLink.pas
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
unit U_DataLink;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, DB, ADODB, ImgList, Controls, cxStyles, cxLookAndFeels,
|
||||
Windows,Messages,forms,OleCtnrs,DateUtils, cxClasses, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, dxSkinBlack, dxSkinBlue, dxSkinBlueprint,
|
||||
dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
|
||||
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
||||
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
||||
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
||||
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
||||
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
||||
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
||||
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
||||
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
||||
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
||||
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
||||
dxSkinTheAsphaltWorld, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
|
||||
dxSkinXmas2008Blue;
|
||||
var
|
||||
DConString:String; {全局连接字符串}
|
||||
server, dtbase, user, pswd: String; {数据库连接参数}
|
||||
DCurHandle:hwnd; //当前窗体句柄
|
||||
DName:string ; //#用户名#//
|
||||
DCode:string ; //#用户编号#//
|
||||
Ddatabase:string; //#数据库名称#//
|
||||
DTitCaption: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; //公司
|
||||
PicSvr:string;
|
||||
type
|
||||
TDataLink_Repertory = 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;
|
||||
SHuangSeCu: 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_Repertory: TDataLink_Repertory;
|
||||
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
procedure TDataLink_Repertory.DataModuleDestroy(Sender: TObject);
|
||||
begin
|
||||
DataLink_Repertory:=nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
||||
188
布匹仓库2/U_FileUp.dfm
Normal file
188
布匹仓库2/U_FileUp.dfm
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
object frmFileUp: TfrmFileUp
|
||||
Left = 247
|
||||
Top = 162
|
||||
Width = 634
|
||||
Height = 447
|
||||
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 = 555
|
||||
Height = 367
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
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 = 555
|
||||
Top = 41
|
||||
Width = 63
|
||||
Height = 367
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_DDMD.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 = 618
|
||||
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 = 537
|
||||
Top = 17
|
||||
Width = 23
|
||||
Height = 16
|
||||
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_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
end
|
||||
357
布匹仓库2/U_FileUp.pas
Normal file
357
布匹仓库2/U_FileUp.pas
Normal file
|
|
@ -0,0 +1,357 @@
|
|||
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;
|
||||
|
||||
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();
|
||||
procedure ReadINIFile10();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp: TfrmFileUp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$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;
|
||||
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
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
AJpeg:=TJpegImage.Create();
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select Count(*) MM from XD_File where CYID='''+Trim(CYID)+'''');
|
||||
SQL.Add('and filetype=''YP''');
|
||||
Open;
|
||||
j:=fieldbyname('MM').AsInteger;
|
||||
end;
|
||||
Image2.Picture.LoadFromFile(ODPat.FileName);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
CreThumb(AJpeg,Image2,216, 187);
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
PatFile:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
FConNo:=Trim(Code.Text);
|
||||
while Pos('/',FConNo)>0 do
|
||||
begin
|
||||
Delete(FConNo,Pos('/',FConNo),1);
|
||||
end;
|
||||
PatFile:=Trim(FConNo)+'-'+Inttostr(j+i+1)+'.'+PatFile;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
{if not DirectoryExists('D:\图片\'+Trim(gDef1)) then
|
||||
ForceDirectories('D:\图片\'+Trim(gDef1)); }
|
||||
IdFTP1.Put(lstPat[i], Trim('\YP')+'\'+Trim(PatFile));
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID='''+Trim(CYID)+'''');
|
||||
SQL.Add(' and filename='''+Trim(PatFile)+'''');
|
||||
SQL.Add(' and filetype=''YP''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Panel16.Visible:=False;
|
||||
Application.MessageBox(PChar('文件<'+Trim(PatFile)+'>重复,'+inttostr(i)+'个文件上传成功!'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
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;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update CP_YDang Set TPFlag=1 where CYID='''+Trim(CYID)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
SaveImageOther();
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
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;
|
||||
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();
|
||||
var
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
ImgMaxNo:String;
|
||||
i,j: Integer;
|
||||
PatFile: String;
|
||||
FTPPath,FConNo,MaxNo,FTFID:string;
|
||||
begin
|
||||
if Image2.Picture=nil then Exit;
|
||||
AJpeg:=TJpegImage.Create();
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File where WBID='''+Trim(CYID)+'''');
|
||||
Open;
|
||||
end;
|
||||
FTFID:=Trim(ADOQueryTemp.fieldbyname('TFID').AsString);
|
||||
if Trim(FTFID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,ImgMaxNo,'TF','TP_File',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取图片表最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
ImgMaxNo:=Trim(FTFID);
|
||||
end;
|
||||
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(ImgMaxNo);
|
||||
FieldByName('WBID').Value:=Trim(CYID);
|
||||
//FieldByName('TFIdx').Value:=cxTabControl2.TabIndex;
|
||||
FieldByName('TFType').Value:='样品';
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
//CreThumb(AJpeg,Image1,160, 120);
|
||||
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 WBID='''+Trim(CYID)+''' and TFType=''样品'' ');
|
||||
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.
|
||||
543
布匹仓库2/U_GetDllForm.pas
Normal file
543
布匹仓库2/U_GetDllForm.pas
Normal file
|
|
@ -0,0 +1,543 @@
|
|||
unit U_GetDllForm;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, forms, OleCtnrs, DateUtils, SysUtils, ADODB, 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_MLRklist, U_MLCKlist, U_MLKcList, U_MLKcHzList, U_PBRklist,
|
||||
U_PBCKlist, U_PBKcList, U_SPRklist, U_SPCKlist, U_SPKcList, U_HJGRklist,
|
||||
U_HJGCKlist, U_HJGKcList, U_TCRklist, U_TCCKlist, U_TCKcList, U_CPRklist,
|
||||
U_CPCKlist, U_CPKcList, U_QBKcList;
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// 功能说明:取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 := PChar(GName);
|
||||
DCode := PChar(GCode);
|
||||
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 := '121.40.233.100,7781';
|
||||
// server := '.';
|
||||
dtbase := 'chengxiedata';
|
||||
user := 'sa';
|
||||
pswd := 'rightsoft@123';
|
||||
// pswd := 'rightsoft';
|
||||
DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server;
|
||||
DConString := DataBaseStr;
|
||||
// DName := '漏刚军';
|
||||
// DParameters1 := '高权限';
|
||||
// DParameters2 := '高权限';
|
||||
//DParameters3:='1';
|
||||
if not ConnData() then
|
||||
begin
|
||||
result := 0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
// 定义窗口类型 、状态
|
||||
if WinStyle = 0 then
|
||||
begin
|
||||
mstyle := fsMDIChild;
|
||||
mstate := wsMaximized;
|
||||
mborderstyle := bsSizeable;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mstyle := fsNormal;
|
||||
mstate := wsNormal;
|
||||
mborderstyle := bsSizeable;
|
||||
end;
|
||||
/////////////////////
|
||||
//调用子模块窗口
|
||||
case FormID of
|
||||
|
||||
-111: //全部库存
|
||||
begin
|
||||
if frmQBKcList = nil then
|
||||
begin
|
||||
frmQBKcList := TfrmQBKcList.Create(application.MainForm);
|
||||
with frmQBKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmQBKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmQBKcList.Handle;
|
||||
end;
|
||||
|
||||
111: //纱线入库
|
||||
begin
|
||||
if frmSPRklist = nil then
|
||||
begin
|
||||
frmSPRklist := TfrmSPRklist.Create(application.MainForm);
|
||||
with frmSPRklist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmSPRklist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmSPRklist.Handle;
|
||||
end;
|
||||
|
||||
121: //纱线出库
|
||||
begin
|
||||
if frmSPCKlist = nil then
|
||||
begin
|
||||
frmSPCKlist := TfrmSPCKlist.Create(application.MainForm);
|
||||
with frmSPCKlist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmSPCKlist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmSPCKlist.Handle;
|
||||
end;
|
||||
|
||||
131: //纱线库存
|
||||
begin
|
||||
if frmSPKcList = nil then
|
||||
begin
|
||||
frmSPKcList := TfrmSPKcList.Create(application.MainForm);
|
||||
with frmSPKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmSPKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmSPKcList.Handle;
|
||||
end;
|
||||
211: //坯布入库
|
||||
begin
|
||||
if frmPBRklist = nil then
|
||||
begin
|
||||
frmPBRklist := TfrmPBRklist.Create(application.MainForm);
|
||||
with frmPBRklist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmPBRklist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmPBRklist.Handle;
|
||||
end;
|
||||
221: //坯布出库
|
||||
begin
|
||||
if frmPBCKlist = nil then
|
||||
begin
|
||||
frmPBCKlist := TfrmPBCKlist.Create(application.MainForm);
|
||||
with frmPBCKlist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmPBCKlist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmPBCKlist.Handle;
|
||||
end;
|
||||
231: //坯布库存
|
||||
begin
|
||||
if frmPBKcList = nil then
|
||||
begin
|
||||
frmPBKcList := TfrmPBKcList.Create(application.MainForm);
|
||||
with frmPBKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmPBKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmPBKcList.Handle;
|
||||
end;
|
||||
|
||||
311: //后加工入库
|
||||
begin
|
||||
if frmHJGRklist = nil then
|
||||
begin
|
||||
frmHJGRklist := TfrmHJGRklist.Create(application.MainForm);
|
||||
with frmHJGRklist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmHJGRklist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmHJGRklist.Handle;
|
||||
end;
|
||||
|
||||
321: //后加工出库
|
||||
begin
|
||||
if frmHJGCKlist = nil then
|
||||
begin
|
||||
frmHJGCKlist := TfrmHJGCKlist.Create(application.MainForm);
|
||||
with frmHJGCKlist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmHJGCKlist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmHJGCKlist.Handle;
|
||||
end;
|
||||
|
||||
331: //后加工库存
|
||||
begin
|
||||
if frmHJGKcList = nil then
|
||||
begin
|
||||
frmHJGKcList := TfrmHJGKcList.Create(application.MainForm);
|
||||
with frmHJGKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmHJGKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmHJGKcList.Handle;
|
||||
end;
|
||||
|
||||
411: //待检布入库
|
||||
begin
|
||||
if frmTCRklist = nil then
|
||||
begin
|
||||
frmTCRklist := TfrmTCRklist.Create(application.MainForm);
|
||||
with frmTCRklist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmTCRklist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmTCRklist.Handle;
|
||||
end;
|
||||
|
||||
421: //待检布出库
|
||||
begin
|
||||
if frmTCCKlist = nil then
|
||||
begin
|
||||
frmTCCKlist := TfrmTCCKlist.Create(application.MainForm);
|
||||
with frmTCCKlist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmTCCKlist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmTCCKlist.Handle;
|
||||
end;
|
||||
|
||||
431: //待检布库存
|
||||
begin
|
||||
if frmTCKcList = nil then
|
||||
begin
|
||||
frmTCKcList := TfrmTCKcList.Create(application.MainForm);
|
||||
with frmTCKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmTCKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmTCKcList.Handle;
|
||||
end;
|
||||
511: //成品入库
|
||||
begin
|
||||
if frmCPRklist = nil then
|
||||
begin
|
||||
frmCPRklist := TfrmCPRklist.Create(application.MainForm);
|
||||
with frmCPRklist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmCPRklist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmCPRklist.Handle;
|
||||
end;
|
||||
|
||||
521: //成品出库
|
||||
begin
|
||||
if frmCPCKlist = nil then
|
||||
begin
|
||||
frmCPCKlist := TfrmCPCKlist.Create(application.MainForm);
|
||||
with frmCPCKlist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmCPCKlist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmCPCKlist.Handle;
|
||||
end;
|
||||
|
||||
531: //成品库存
|
||||
begin
|
||||
if frmCPKcList = nil then
|
||||
begin
|
||||
frmCPKcList := TfrmCPKcList.Create(application.MainForm);
|
||||
with frmCPKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmCPKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmCPKcList.Handle;
|
||||
end;
|
||||
911: //面料入库
|
||||
begin
|
||||
if frmMLRklist = nil then
|
||||
begin
|
||||
frmMLRklist := TfrmMLRklist.Create(application.MainForm);
|
||||
with frmMLRklist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmMLRklist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmMLRklist.Handle;
|
||||
end;
|
||||
921: //面料出库
|
||||
begin
|
||||
if frmMLCKlist = nil then
|
||||
begin
|
||||
frmMLCKlist := TfrmMLCKlist.Create(application.MainForm);
|
||||
with frmMLCKlist do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmMLCKlist.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmMLCKlist.Handle;
|
||||
end;
|
||||
931: //面料库存
|
||||
begin
|
||||
if frmMLKcList = nil then
|
||||
begin
|
||||
frmMLKcList := TfrmMLKcList.Create(application.MainForm);
|
||||
with frmMLKcList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmMLKcList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmMLKcList.Handle;
|
||||
end;
|
||||
|
||||
932: //面料库存汇总
|
||||
begin
|
||||
if frmMLKcHzList = nil then
|
||||
begin
|
||||
frmMLKcHzList := TfrmMLKcHzList.Create(application.MainForm);
|
||||
with frmMLKcHzList do
|
||||
begin
|
||||
caption := Trim(Title);
|
||||
FormStyle := mstyle;
|
||||
windowState := mstate;
|
||||
BorderStyle := mborderstyle;
|
||||
//show;
|
||||
end;
|
||||
end
|
||||
else
|
||||
frmMLKcHzList.BringToFront;
|
||||
//句柄
|
||||
mnewHandle := frmMLKcHzList.Handle;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
Result := mnewHandle;
|
||||
// NewDllApp := Application;
|
||||
end;
|
||||
//===========================================================
|
||||
//建立数据库连接池
|
||||
//===========================================================
|
||||
|
||||
function ConnData(): Boolean;
|
||||
begin
|
||||
if not Assigned(DataLink_Repertory) then
|
||||
DataLink_Repertory := TDataLink_Repertory.Create(Application);
|
||||
try
|
||||
with DataLink_Repertory.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
|
||||
// OldDllApp := Application;
|
||||
//
|
||||
//finalization
|
||||
// DataLink_Repertory.Free;
|
||||
// Application := OldDllApp;
|
||||
initialization
|
||||
CoInitialize(nil);
|
||||
dxUnitsLoader.Initialize;
|
||||
|
||||
|
||||
finalization
|
||||
DataLink_Repertory.Free;
|
||||
application := NewDllApp;
|
||||
dxUnitsLoader.Finalize;
|
||||
|
||||
end.
|
||||
|
||||
802
布匹仓库2/U_HJGCKlist.dfm
Normal file
802
布匹仓库2/U_HJGCKlist.dfm
Normal file
|
|
@ -0,0 +1,802 @@
|
|||
object frmHJGCKlist: TfrmHJGCKlist
|
||||
Left = 209
|
||||
Top = 195
|
||||
Width = 1378
|
||||
Height = 615
|
||||
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
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1362
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_Repertory.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20986#24211
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 68
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1362
|
||||
Height = 65
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 23
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#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 = 63
|
||||
Top = 36
|
||||
Width = 13
|
||||
Height = 12
|
||||
Caption = #33267
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 518
|
||||
Top = 39
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #25351#31034#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 = 188
|
||||
Top = 16
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 188
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#24211#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 694
|
||||
Top = 14
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20986#21040#24037#21378
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 518
|
||||
Top = 16
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #39068' '#33394
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 354
|
||||
Top = 40
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label14: TLabel
|
||||
Left = 354
|
||||
Top = 16
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
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 = 1
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 76
|
||||
Top = 35
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 5
|
||||
end
|
||||
object OrderNo: TEdit
|
||||
Tag = 2
|
||||
Left = 574
|
||||
Top = 35
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = OrderNoChange
|
||||
end
|
||||
object CRType: TComboBox
|
||||
Tag = 2
|
||||
Left = 244
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
ItemHeight = 12
|
||||
TabOrder = 2
|
||||
OnChange = OrderNoChange
|
||||
Items.Strings = (
|
||||
''
|
||||
#29983#20135#20986#24211
|
||||
#21152#24037#20986#24211
|
||||
#38144#21806#20986#24211
|
||||
#25439#32791#20986#24211
|
||||
#36864#36135#20986#24211)
|
||||
end
|
||||
object inoutNo: TEdit
|
||||
Tag = 2
|
||||
Left = 244
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 7
|
||||
OnChange = OrderNoChange
|
||||
end
|
||||
object ToFactoryName: TEdit
|
||||
Tag = 2
|
||||
Left = 750
|
||||
Top = 10
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = OrderNoChange
|
||||
end
|
||||
object P_CodeName: TEdit
|
||||
Tag = 2
|
||||
Left = 410
|
||||
Top = 36
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 8
|
||||
OnChange = OrderNoChange
|
||||
end
|
||||
object P_Color: TEdit
|
||||
Tag = 2
|
||||
Left = 574
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = OrderNoChange
|
||||
end
|
||||
object P_Code: TEdit
|
||||
Tag = 2
|
||||
Left = 410
|
||||
Top = 12
|
||||
Width = 80
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = OrderNoChange
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 117
|
||||
Width = 1362
|
||||
Height = 460
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
Column = v1P_CodeName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Qty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column2
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1MJID
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_Repertory.Default
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v1CRNO: TcxGridDBColumn
|
||||
Caption = #20986#24211#32534#21495
|
||||
DataBinding.FieldName = 'CRNO'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 70
|
||||
end
|
||||
object v1custName: TcxGridDBColumn
|
||||
Caption = #20986#21040#24037#21378
|
||||
DataBinding.FieldName = 'ToFactoryName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 94
|
||||
end
|
||||
object v1inoutNO: TcxGridDBColumn
|
||||
Caption = #20986#24211#21333#21495
|
||||
DataBinding.FieldName = 'inoutNO'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Options.CellMerging = True
|
||||
Width = 88
|
||||
end
|
||||
object v1CRTime: TcxGridDBColumn
|
||||
Caption = #20986#24211#26085#26399
|
||||
DataBinding.FieldName = 'CRTime'
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 60
|
||||
end
|
||||
object v1CRType: TcxGridDBColumn
|
||||
Caption = #20986#24211#31867#22411
|
||||
DataBinding.FieldName = 'CRType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
end
|
||||
object v1P_Code: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_Code'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 70
|
||||
end
|
||||
object v1P_CodeName: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'P_CodeName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_Color: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'P_Color'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 60
|
||||
end
|
||||
object v1P_SPEC: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'P_SPEC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Options.Sorting = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_MF: TcxGridDBColumn
|
||||
Caption = #38376#24133'(cm)'
|
||||
DataBinding.FieldName = 'P_MF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 90
|
||||
end
|
||||
object v1P_KZ: TcxGridDBColumn
|
||||
Caption = #20811#37325'(g/'#13217')'
|
||||
DataBinding.FieldName = 'P_KZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 90
|
||||
end
|
||||
object v1MJID: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'Rollnum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 69
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Styles.Content = DataLink_Repertory.FontBlue
|
||||
Styles.Footer = DataLink_Repertory.FontBlue
|
||||
Styles.Header = DataLink_Repertory.FontBlue
|
||||
Width = 50
|
||||
end
|
||||
object v1QtyUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'QtyUnit'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
'M'
|
||||
'Kg')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 90
|
||||
end
|
||||
object v1Filler: TcxGridDBColumn
|
||||
Caption = #25805#20316#21592
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 60
|
||||
end
|
||||
object v1FillTime: TcxGridDBColumn
|
||||
Caption = #25805#20316#26102#38388
|
||||
DataBinding.FieldName = 'FillTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #21333#20215
|
||||
DataBinding.FieldName = 'price'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'money'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Styles.Content = cxStyle_fontclPurple
|
||||
Styles.Footer = cxStyle_fontclPurple
|
||||
Styles.Header = cxStyle_fontclPurple
|
||||
Width = 60
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #25351#31034#21333#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Filtering = False
|
||||
Width = 80
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'ganghao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 97
|
||||
Width = 1362
|
||||
Height = 20
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
Style = 9
|
||||
TabIndex = 0
|
||||
TabOrder = 3
|
||||
Tabs.Strings = (
|
||||
#26410#29983#25104
|
||||
#24050#29983#25104
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 20
|
||||
ClientRectRight = 1362
|
||||
ClientRectTop = 19
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 680
|
||||
Top = 177
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 716
|
||||
Top = 178
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 786
|
||||
Top = 179
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 748
|
||||
Top = 180
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 572
|
||||
Top = 175
|
||||
end
|
||||
object ADOPrint: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 411
|
||||
Top = 263
|
||||
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 = 514
|
||||
Top = 263
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOPrint
|
||||
Left = 443
|
||||
Top = 262
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
Left = 271
|
||||
Top = 167
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svColor]
|
||||
Color = clInactiveCaption
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svColor, svTextColor]
|
||||
Color = 4707838
|
||||
TextColor = clBtnText
|
||||
end
|
||||
object cxStyle_gridRow: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = 16311512
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
end
|
||||
object cxStyle_gridFoot: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle_gridHead: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle_gridGroupBox: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = clMoneyGreen
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle_yellow: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = 8454143
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
end
|
||||
object cxStyle_Red: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = clRed
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
end
|
||||
object cxStyle_fontBlack: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle_fontclFuchsia: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clFuchsia
|
||||
end
|
||||
object cxStyle_fontclPurple: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clPurple
|
||||
end
|
||||
object cxStyle_fontclGreen: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clGreen
|
||||
end
|
||||
object cxStyle_fontclBlue: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object cxStyle_fontclTeal: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clTeal
|
||||
end
|
||||
object cxStyle_fontclOlive: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clOlive
|
||||
end
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_Repertory.ADOLink
|
||||
Parameters = <>
|
||||
Left = 645
|
||||
Top = 177
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
ShowPrintDialog = 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 = 478
|
||||
Top = 262
|
||||
ReportData = {}
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 603
|
||||
Top = 173
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N3: TMenuItem
|
||||
Caption = #22797#21046
|
||||
OnClick = N3Click
|
||||
end
|
||||
end
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user