1
This commit is contained in:
commit
1011cb7292
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
|
||||
3
云翔OA(WTOA.dll)/Desktop.ini
Normal file
3
云翔OA(WTOA.dll)/Desktop.ini
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[.ShellClassInfo]
|
||||
IconFile=C:\Program Files (x86)\360\360WangPan\new_desktop_win7.ico
|
||||
IconIndex=0
|
||||
4
云翔OA(WTOA.dll)/File.INI
Normal file
4
云翔OA(WTOA.dll)/File.INI
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[生产车间配置]
|
||||
卷条码机台标志=99
|
||||
成品DLL文件=CYZZ.dll
|
||||
成品DLL调用号=11
|
||||
8
云翔OA(WTOA.dll)/FileHelp.ini
Normal file
8
云翔OA(WTOA.dll)/FileHelp.ini
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[FILEPATH]
|
||||
FileClass=YP,AA,BB,HT,SC
|
||||
YP=D:\YP
|
||||
AA=D:\AA
|
||||
BB=D:\BB
|
||||
HT=D:\HT
|
||||
SC=D:\SC
|
||||
OTHER=D:\OTHER
|
||||
8
云翔OA(WTOA.dll)/Ftpser/FileHelp.ini
Normal file
8
云翔OA(WTOA.dll)/Ftpser/FileHelp.ini
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[FILEPATH]
|
||||
FileClass=FJ,TP,AA,BB,HT
|
||||
FJ=D:\FJ
|
||||
TP=D:\TP
|
||||
AA=D:\AA
|
||||
BB=D:\BB
|
||||
HT=D:\HT
|
||||
OTHER=D:\OTHER
|
||||
BIN
云翔OA(WTOA.dll)/Ftpser/Ftpser.rar
Normal file
BIN
云翔OA(WTOA.dll)/Ftpser/Ftpser.rar
Normal file
Binary file not shown.
945
云翔OA(WTOA.dll)/IniFiles.pas
Normal file
945
云翔OA(WTOA.dll)/IniFiles.pas
Normal file
|
|
@ -0,0 +1,945 @@
|
|||
{ *************************************************************************** }
|
||||
{ }
|
||||
{ Delphi and Kylix Cross-Platform Visual Component Library }
|
||||
{ }
|
||||
{ Copyright (c) 1995, 2001 Borland Software Corporation }
|
||||
{ }
|
||||
{ *************************************************************************** }
|
||||
|
||||
|
||||
unit IniFiles;
|
||||
|
||||
{$R-,T-,H+,X+}
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils, Classes;
|
||||
|
||||
type
|
||||
EIniFileException = class(Exception);
|
||||
|
||||
TCustomIniFile = class(TObject)
|
||||
private
|
||||
FFileName: string;
|
||||
public
|
||||
constructor Create(const FileName: string);
|
||||
function SectionExists(const Section: string): Boolean;
|
||||
function ReadString(const Section, Ident, Default: string): string; virtual; abstract;
|
||||
procedure WriteString(const Section, Ident, Value: String); virtual; abstract;
|
||||
function ReadInteger(const Section, Ident: string; Default: Longint): Longint; virtual;
|
||||
procedure WriteInteger(const Section, Ident: string; Value: Longint); virtual;
|
||||
function ReadBool(const Section, Ident: string; Default: Boolean): Boolean; virtual;
|
||||
procedure WriteBool(const Section, Ident: string; Value: Boolean); virtual;
|
||||
function ReadBinaryStream(const Section, Name: string; Value: TStream): Integer; virtual;
|
||||
function ReadDate(const Section, Name: string; Default: TDateTime): TDateTime; virtual;
|
||||
function ReadDateTime(const Section, Name: string; Default: TDateTime): TDateTime; virtual;
|
||||
function ReadFloat(const Section, Name: string; Default: Double): Double; virtual;
|
||||
function ReadTime(const Section, Name: string; Default: TDateTime): TDateTime; virtual;
|
||||
procedure WriteBinaryStream(const Section, Name: string; Value: TStream); virtual;
|
||||
procedure WriteDate(const Section, Name: string; Value: TDateTime); virtual;
|
||||
procedure WriteDateTime(const Section, Name: string; Value: TDateTime); virtual;
|
||||
procedure WriteFloat(const Section, Name: string; Value: Double); virtual;
|
||||
procedure WriteTime(const Section, Name: string; Value: TDateTime); virtual;
|
||||
procedure ReadSection(const Section: string; Strings: TStrings); virtual; abstract;
|
||||
procedure ReadSections(Strings: TStrings); virtual; abstract;
|
||||
procedure ReadSectionValues(const Section: string; Strings: TStrings); virtual; abstract;
|
||||
procedure EraseSection(const Section: string); virtual; abstract;
|
||||
procedure DeleteKey(const Section, Ident: String); virtual; abstract;
|
||||
procedure UpdateFile; virtual; abstract;
|
||||
function ValueExists(const Section, Ident: string): Boolean;
|
||||
property FileName: string read FFileName;
|
||||
end;
|
||||
|
||||
{ TStringHash - used internally by TMemIniFile to optimize searches. }
|
||||
|
||||
PPHashItem = ^PHashItem;
|
||||
PHashItem = ^THashItem;
|
||||
THashItem = record
|
||||
Next: PHashItem;
|
||||
Key: string;
|
||||
Value: Integer;
|
||||
end;
|
||||
|
||||
TStringHash = class
|
||||
private
|
||||
Buckets: array of PHashItem;
|
||||
protected
|
||||
function Find(const Key: string): PPHashItem;
|
||||
function HashOf(const Key: string): Cardinal; virtual;
|
||||
public
|
||||
constructor Create(Size: Cardinal = 256);
|
||||
destructor Destroy; override;
|
||||
procedure Add(const Key: string; Value: Integer);
|
||||
procedure Clear;
|
||||
procedure Remove(const Key: string);
|
||||
function Modify(const Key: string; Value: Integer): Boolean;
|
||||
function ValueOf(const Key: string): Integer;
|
||||
end;
|
||||
|
||||
{ THashedStringList - A TStringList that uses TStringHash to improve the
|
||||
speed of Find }
|
||||
THashedStringList = class(TStringList)
|
||||
private
|
||||
FValueHash: TStringHash;
|
||||
FNameHash: TStringHash;
|
||||
FValueHashValid: Boolean;
|
||||
FNameHashValid: Boolean;
|
||||
procedure UpdateValueHash;
|
||||
procedure UpdateNameHash;
|
||||
protected
|
||||
procedure Changed; override;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
function IndexOf(const S: string): Integer; override;
|
||||
function IndexOfName(const Name: string): Integer; override;
|
||||
end;
|
||||
|
||||
{ TMemIniFile - loads an entire INI file into memory and allows all
|
||||
operations to be performed on the memory image. The image can then
|
||||
be written out to the disk file }
|
||||
|
||||
TMemIniFile = class(TCustomIniFile)
|
||||
private
|
||||
FSections: TStringList;
|
||||
function AddSection(const Section: string): TStrings;
|
||||
function GetCaseSensitive: Boolean;
|
||||
procedure LoadValues;
|
||||
procedure SetCaseSensitive(Value: Boolean);
|
||||
public
|
||||
constructor Create(const FileName: string);
|
||||
destructor Destroy; override;
|
||||
procedure Clear;
|
||||
procedure DeleteKey(const Section, Ident: String); override;
|
||||
procedure EraseSection(const Section: string); override;
|
||||
procedure GetStrings(List: TStrings);
|
||||
procedure ReadSection(const Section: string; Strings: TStrings); override;
|
||||
procedure ReadSections(Strings: TStrings); override;
|
||||
procedure ReadSectionValues(const Section: string; Strings: TStrings); override;
|
||||
function ReadString(const Section, Ident, Default: string): string; override;
|
||||
procedure Rename(const FileName: string; Reload: Boolean);
|
||||
procedure SetStrings(List: TStrings);
|
||||
procedure UpdateFile; override;
|
||||
procedure WriteString(const Section, Ident, Value: String); override;
|
||||
property CaseSensitive: Boolean read GetCaseSensitive write SetCaseSensitive;
|
||||
end;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
{ TIniFile - Encapsulates the Windows INI file interface
|
||||
(Get/SetPrivateProfileXXX functions) }
|
||||
|
||||
TIniFile = class(TCustomIniFile)
|
||||
public
|
||||
destructor Destroy; override;
|
||||
function ReadString(const Section, Ident, Default: string): string; override;
|
||||
procedure WriteString(const Section, Ident, Value: String); override;
|
||||
procedure ReadSection(const Section: string; Strings: TStrings); override;
|
||||
procedure ReadSections(Strings: TStrings); override;
|
||||
procedure ReadSectionValues(const Section: string; Strings: TStrings); override;
|
||||
procedure EraseSection(const Section: string); override;
|
||||
procedure DeleteKey(const Section, Ident: String); override;
|
||||
procedure UpdateFile; override;
|
||||
end;
|
||||
{$ELSE}
|
||||
TIniFile = class(TMemIniFile)
|
||||
public
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses RTLConsts
|
||||
{$IFDEF MSWINDOWS}
|
||||
, Windows
|
||||
{$ENDIF};
|
||||
|
||||
{ TCustomIniFile }
|
||||
|
||||
constructor TCustomIniFile.Create(const FileName: string);
|
||||
begin
|
||||
FFileName := FileName;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.SectionExists(const Section: string): Boolean;
|
||||
var
|
||||
S: TStrings;
|
||||
begin
|
||||
S := TStringList.Create;
|
||||
try
|
||||
ReadSection(Section, S);
|
||||
Result := S.Count > 0;
|
||||
finally
|
||||
S.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadInteger(const Section, Ident: string;
|
||||
Default: Longint): Longint;
|
||||
var
|
||||
IntStr: string;
|
||||
begin
|
||||
IntStr := ReadString(Section, Ident, '');
|
||||
if (Length(IntStr) > 2) and (IntStr[1] = '0') and
|
||||
((IntStr[2] = 'X') or (IntStr[2] = 'x')) then
|
||||
IntStr := '$' + Copy(IntStr, 3, Maxint);
|
||||
Result := StrToIntDef(IntStr, Default);
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteInteger(const Section, Ident: string; Value: Longint);
|
||||
begin
|
||||
WriteString(Section, Ident, IntToStr(Value));
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadBool(const Section, Ident: string;
|
||||
Default: Boolean): Boolean;
|
||||
begin
|
||||
Result := ReadInteger(Section, Ident, Ord(Default)) <> 0;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadDate(const Section, Name: string; Default: TDateTime): TDateTime;
|
||||
var
|
||||
DateStr: string;
|
||||
begin
|
||||
DateStr := ReadString(Section, Name, '');
|
||||
Result := Default;
|
||||
if DateStr <> '' then
|
||||
try
|
||||
Result := StrToDate(DateStr);
|
||||
except
|
||||
on EConvertError do
|
||||
// Ignore EConvertError exceptions
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadDateTime(const Section, Name: string; Default: TDateTime): TDateTime;
|
||||
var
|
||||
DateStr: string;
|
||||
begin
|
||||
DateStr := ReadString(Section, Name, '');
|
||||
Result := Default;
|
||||
if DateStr <> '' then
|
||||
try
|
||||
Result := StrToDateTime(DateStr);
|
||||
except
|
||||
on EConvertError do
|
||||
// Ignore EConvertError exceptions
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadFloat(const Section, Name: string; Default: Double): Double;
|
||||
var
|
||||
FloatStr: string;
|
||||
begin
|
||||
FloatStr := ReadString(Section, Name, '');
|
||||
Result := Default;
|
||||
if FloatStr <> '' then
|
||||
try
|
||||
Result := StrToFloat(FloatStr);
|
||||
except
|
||||
on EConvertError do
|
||||
// Ignore EConvertError exceptions
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadTime(const Section, Name: string; Default: TDateTime): TDateTime;
|
||||
var
|
||||
TimeStr: string;
|
||||
begin
|
||||
TimeStr := ReadString(Section, Name, '');
|
||||
Result := Default;
|
||||
if TimeStr <> '' then
|
||||
try
|
||||
Result := StrToTime(TimeStr);
|
||||
except
|
||||
on EConvertError do
|
||||
// Ignore EConvertError exceptions
|
||||
else
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteDate(const Section, Name: string; Value: TDateTime);
|
||||
begin
|
||||
WriteString(Section, Name, DateToStr(Value));
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteDateTime(const Section, Name: string; Value: TDateTime);
|
||||
begin
|
||||
WriteString(Section, Name, DateTimeToStr(Value));
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteFloat(const Section, Name: string; Value: Double);
|
||||
begin
|
||||
WriteString(Section, Name, FloatToStr(Value));
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteTime(const Section, Name: string; Value: TDateTime);
|
||||
begin
|
||||
WriteString(Section, Name, TimeToStr(Value));
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteBool(const Section, Ident: string; Value: Boolean);
|
||||
const
|
||||
Values: array[Boolean] of string = ('0', '1');
|
||||
begin
|
||||
WriteString(Section, Ident, Values[Value]);
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ValueExists(const Section, Ident: string): Boolean;
|
||||
var
|
||||
S: TStrings;
|
||||
begin
|
||||
S := TStringList.Create;
|
||||
try
|
||||
ReadSection(Section, S);
|
||||
Result := S.IndexOf(Ident) > -1;
|
||||
finally
|
||||
S.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomIniFile.ReadBinaryStream(const Section, Name: string;
|
||||
Value: TStream): Integer;
|
||||
var
|
||||
Text: string;
|
||||
Stream: TMemoryStream;
|
||||
Pos: Integer;
|
||||
begin
|
||||
Text := ReadString(Section, Name, '');
|
||||
if Text <> '' then
|
||||
begin
|
||||
if Value is TMemoryStream then
|
||||
Stream := TMemoryStream(Value)
|
||||
else
|
||||
Stream := TMemoryStream.Create;
|
||||
|
||||
try
|
||||
Pos := Stream.Position;
|
||||
Stream.SetSize(Stream.Size + Length(Text) div 2);
|
||||
HexToBin(PChar(Text), PChar(Integer(Stream.Memory) + Stream.Position), Length(Text) div 2);
|
||||
Stream.Position := Pos;
|
||||
if Value <> Stream then
|
||||
Value.CopyFrom(Stream, Length(Text) div 2);
|
||||
Result := Stream.Size - Pos;
|
||||
finally
|
||||
if Value <> Stream then
|
||||
Stream.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
procedure TCustomIniFile.WriteBinaryStream(const Section, Name: string;
|
||||
Value: TStream);
|
||||
var
|
||||
Text: string;
|
||||
Stream: TMemoryStream;
|
||||
begin
|
||||
SetLength(Text, (Value.Size - Value.Position) * 2);
|
||||
if Length(Text) > 0 then
|
||||
begin
|
||||
if Value is TMemoryStream then
|
||||
Stream := TMemoryStream(Value)
|
||||
else
|
||||
Stream := TMemoryStream.Create;
|
||||
|
||||
try
|
||||
if Stream <> Value then
|
||||
begin
|
||||
Stream.CopyFrom(Value, Value.Size - Value.Position);
|
||||
Stream.Position := 0;
|
||||
end;
|
||||
BinToHex(PChar(Integer(Stream.Memory) + Stream.Position), PChar(Text),
|
||||
Stream.Size - Stream.Position);
|
||||
finally
|
||||
if Value <> Stream then
|
||||
Stream.Free;
|
||||
end;
|
||||
end;
|
||||
WriteString(Section, Name, Text);
|
||||
end;
|
||||
|
||||
{ TStringHash }
|
||||
|
||||
procedure TStringHash.Add(const Key: string; Value: Integer);
|
||||
var
|
||||
Hash: Integer;
|
||||
Bucket: PHashItem;
|
||||
begin
|
||||
Hash := HashOf(Key) mod Cardinal(Length(Buckets));
|
||||
New(Bucket);
|
||||
Bucket^.Key := Key;
|
||||
Bucket^.Value := Value;
|
||||
Bucket^.Next := Buckets[Hash];
|
||||
Buckets[Hash] := Bucket;
|
||||
end;
|
||||
|
||||
procedure TStringHash.Clear;
|
||||
var
|
||||
I: Integer;
|
||||
P, N: PHashItem;
|
||||
begin
|
||||
for I := 0 to Length(Buckets) - 1 do
|
||||
begin
|
||||
P := Buckets[I];
|
||||
while P <> nil do
|
||||
begin
|
||||
N := P^.Next;
|
||||
Dispose(P);
|
||||
P := N;
|
||||
end;
|
||||
Buckets[I] := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TStringHash.Create(Size: Cardinal);
|
||||
begin
|
||||
inherited Create;
|
||||
SetLength(Buckets, Size);
|
||||
end;
|
||||
|
||||
destructor TStringHash.Destroy;
|
||||
begin
|
||||
Clear;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TStringHash.Find(const Key: string): PPHashItem;
|
||||
var
|
||||
Hash: Integer;
|
||||
begin
|
||||
Hash := HashOf(Key) mod Cardinal(Length(Buckets));
|
||||
Result := @Buckets[Hash];
|
||||
while Result^ <> nil do
|
||||
begin
|
||||
if Result^.Key = Key then
|
||||
Exit
|
||||
else
|
||||
Result := @Result^.Next;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TStringHash.HashOf(const Key: string): Cardinal;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
Result := 0;
|
||||
for I := 1 to Length(Key) do
|
||||
Result := ((Result shl 2) or (Result shr (SizeOf(Result) * 8 - 2))) xor
|
||||
Ord(Key[I]);
|
||||
end;
|
||||
|
||||
function TStringHash.Modify(const Key: string; Value: Integer): Boolean;
|
||||
var
|
||||
P: PHashItem;
|
||||
begin
|
||||
P := Find(Key)^;
|
||||
if P <> nil then
|
||||
begin
|
||||
Result := True;
|
||||
P^.Value := Value;
|
||||
end
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TStringHash.Remove(const Key: string);
|
||||
var
|
||||
P: PHashItem;
|
||||
Prev: PPHashItem;
|
||||
begin
|
||||
Prev := Find(Key);
|
||||
P := Prev^;
|
||||
if P <> nil then
|
||||
begin
|
||||
Prev^ := P^.Next;
|
||||
Dispose(P);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TStringHash.ValueOf(const Key: string): Integer;
|
||||
var
|
||||
P: PHashItem;
|
||||
begin
|
||||
P := Find(Key)^;
|
||||
if P <> nil then
|
||||
Result := P^.Value
|
||||
else
|
||||
Result := -1;
|
||||
end;
|
||||
|
||||
{ THashedStringList }
|
||||
|
||||
procedure THashedStringList.Changed;
|
||||
begin
|
||||
inherited Changed;
|
||||
FValueHashValid := False;
|
||||
FNameHashValid := False;
|
||||
end;
|
||||
|
||||
destructor THashedStringList.Destroy;
|
||||
begin
|
||||
FValueHash.Free;
|
||||
FNameHash.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function THashedStringList.IndexOf(const S: string): Integer;
|
||||
begin
|
||||
UpdateValueHash;
|
||||
if not CaseSensitive then
|
||||
Result := FValueHash.ValueOf(AnsiUpperCase(S))
|
||||
else
|
||||
Result := FValueHash.ValueOf(S);
|
||||
end;
|
||||
|
||||
function THashedStringList.IndexOfName(const Name: string): Integer;
|
||||
begin
|
||||
UpdateNameHash;
|
||||
if not CaseSensitive then
|
||||
Result := FNameHash.ValueOf(AnsiUpperCase(Name))
|
||||
else
|
||||
Result := FNameHash.ValueOf(Name);
|
||||
end;
|
||||
|
||||
procedure THashedStringList.UpdateNameHash;
|
||||
var
|
||||
I: Integer;
|
||||
P: Integer;
|
||||
Key: string;
|
||||
begin
|
||||
if FNameHashValid then Exit;
|
||||
|
||||
if FNameHash = nil then
|
||||
FNameHash := TStringHash.Create
|
||||
else
|
||||
FNameHash.Clear;
|
||||
for I := 0 to Count - 1 do
|
||||
begin
|
||||
Key := Get(I);
|
||||
P := AnsiPos(NameValueSeparator, Key);
|
||||
if P <> 0 then
|
||||
begin
|
||||
if not CaseSensitive then
|
||||
Key := AnsiUpperCase(Copy(Key, 1, P - 1))
|
||||
else
|
||||
Key := Copy(Key, 1, P - 1);
|
||||
FNameHash.Add(Key, I);
|
||||
end;
|
||||
end;
|
||||
FNameHashValid := True;
|
||||
end;
|
||||
|
||||
procedure THashedStringList.UpdateValueHash;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if FValueHashValid then Exit;
|
||||
|
||||
if FValueHash = nil then
|
||||
FValueHash := TStringHash.Create
|
||||
else
|
||||
FValueHash.Clear;
|
||||
for I := 0 to Count - 1 do
|
||||
if not CaseSensitive then
|
||||
FValueHash.Add(AnsiUpperCase(Self[I]), I)
|
||||
else
|
||||
FValueHash.Add(Self[I], I);
|
||||
FValueHashValid := True;
|
||||
end;
|
||||
|
||||
{ TMemIniFile }
|
||||
|
||||
constructor TMemIniFile.Create(const FileName: string);
|
||||
begin
|
||||
inherited Create(FileName);
|
||||
FSections := THashedStringList.Create;
|
||||
{$IFDEF LINUX}
|
||||
FSections.CaseSensitive := True;
|
||||
{$ENDIF}
|
||||
LoadValues;
|
||||
end;
|
||||
|
||||
destructor TMemIniFile.Destroy;
|
||||
begin
|
||||
if FSections <> nil then
|
||||
Clear;
|
||||
FSections.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TMemIniFile.AddSection(const Section: string): TStrings;
|
||||
begin
|
||||
Result := THashedStringList.Create;
|
||||
try
|
||||
THashedStringList(Result).CaseSensitive := CaseSensitive;
|
||||
FSections.AddObject(Section, Result);
|
||||
except
|
||||
Result.Free;
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.Clear;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
for I := 0 to FSections.Count - 1 do
|
||||
TObject(FSections.Objects[I]).Free;
|
||||
FSections.Clear;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.DeleteKey(const Section, Ident: String);
|
||||
var
|
||||
I, J: Integer;
|
||||
Strings: TStrings;
|
||||
begin
|
||||
I := FSections.IndexOf(Section);
|
||||
if I >= 0 then
|
||||
begin
|
||||
Strings := TStrings(FSections.Objects[I]);
|
||||
J := Strings.IndexOfName(Ident);
|
||||
if J >= 0 then
|
||||
Strings.Delete(J);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.EraseSection(const Section: string);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
I := FSections.IndexOf(Section);
|
||||
if I >= 0 then
|
||||
begin
|
||||
TStrings(FSections.Objects[I]).Free;
|
||||
FSections.Delete(I);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMemIniFile.GetCaseSensitive: Boolean;
|
||||
begin
|
||||
Result := FSections.CaseSensitive;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.GetStrings(List: TStrings);
|
||||
var
|
||||
I, J: Integer;
|
||||
Strings: TStrings;
|
||||
begin
|
||||
List.BeginUpdate;
|
||||
try
|
||||
for I := 0 to FSections.Count - 1 do
|
||||
begin
|
||||
List.Add('[' + FSections[I] + ']');
|
||||
Strings := TStrings(FSections.Objects[I]);
|
||||
for J := 0 to Strings.Count - 1 do List.Add(Strings[J]);
|
||||
List.Add('');
|
||||
end;
|
||||
finally
|
||||
List.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.LoadValues;
|
||||
var
|
||||
List: TStringList;
|
||||
begin
|
||||
if (FileName <> '') and FileExists(FileName) then
|
||||
begin
|
||||
List := TStringList.Create;
|
||||
try
|
||||
List.LoadFromFile(FileName);
|
||||
SetStrings(List);
|
||||
finally
|
||||
List.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
Clear;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.ReadSection(const Section: string;
|
||||
Strings: TStrings);
|
||||
var
|
||||
I, J: Integer;
|
||||
SectionStrings: TStrings;
|
||||
begin
|
||||
Strings.BeginUpdate;
|
||||
try
|
||||
Strings.Clear;
|
||||
I := FSections.IndexOf(Section);
|
||||
if I >= 0 then
|
||||
begin
|
||||
SectionStrings := TStrings(FSections.Objects[I]);
|
||||
for J := 0 to SectionStrings.Count - 1 do
|
||||
Strings.Add(SectionStrings.Names[J]);
|
||||
end;
|
||||
finally
|
||||
Strings.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.ReadSections(Strings: TStrings);
|
||||
begin
|
||||
Strings.Assign(FSections);
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.ReadSectionValues(const Section: string;
|
||||
Strings: TStrings);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
Strings.BeginUpdate;
|
||||
try
|
||||
Strings.Clear;
|
||||
I := FSections.IndexOf(Section);
|
||||
if I >= 0 then
|
||||
Strings.Assign(TStrings(FSections.Objects[I]));
|
||||
finally
|
||||
Strings.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TMemIniFile.ReadString(const Section, Ident,
|
||||
Default: string): string;
|
||||
var
|
||||
I: Integer;
|
||||
Strings: TStrings;
|
||||
begin
|
||||
I := FSections.IndexOf(Section);
|
||||
if I >= 0 then
|
||||
begin
|
||||
Strings := TStrings(FSections.Objects[I]);
|
||||
I := Strings.IndexOfName(Ident);
|
||||
if I >= 0 then
|
||||
begin
|
||||
Result := Copy(Strings[I], Length(Ident) + 2, Maxint);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Result := Default;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.Rename(const FileName: string; Reload: Boolean);
|
||||
begin
|
||||
FFileName := FileName;
|
||||
if Reload then
|
||||
LoadValues;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.SetCaseSensitive(Value: Boolean);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if Value <> FSections.CaseSensitive then
|
||||
begin
|
||||
FSections.CaseSensitive := Value;
|
||||
for I := 0 to FSections.Count - 1 do
|
||||
with THashedStringList(FSections.Objects[I]) do
|
||||
begin
|
||||
CaseSensitive := Value;
|
||||
Changed;
|
||||
end;
|
||||
THashedStringList(FSections).Changed;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.SetStrings(List: TStrings);
|
||||
var
|
||||
I, J: Integer;
|
||||
S: string;
|
||||
Strings: TStrings;
|
||||
begin
|
||||
Clear;
|
||||
Strings := nil;
|
||||
for I := 0 to List.Count - 1 do
|
||||
begin
|
||||
S := Trim(List[I]);
|
||||
if (S <> '') and (S[1] <> ';') then
|
||||
if (S[1] = '[') and (S[Length(S)] = ']') then
|
||||
begin
|
||||
Delete(S, 1, 1);
|
||||
SetLength(S, Length(S)-1);
|
||||
Strings := AddSection(Trim(S));
|
||||
end
|
||||
else
|
||||
if Strings <> nil then
|
||||
begin
|
||||
J := Pos('=', S);
|
||||
if J > 0 then // remove spaces before and after '='
|
||||
Strings.Add(Trim(Copy(S, 1, J-1)) + '=' + Trim(Copy(S, J+1, MaxInt)) )
|
||||
else
|
||||
Strings.Add(S);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.UpdateFile;
|
||||
var
|
||||
List: TStringList;
|
||||
begin
|
||||
List := TStringList.Create;
|
||||
try
|
||||
GetStrings(List);
|
||||
List.SaveToFile(FFileName);
|
||||
finally
|
||||
List.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMemIniFile.WriteString(const Section, Ident, Value: String);
|
||||
var
|
||||
I: Integer;
|
||||
S: string;
|
||||
Strings: TStrings;
|
||||
begin
|
||||
I := FSections.IndexOf(Section);
|
||||
if I >= 0 then
|
||||
Strings := TStrings(FSections.Objects[I])
|
||||
else
|
||||
Strings := AddSection(Section);
|
||||
S := Ident + '=' + Value;
|
||||
I := Strings.IndexOfName(Ident);
|
||||
if I >= 0 then
|
||||
Strings[I] := S
|
||||
else
|
||||
Strings.Add(S);
|
||||
end;
|
||||
|
||||
{$IFDEF MSWINDOWS}
|
||||
{ TIniFile }
|
||||
|
||||
destructor TIniFile.Destroy;
|
||||
begin
|
||||
UpdateFile; // flush changes to disk
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TIniFile.ReadString(const Section, Ident, Default: string): string;
|
||||
var
|
||||
Buffer: array[0..2047] of Char;
|
||||
begin
|
||||
SetString(Result, Buffer, GetPrivateProfileString(PChar(Section),
|
||||
PChar(Ident), PChar(Default), Buffer, SizeOf(Buffer), PChar(FFileName)));
|
||||
end;
|
||||
|
||||
procedure TIniFile.WriteString(const Section, Ident, Value: string);
|
||||
begin
|
||||
if not WritePrivateProfileString(PChar(Section), PChar(Ident),
|
||||
PChar(Value), PChar(FFileName)) then
|
||||
raise EIniFileException.CreateResFmt(@SIniFileWriteError, [FileName]);
|
||||
end;
|
||||
|
||||
procedure TIniFile.ReadSections(Strings: TStrings);
|
||||
const
|
||||
BufSize = 16384;
|
||||
var
|
||||
Buffer, P: PChar;
|
||||
begin
|
||||
GetMem(Buffer, BufSize);
|
||||
try
|
||||
Strings.BeginUpdate;
|
||||
try
|
||||
Strings.Clear;
|
||||
if GetPrivateProfileString(nil, nil, nil, Buffer, BufSize,
|
||||
PChar(FFileName)) <> 0 then
|
||||
begin
|
||||
P := Buffer;
|
||||
while P^ <> #0 do
|
||||
begin
|
||||
Strings.Add(P);
|
||||
Inc(P, StrLen(P) + 1);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Strings.EndUpdate;
|
||||
end;
|
||||
finally
|
||||
FreeMem(Buffer, BufSize);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIniFile.ReadSection(const Section: string; Strings: TStrings);
|
||||
const
|
||||
BufSize = 16384;
|
||||
var
|
||||
Buffer, P: PChar;
|
||||
begin
|
||||
GetMem(Buffer, BufSize);
|
||||
try
|
||||
Strings.BeginUpdate;
|
||||
try
|
||||
Strings.Clear;
|
||||
if GetPrivateProfileString(PChar(Section), nil, nil, Buffer, BufSize,
|
||||
PChar(FFileName)) <> 0 then
|
||||
begin
|
||||
P := Buffer;
|
||||
while P^ <> #0 do
|
||||
begin
|
||||
Strings.Add(P);
|
||||
Inc(P, StrLen(P) + 1);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Strings.EndUpdate;
|
||||
end;
|
||||
finally
|
||||
FreeMem(Buffer, BufSize);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIniFile.ReadSectionValues(const Section: string; Strings: TStrings);
|
||||
var
|
||||
KeyList: TStringList;
|
||||
I: Integer;
|
||||
begin
|
||||
KeyList := TStringList.Create;
|
||||
try
|
||||
ReadSection(Section, KeyList);
|
||||
Strings.BeginUpdate;
|
||||
try
|
||||
Strings.Clear;
|
||||
for I := 0 to KeyList.Count - 1 do
|
||||
Strings.Add(KeyList[I] + '=' + ReadString(Section, KeyList[I], ''))
|
||||
finally
|
||||
Strings.EndUpdate;
|
||||
end;
|
||||
finally
|
||||
KeyList.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIniFile.EraseSection(const Section: string);
|
||||
begin
|
||||
if not WritePrivateProfileString(PChar(Section), nil, nil, PChar(FFileName)) then
|
||||
raise EIniFileException.CreateResFmt(@SIniFileWriteError, [FileName]);
|
||||
end;
|
||||
|
||||
procedure TIniFile.DeleteKey(const Section, Ident: String);
|
||||
begin
|
||||
WritePrivateProfileString(PChar(Section), PChar(Ident), nil, PChar(FFileName));
|
||||
end;
|
||||
|
||||
procedure TIniFile.UpdateFile;
|
||||
begin
|
||||
WritePrivateProfileString(nil, nil, nil, PChar(FFileName));
|
||||
end;
|
||||
{$ELSE}
|
||||
|
||||
destructor TIniFile.Destroy;
|
||||
begin
|
||||
UpdateFile;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
7
云翔OA(WTOA.dll)/JCYData.INI
Normal file
7
云翔OA(WTOA.dll)/JCYData.INI
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[系统配置]
|
||||
串口号=com1
|
||||
波特率=9600
|
||||
校验位=0
|
||||
数据位=8
|
||||
停止位=0
|
||||
频率=100
|
||||
7
云翔OA(WTOA.dll)/JZCRS323C.INI
Normal file
7
云翔OA(WTOA.dll)/JZCRS323C.INI
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[系统配置]
|
||||
串口号=com2
|
||||
波特率=1200
|
||||
校验位=0
|
||||
数据位=8
|
||||
停止位=0
|
||||
频率=100
|
||||
0
云翔OA(WTOA.dll)/JZCRS323CList.txt
Normal file
0
云翔OA(WTOA.dll)/JZCRS323CList.txt
Normal file
23
云翔OA(WTOA.dll)/ProjectGroup1.bpg
Normal file
23
云翔OA(WTOA.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)
|
||||
|
||||
|
||||
5
云翔OA(WTOA.dll)/SYSTEMSET.ini
Normal file
5
云翔OA(WTOA.dll)/SYSTEMSET.ini
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[SERVER]
|
||||
服务器地址=106.14.113.234
|
||||
服务器地址类型=78
|
||||
是否自动更新=1
|
||||
软件名称=云翔管理软件
|
||||
664
云翔OA(WTOA.dll)/U_BpRklist.dfm
Normal file
664
云翔OA(WTOA.dll)/U_BpRklist.dfm
Normal file
|
|
@ -0,0 +1,664 @@
|
|||
object frmBpRklist: TfrmBpRklist
|
||||
Left = 190
|
||||
Top = 133
|
||||
Width = 1403
|
||||
Height = 708
|
||||
Caption = #38754#26009#20837#24211#21015#34920
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1387
|
||||
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_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBExport: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 75
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBRafresh: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#35810
|
||||
ImageIndex = 24
|
||||
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 = 1387
|
||||
Height = 83
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 25
|
||||
Top = 16
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20837#24211#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 67
|
||||
Top = 43
|
||||
Width = 14
|
||||
Height = 13
|
||||
Caption = #33267
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 550
|
||||
Top = 43
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20135#21697#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 206
|
||||
Top = 43
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #39068' '#33394
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 207
|
||||
Top = 16
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20837#24211#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 312
|
||||
Top = 108
|
||||
Width = 26
|
||||
Height = 13
|
||||
Caption = #20179#24211
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 719
|
||||
Top = 130
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #32568' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label13: TLabel
|
||||
Left = 381
|
||||
Top = 43
|
||||
Width = 58
|
||||
Height = 13
|
||||
Caption = #21512' '#21516' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label14: TLabel
|
||||
Left = 381
|
||||
Top = 16
|
||||
Width = 58
|
||||
Height = 13
|
||||
Caption = #35746' '#21333' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label15: TLabel
|
||||
Left = 550
|
||||
Top = 16
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #21697' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 82
|
||||
Top = 12
|
||||
Width = 97
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 82
|
||||
Top = 39
|
||||
Width = 97
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object P_CodeName: TEdit
|
||||
Tag = 2
|
||||
Left = 611
|
||||
Top = 39
|
||||
Width = 87
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object P_Color: TEdit
|
||||
Tag = 2
|
||||
Left = 267
|
||||
Top = 39
|
||||
Width = 87
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object CRType: TComboBox
|
||||
Tag = 2
|
||||
Left = 267
|
||||
Top = 12
|
||||
Width = 87
|
||||
Height = 21
|
||||
Style = csDropDownList
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
TabOrder = 4
|
||||
OnChange = P_CodeNameChange
|
||||
Items.Strings = (
|
||||
''
|
||||
#29983#20135#20837#24211)
|
||||
end
|
||||
object ckName: TComboBox
|
||||
Left = 347
|
||||
Top = 104
|
||||
Width = 108
|
||||
Height = 21
|
||||
Style = csDropDownList
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
TabOrder = 5
|
||||
Text = #26679#21697#20179#24211
|
||||
Items.Strings = (
|
||||
#26679#21697#20179#24211)
|
||||
end
|
||||
object gangNo: TEdit
|
||||
Tag = 2
|
||||
Left = 780
|
||||
Top = 126
|
||||
Width = 87
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 25
|
||||
Top = 61
|
||||
Width = 105
|
||||
Height = 18
|
||||
Caption = #20840#36873
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 7
|
||||
OnClick = CheckBox1Click
|
||||
end
|
||||
object OrderNo: TEdit
|
||||
Tag = 2
|
||||
Left = 442
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 20
|
||||
TabOrder = 8
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object conNo: TEdit
|
||||
Tag = 2
|
||||
Left = 442
|
||||
Top = 39
|
||||
Width = 87
|
||||
Height = 20
|
||||
TabOrder = 9
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
object P_Code: TEdit
|
||||
Tag = 2
|
||||
Left = 611
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 20
|
||||
TabOrder = 10
|
||||
OnChange = P_CodeNameChange
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 115
|
||||
Width = 1387
|
||||
Height = 533
|
||||
Align = alTop
|
||||
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
|
||||
Column = v1RollNum
|
||||
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_WTOA.Default
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 47
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #35746#21333#21495
|
||||
DataBinding.FieldName = 'orderNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1custName: TcxGridDBColumn
|
||||
Caption = #20837#24211#21333#20301
|
||||
DataBinding.FieldName = 'custName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 87
|
||||
end
|
||||
object v1CRTime: TcxGridDBColumn
|
||||
Caption = #20837#24211#26085#26399
|
||||
DataBinding.FieldName = 'CRTime'
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1CRType: TcxGridDBColumn
|
||||
Caption = #20837#24211#31867#22411
|
||||
DataBinding.FieldName = 'CRType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24211#20301
|
||||
DataBinding.FieldName = 'kuwei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1MJXH: TcxGridDBColumn
|
||||
Caption = #21367#21495
|
||||
DataBinding.FieldName = 'MJXH'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1P_Code: TcxGridDBColumn
|
||||
Caption = #21697#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#22411#21495
|
||||
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 v1Column2: TcxGridDBColumn
|
||||
Caption = #32568#21495
|
||||
DataBinding.FieldName = 'gangNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1CPType: TcxGridDBColumn
|
||||
Caption = #31561#32423
|
||||
DataBinding.FieldName = 'CPType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1RollNum: TcxGridDBColumn
|
||||
Caption = #21305#25968
|
||||
DataBinding.FieldName = 'RollNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_WTOA.FontBlue
|
||||
Styles.Footer = DataLink_WTOA.FontBlue
|
||||
Styles.Header = DataLink_WTOA.FontBlue
|
||||
Width = 50
|
||||
end
|
||||
object v1Qty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_WTOA.FontBlue
|
||||
Styles.Footer = DataLink_WTOA.FontBlue
|
||||
Styles.Header = DataLink_WTOA.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 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 = #33394#21495
|
||||
DataBinding.FieldName = 'P_ColNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'P_HX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #26579#21378#32568#21495
|
||||
DataBinding.FieldName = 'RCgangNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 60
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 746
|
||||
Top = 164
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1116
|
||||
Top = 158
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 1152
|
||||
Top = 157
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 871
|
||||
Top = 166
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 958
|
||||
Top = 165
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 827
|
||||
Top = 167
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 783
|
||||
Top = 165
|
||||
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
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 913
|
||||
Top = 165
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_MD: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOPrint1
|
||||
Left = 1038
|
||||
Top = 165
|
||||
end
|
||||
object ADOPrint1: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1078
|
||||
Top = 162
|
||||
end
|
||||
object RMGridReport1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbSaveToXLS, 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
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 993
|
||||
Top = 166
|
||||
ReportData = {}
|
||||
end
|
||||
end
|
||||
255
云翔OA(WTOA.dll)/U_BpRklist.pas
Normal file
255
云翔OA(WTOA.dll)/U_BpRklist.pas
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
unit U_BpRklist;
|
||||
|
||||
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;
|
||||
|
||||
type
|
||||
TfrmBpRklist = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBFind: 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;
|
||||
v1RollNum: 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;
|
||||
v1MJXH: TcxGridDBColumn;
|
||||
v1CPType: TcxGridDBColumn;
|
||||
ckName: TComboBox;
|
||||
Label6: TLabel;
|
||||
v1P_Color: TcxGridDBColumn;
|
||||
v1P_Code: TcxGridDBColumn;
|
||||
v1custName: TcxGridDBColumn;
|
||||
v1Price: TcxGridDBColumn;
|
||||
v1money: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
gangNo: TEdit;
|
||||
Label10: TLabel;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
RM1: TRMGridReport;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
CheckBox1: TCheckBox;
|
||||
OrderNo: TEdit;
|
||||
conNo: TEdit;
|
||||
Label13: TLabel;
|
||||
Label14: TLabel;
|
||||
P_Code: TEdit;
|
||||
Label15: TLabel;
|
||||
RMDB_MD: TRMDBDataSet;
|
||||
ADOPrint1: TADOQuery;
|
||||
RMGridReport1: TRMGridReport;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure P_CodeNameChange(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure TBPrintClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
procedure SetComboBox();
|
||||
{ Private declarations }
|
||||
public
|
||||
fCKName:string;
|
||||
fCRType:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmBpRklist: TfrmBpRklist;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10,U_ZDYHelp;
|
||||
{$R *.dfm}
|
||||
procedure TfrmBpRklist.SetComboBox();
|
||||
begin
|
||||
ckName.Items.Clear;
|
||||
with adoQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where Type=''CPCK'' ');
|
||||
if trim(fCKName)<>'' then
|
||||
sql.Add('and zdyName='+quotedstr(trim(fCKName)));
|
||||
open;
|
||||
while not eof do
|
||||
begin
|
||||
ckName.Items.Add(trim(fieldbyname('zdyName').AsString));
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
if ckName.Items.Count>0 then ckName.ItemIndex:=0;
|
||||
|
||||
CRType.Items.Clear;
|
||||
CRType.Items.Add('');
|
||||
with adoQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where Type=''CPRKTYPE''');
|
||||
if trim(fCKName)<>'' then
|
||||
sql.Add('and note='+quotedstr(trim(fCKName)));
|
||||
open;
|
||||
while not eof do
|
||||
begin
|
||||
CRType.Items.Add(trim(fieldbyname('zdyName').AsString));
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
if CRType.Items.Count>0 then CRType.ItemIndex:=0;
|
||||
|
||||
IF trim(fCRType)<>'' then
|
||||
begin
|
||||
CRType.ItemIndex:=CRType.Items.IndexOf(trim(fCRType));
|
||||
CRType.Enabled:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.InitGrid();
|
||||
begin
|
||||
try
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.OrderNo,B.ConNo ');
|
||||
sql.Add('from CP_InOut1 A');
|
||||
sql.Add('left join JYorder_main B on B.MainID=A.MainiD ');
|
||||
sql.Add('where CRTime>='''+formatdateTime('yyyy-MM-dd',begdate.Date)+''' ');
|
||||
sql.Add('and CRTime<'''+formatdateTime('yyyy-MM-dd',enddate.Date+1)+''' ');
|
||||
sql.Add('and CRFlag=''入库'' ');
|
||||
sql.Add('and A.ckName=''面料仓库''');
|
||||
sql.Add(' and A.CRType=''采购入库''');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(adoqueryTmp,CDS_Main);
|
||||
SInitCDSData20(adoqueryTmp,CDS_Main);
|
||||
TBFind.Click;
|
||||
finally;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
writeCxGrid(self.Caption,Tv1,'成品仓库');
|
||||
Action:=cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmBpRklist:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.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 TfrmBpRklist.FormShow(Sender: TObject);
|
||||
begin
|
||||
readCxGrid(self.Caption,Tv1,'成品仓库');
|
||||
SetComboBox();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.FormCreate(Sender: TObject);
|
||||
begin
|
||||
BegDate.Date:=SGetServerDate(ADOQueryCmd)-7;
|
||||
EndDate.Date:=SGetServerDate(ADOQueryCmd);
|
||||
cxGrid1.Align:=alclient;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.TBPrintClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel(self.Caption,cxgrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if CDS_Main.Locate('Ssel',True,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmBpRklist.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 TfrmBpRklist.CheckBox1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main,checkbox1.Checked);
|
||||
end;
|
||||
|
||||
end.
|
||||
288
云翔OA(WTOA.dll)/U_CPAdd.dfm
Normal file
288
云翔OA(WTOA.dll)/U_CPAdd.dfm
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
object frmCPAdd: TfrmCPAdd
|
||||
Left = 134
|
||||
Top = 162
|
||||
Width = 1167
|
||||
Height = 399
|
||||
Align = alClient
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1151
|
||||
Height = 33
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_DDMD.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 126
|
||||
Top = 0
|
||||
Width = 131
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 10
|
||||
Top = 7
|
||||
Width = 97
|
||||
Height = 17
|
||||
Caption = #38376#24133#21333#20301#33521#23544
|
||||
TabOrder = 0
|
||||
OnClick = CheckBox1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 1151
|
||||
Height = 327
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.GroupByBox = False
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 112
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #32769#32534#21495
|
||||
DataBinding.FieldName = 'OldCYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taRightJustify
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1Column13PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1Column2PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 80
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 63
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1Column7PropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 62
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1Column8PropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #20013#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column41: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #33521#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColorEng'
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 60
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPriceKg'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1Column20PropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 53
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #31859#20215
|
||||
DataBinding.FieldName = 'CYPriceM'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #38754#26009#26469#28304
|
||||
DataBinding.FieldName = 'CYFrom'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 91
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Tag = 3
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 85
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object CDS_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 416
|
||||
Top = 208
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 453
|
||||
Top = 209
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Sub
|
||||
Left = 491
|
||||
Top = 211
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 589
|
||||
Top = 169
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 573
|
||||
Top = 121
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 528
|
||||
Top = 216
|
||||
end
|
||||
end
|
||||
632
云翔OA(WTOA.dll)/U_CPAdd.pas
Normal file
632
云翔OA(WTOA.dll)/U_CPAdd.pas
Normal file
|
|
@ -0,0 +1,632 @@
|
|||
unit U_CPAdd;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ADODB, DBClient, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, ComCtrls, ToolWin,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit, cxButtonEdit,
|
||||
StdCtrls, ExtCtrls;
|
||||
|
||||
type
|
||||
TfrmCPAdd = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
CDS_Sub: TClientDataSet;
|
||||
ADOQueryMain: TADOQuery;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Column41: TcxGridDBColumn;
|
||||
Panel1: TPanel;
|
||||
CheckBox1: TCheckBox;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure v1Column7PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1Column8PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1Column2PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column26PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column27PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column20PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure v1Column13PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
private
|
||||
canshu1:string;
|
||||
Fint:Integer;
|
||||
procedure InitSubGrid();
|
||||
function SaveData():Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
FCYID,FCYCode,FCPID,FCPNO:String;
|
||||
CopyInt:Integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPAdd: TfrmCPAdd;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_iniParam,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPAdd.InitSubGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_YDang where CYID='''+Trim(FCYID)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Sub);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Sub);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,FFSj,FFQZSj,FFFSj,FFType:String;
|
||||
FFInt,i,j:Integer;
|
||||
ii:LongInt;
|
||||
begin
|
||||
//canshu1:=Trim(DParameters1);
|
||||
ReadCxGrid('样品编辑YT',Tv1,'样品管理');
|
||||
InitSubGrid();
|
||||
if CopyInt=1 then
|
||||
begin
|
||||
FCYID:='';
|
||||
end;
|
||||
{if Trim(YPCodeType)<>'' then
|
||||
begin
|
||||
if Trim(FCYID)='' then
|
||||
begin
|
||||
//取前缀
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYNO AA from CP_YDang ');
|
||||
SQL.Add('where Cast(CYID as int)=(select isnull(Max(Cast(CYID as int)),0) from CP_YDang where CYType='''+Trim(FCPID)+''')');
|
||||
Open;
|
||||
end;
|
||||
if Trim(ADOQueryTemp.fieldbyname('AA').asstring)='' then
|
||||
begin
|
||||
FFQZSj:=Trim(FCPNO);
|
||||
end else
|
||||
begin
|
||||
fsj:=Trim(ADOQueryTemp.fieldbyname('AA').asstring);
|
||||
FFInt:=0;
|
||||
i:=0;
|
||||
FFFSj:=Trim(Copy(fsj,Length(FCPNO)+1,Length(fsj)));
|
||||
while FFInt<=0 do
|
||||
begin
|
||||
FFSj:=Trim(Copy(fsj,Length(FCPNO)+1+i,Length(fsj)));
|
||||
if TryStrToInt(FFSj,ii) then
|
||||
begin
|
||||
if StrToInt(FFSj)>=0 then
|
||||
begin
|
||||
i:=i+1;
|
||||
end else
|
||||
begin
|
||||
FFInt:=1;
|
||||
FFQZSj:=Trim(Copy(fsj,1,Length(FCPNO)+i+1));//前缀字符串
|
||||
end;
|
||||
if i=Length(FFFSj) then
|
||||
begin
|
||||
FFInt:=1;
|
||||
FFQZSj:=Trim(FCPNO);
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
FFInt:=1;
|
||||
FFQZSj:=Trim(Copy(fsj,1,Length(FCPNO)+i+1));//前缀字符串
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//取前缀
|
||||
//取后缀
|
||||
if Trim(YPCodeType)='大类' then
|
||||
begin
|
||||
i:=99;
|
||||
while i>=1 do
|
||||
begin
|
||||
if i=99 then
|
||||
begin
|
||||
FFType:=Trim(FCPID);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CP_Type where CPID='''+Trim(FFType)+'''');
|
||||
Open;
|
||||
i:=fieldbyname('CPLevel').AsInteger;
|
||||
if i>1 then
|
||||
FFType:=Trim(fieldbyname('CPParent').AsString)
|
||||
else
|
||||
if i=1 then
|
||||
begin
|
||||
FFType:=Trim(fieldbyname('CPID').AsString);
|
||||
i:=0;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_Select_CP_YDang_MaxNo :CPType');
|
||||
Parameters.ParamByName('CPType').Value:=Trim(FFType);
|
||||
Open;
|
||||
end;
|
||||
end else
|
||||
if Trim(YPCodeType)='小类' then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYNO AA from CP_YDang ');
|
||||
SQL.Add('where Cast(CYID as int)=(select isnull(Max(Cast(CYID as int)),0) from CP_YDang where CYType='''+Trim(FCPID)+''')');
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
if Trim(ADOQueryTemp.fieldbyname('AA').asstring)='' then
|
||||
begin
|
||||
FFFSj:='0001';
|
||||
end else
|
||||
begin
|
||||
fsj:=Trim(ADOQueryTemp.fieldbyname('AA').asstring);
|
||||
FFInt:=0;
|
||||
i:=0;
|
||||
FFFSj:='';
|
||||
fsj:=Trim( Copy( fsj,Length(FFQZSj)+1,Length(fsj) ) );
|
||||
while FFInt<=0 do
|
||||
begin
|
||||
FFSj:=Trim(Copy(fsj,(Length(fsj)-i),(Length(fsj))));
|
||||
if TryStrToInt(FFSj,ii) then
|
||||
begin
|
||||
if StrToInt(FFSj)>=0 then
|
||||
begin
|
||||
FFFSj:=Trim(FFSj);//后缀数字字符串
|
||||
end else
|
||||
begin
|
||||
FFInt:=1;
|
||||
end;
|
||||
i:=i+1;
|
||||
if i=Length(fsj) then
|
||||
begin
|
||||
FFInt:=1;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
FFInt:=1;
|
||||
end;
|
||||
end;
|
||||
i:=Length(FFFSj); //数字编号长度 3
|
||||
FFInt:=StrToInt(FFFSj)+1;//最大号
|
||||
j:=Length(Trim(IntToStr(FFInt))); //最大号位数 1
|
||||
FFFSj:=Trim(IntToStr(FFInt));//后缀数字字符串
|
||||
while j<i do
|
||||
begin
|
||||
FFFSj:='0'+Trim(FFFsj);
|
||||
j:=j+1
|
||||
end;
|
||||
end;
|
||||
//取后缀
|
||||
fsj:=Trim(FFQZSj)+Trim(FFFSj);
|
||||
if CopyInt=0 then
|
||||
CDS_Sub.Append
|
||||
else
|
||||
if CopyInt=1 then
|
||||
CDS_Sub.Edit;
|
||||
CDS_Sub.FieldByName('CYNo').Value:=Trim(fsj);
|
||||
CDS_Sub.Post;
|
||||
end;
|
||||
end else }
|
||||
begin
|
||||
if CDS_Sub.IsEmpty then
|
||||
begin
|
||||
CDS_Sub.Append;
|
||||
CDS_Sub.Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品编辑YT',Tv1,'样品管理');
|
||||
Close;
|
||||
end;
|
||||
function TfrmCPAdd.SaveData():Boolean;
|
||||
var
|
||||
maxId:String;
|
||||
begin
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if Trim(FCYID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'','CP_YDang',4,1)=False then
|
||||
begin
|
||||
Result:=False;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('区最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxId:=Trim(FCYID);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_YDang where CYID='''+Trim(FCYID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FCYID)='' then
|
||||
begin
|
||||
Append;
|
||||
end else
|
||||
begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('CYID').Value:=Trim(maxId);
|
||||
FieldByName('CYType').Value:=Trim(FCPID);
|
||||
SSetSaveDataCDSNew(ADOQueryCmd,Tv1,CDS_Sub,'CP_YDang',3);
|
||||
if Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString)='' then
|
||||
FieldByName('CYPriceKg').Value:=0
|
||||
else
|
||||
FieldByName('CYPriceKg').Value:=CDS_Sub.fieldbyname('CYPriceKg').AsString;
|
||||
if Trim(CDS_Sub.fieldbyname('CYPriceM').AsString)='' then
|
||||
FieldByName('CYPriceM').Value:=0
|
||||
else
|
||||
FieldByName('CYPriceM').Value:=CDS_Sub.fieldbyname('CYPriceM').AsString;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select count(*) as AA from CP_YDang where CYNo='''+Trim(CDS_Sub.fieldbyname('CYNo').AsString)+'''');
|
||||
Open;
|
||||
if FieldByName('AA').AsInteger>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('编号重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('CYID').Value:=Trim(maxId);
|
||||
FieldByName('CYType').Value:=Trim(FCPID);
|
||||
Post;
|
||||
end;
|
||||
Result:=True;
|
||||
except
|
||||
Result:=True;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Sub.Locate('CYNo',null,[])=True then
|
||||
begin
|
||||
Application.MessageBox('产品编号不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
{if CDS_Sub.Locate('CYName',null,[])=True then
|
||||
begin
|
||||
Application.MessageBox('中文名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
ToolBar1.SetFocus;
|
||||
if SaveData() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column7PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue,FieldName,PriceKg,MF,KZ:string;
|
||||
FReal:Double;
|
||||
begin
|
||||
{mvalue:=Trim(TcxTextEdit(Sender).EditingText);
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
if TryStrToFloat(mvalue,FReal)=False then
|
||||
FieldByName('CYMF').Value:=mvalue
|
||||
else
|
||||
begin
|
||||
if Trim(canshu1)='英寸' then
|
||||
FieldByName('CYMF').Value:=mvalue+'"'
|
||||
else
|
||||
FieldByName('CYMF').Value:=mvalue+'CM';
|
||||
end;
|
||||
Post;
|
||||
end;
|
||||
FieldName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
PriceKg:=Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString);
|
||||
if Trim(PriceKg)='' then
|
||||
begin
|
||||
PriceKg:='0';
|
||||
end;
|
||||
MF:=Trim(CDS_Sub.fieldbyname('CYMF').AsString);
|
||||
KZ:=Trim(CDS_Sub.fieldbyname('CYKZ').AsString);
|
||||
if Trim(canshu1)<>'英寸' then
|
||||
MF:=Copy(MF,1,Pos('C',MF)-1)
|
||||
else
|
||||
MF:=Copy(MF,1,Pos('"',MF)-1);
|
||||
KZ:=Copy(KZ,1,Pos('g',KZ)-1);
|
||||
if TryStrToFloat(MF,FReal)=False then
|
||||
begin
|
||||
MF:='0';
|
||||
end;
|
||||
if TryStrToFloat(KZ,FReal)=False then
|
||||
begin
|
||||
KZ:='0';
|
||||
end;
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
if Trim(canshu1)<>'英寸' then
|
||||
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*StrToFloat(KZ)*1.00/100000
|
||||
else
|
||||
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*2.54*StrToFloat(KZ)*1.00/100000;
|
||||
Post;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column8PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue,FieldName,PriceKg,MF,KZ:string;
|
||||
FReal:Double;
|
||||
begin
|
||||
{mvalue:=Trim(TcxTextEdit(Sender).EditingText);
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
if TryStrToFloat(mvalue,FReal)=False then
|
||||
FieldByName('CYKZ').Value:=mvalue
|
||||
else
|
||||
FieldByName('CYKZ').Value:=mvalue+'g/㎡';
|
||||
Post;
|
||||
end;
|
||||
FieldName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
PriceKg:=Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString);
|
||||
if Trim(PriceKg)='' then
|
||||
begin
|
||||
PriceKg:='0';
|
||||
end;
|
||||
MF:=Trim(CDS_Sub.fieldbyname('CYMF').AsString);
|
||||
KZ:=Trim(CDS_Sub.fieldbyname('CYKZ').AsString);
|
||||
if Trim(canshu1)<>'英寸' then
|
||||
MF:=Copy(MF,1,Pos('C',MF)-1)
|
||||
else
|
||||
MF:=Copy(MF,1,Pos('"',MF)-1);
|
||||
KZ:=Copy(KZ,1,Pos('g',KZ)-1);
|
||||
if TryStrToFloat(MF,FReal)=False then
|
||||
begin
|
||||
MF:='0';
|
||||
end;
|
||||
if TryStrToFloat(KZ,FReal)=False then
|
||||
begin
|
||||
KZ:='0';
|
||||
end;
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
if Trim(canshu1)<>'英寸' then
|
||||
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*StrToFloat(KZ)*1.00/100000
|
||||
else
|
||||
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*2.54*StrToFloat(KZ)*1.00/100000;
|
||||
Post;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column2PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YPName';
|
||||
flagname:='样品名称';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('CYName').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column26PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
var
|
||||
fsj:string;
|
||||
begin
|
||||
fsj:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='GYStr';
|
||||
flagname:='工艺名称';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(fsj).Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column27PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
var
|
||||
fsj:string;
|
||||
begin
|
||||
fsj:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YPJGFactory';
|
||||
flagname:='加工厂';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(fsj).Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column20PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
FieldName,mvalue,MF,KZ,PriceKg:string;
|
||||
FReal:Double;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
FieldName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FieldName).Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
PriceKg:=Trim(CDS_Sub.fieldbyname('CYPriceKg').AsString);
|
||||
if Trim(PriceKg)='' then
|
||||
begin
|
||||
PriceKg:='0';
|
||||
end;
|
||||
MF:=Trim(CDS_Sub.fieldbyname('CYMF').AsString);
|
||||
KZ:=Trim(CDS_Sub.fieldbyname('CYKZ').AsString);
|
||||
if Trim(canshu1)<>'英寸' then
|
||||
MF:=Copy(MF,1,Pos('C',MF)-1)
|
||||
else
|
||||
MF:=Copy(MF,1,Pos('"',MF)-1);
|
||||
KZ:=Copy(KZ,1,Pos('g',KZ)-1);
|
||||
if TryStrToFloat(MF,FReal)=False then
|
||||
begin
|
||||
MF:='0';
|
||||
end;
|
||||
if TryStrToFloat(KZ,FReal)=False then
|
||||
begin
|
||||
KZ:='0';
|
||||
end;
|
||||
with CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
if Trim(canshu1)<>'英寸' then
|
||||
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*StrToFloat(KZ)*1.00/100000
|
||||
else
|
||||
FieldByName('CYPriceM').Value:=StrToFloat(PriceKg)*StrToFloat(MF)*2.54*StrToFloat(KZ)*1.00/100000;
|
||||
Post;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.CheckBox1Click(Sender: TObject);
|
||||
begin
|
||||
if CheckBox1.Checked=True then
|
||||
begin
|
||||
canshu1:='英寸';
|
||||
end else
|
||||
begin
|
||||
canshu1:='';
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPAdd.v1Column13PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YPWeiZhi';
|
||||
flagname:='陈列位置';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.CDS_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('DefStr2').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
765
云翔OA(WTOA.dll)/U_CPManage.dfm
Normal file
765
云翔OA(WTOA.dll)/U_CPManage.dfm
Normal file
|
|
@ -0,0 +1,765 @@
|
|||
object frmCPManage: TfrmCPManage
|
||||
Left = 75
|
||||
Top = 90
|
||||
Width = 1148
|
||||
Height = 618
|
||||
Caption = #20135#21697#26723#26696
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnKeyDown = FormKeyDown
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1132
|
||||
Height = 31
|
||||
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 ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object ToolButton7: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22797#21046
|
||||
ImageIndex = 38
|
||||
OnClick = ToolButton7Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 97
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 441
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26631#31614#25171#21360
|
||||
ImageIndex = 4
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 528
|
||||
Top = 0
|
||||
Width = 72
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label6: TLabel
|
||||
Left = 3
|
||||
Top = 9
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20221#25968
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 29
|
||||
Top = 6
|
||||
Width = 38
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 600
|
||||
Top = 0
|
||||
Width = 173
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 0
|
||||
object Label13: TLabel
|
||||
Left = 3
|
||||
Top = 9
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #26631#31614#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object LabName: TBtnEditA
|
||||
Left = 61
|
||||
Top = 5
|
||||
Width = 104
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnBtnClick = LabNameBtnClick
|
||||
end
|
||||
end
|
||||
object ToolButton8: TToolButton
|
||||
Left = 773
|
||||
Top = 0
|
||||
Caption = #26631#31614#39044#35272
|
||||
ImageIndex = 66
|
||||
OnClick = ToolButton8Click
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 856
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22270#29255#19978#20256
|
||||
ImageIndex = 18
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 943
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22270#29255#19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = ToolButton6Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 1030
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 228
|
||||
Top = 89
|
||||
Width = 904
|
||||
Height = 490
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnKeyDown = Tv1KeyDown
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnCellClick = Tv1CellClick
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Inactive = DataLink_DDMD.SHuangSe
|
||||
Styles.IncSearch = DataLink_DDMD.SHuangSe
|
||||
Styles.Selection = DataLink_DDMD.SHuangSe
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
Properties.OnChange = v1Column19PropertiesChange
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 40
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #31867#21035
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 71
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #32769#32534#21495
|
||||
DataBinding.FieldName = 'OldCYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 88
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 69
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #20013#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column42: TcxGridDBColumn
|
||||
Caption = #33521#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColorEng'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #38754#26009#26469#28304
|
||||
DataBinding.FieldName = 'CYFrom'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 108
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #22270#29255#19978#20256
|
||||
DataBinding.FieldName = 'TPFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 59
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPriceKg'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 56
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #31859#20215
|
||||
DataBinding.FieldName = 'CYPriceM'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 54
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 220
|
||||
Top = 89
|
||||
Width = 8
|
||||
Height = 490
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
Control = Panel5
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1132
|
||||
Height = 58
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 3
|
||||
object Label2: TLabel
|
||||
Left = 16
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #25195#25551#20837#21475
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 364
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#21517#31216
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 482
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#21517#31216
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 216
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #35268' '#26684
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 216
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 606
|
||||
Top = 39
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20811#37325
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 364
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#25104#20998
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 482
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#25104#20998
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 606
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #38376#24133
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 832
|
||||
Top = 15
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 833
|
||||
Top = 39
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label14: TLabel
|
||||
Left = 720
|
||||
Top = 15
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = #32769#32534#21495
|
||||
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 = 1
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYEName: TEdit
|
||||
Tag = 2
|
||||
Left = 531
|
||||
Top = 11
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYSpec: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = CYNoChange
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object CYKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 632
|
||||
Top = 35
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
object CYCF: TEdit
|
||||
Tag = 2
|
||||
Left = 414
|
||||
Top = 35
|
||||
Width = 56
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYECF: TEdit
|
||||
Tag = 2
|
||||
Left = 531
|
||||
Top = 35
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 7
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYMF: TEdit
|
||||
Tag = 2
|
||||
Left = 632
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 8
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
object OldCYNo: TEdit
|
||||
Tag = 2
|
||||
Left = 755
|
||||
Top = 11
|
||||
Width = 73
|
||||
Height = 20
|
||||
TabOrder = 9
|
||||
OnChange = CYNoChange
|
||||
OnKeyPress = OldCYNoKeyPress
|
||||
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 = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 0
|
||||
Top = 89
|
||||
Width = 220
|
||||
Height = 490
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 5
|
||||
object Image2: TImage
|
||||
Left = 2
|
||||
Top = 301
|
||||
Width = 216
|
||||
Height = 187
|
||||
Align = alBottom
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 216
|
||||
Height = 299
|
||||
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_DDMD.Red
|
||||
Styles.Selection = DataLink_DDMD.Red
|
||||
Styles.IncSearch = DataLink_DDMD.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 DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree20: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 61
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 989
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 957
|
||||
Top = 17
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 432
|
||||
Top = 184
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 451
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.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
|
||||
end
|
||||
887
云翔OA(WTOA.dll)/U_CPManage.pas
Normal file
887
云翔OA(WTOA.dll)/U_CPManage.pas
Normal file
|
|
@ -0,0 +1,887 @@
|
|||
unit U_CPManage; //2
|
||||
|
||||
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, BtnEdit;
|
||||
|
||||
type
|
||||
TfrmCPManage = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree20: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
CYID: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
Label1: TLabel;
|
||||
CYName: TEdit;
|
||||
Label4: TLabel;
|
||||
CYEName: TEdit;
|
||||
Label5: TLabel;
|
||||
CYSpec: TEdit;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ToolButton5: TToolButton;
|
||||
ToolButton6: TToolButton;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
CYNO: TEdit;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
ToolButton7: TToolButton;
|
||||
Panel2: TPanel;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
DSCYNO: TDataSource;
|
||||
CDS_CYNO: TClientDataSet;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
Label8: TLabel;
|
||||
Label9: TLabel;
|
||||
CYCF: TEdit;
|
||||
CYECF: TEdit;
|
||||
Label10: TLabel;
|
||||
CYMF: TEdit;
|
||||
v1Column42: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
ADOQueryTree: TClientDataSet;
|
||||
Panel5: TPanel;
|
||||
Image2: TImage;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
Panel4: TPanel;
|
||||
Label13: TLabel;
|
||||
LabName: TBtnEditA;
|
||||
ToolButton8: TToolButton;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
Label14: TLabel;
|
||||
OldCYNo: TEdit;
|
||||
Panel3: TPanel;
|
||||
Label6: TLabel;
|
||||
Edit1: TEdit;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure CYNoChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure ToolButton6Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure Tv1KeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure ToolButton7Click(Sender: TObject);
|
||||
procedure CYSpecChange(Sender: TObject);
|
||||
procedure v1Column19PropertiesChange(Sender: TObject);
|
||||
procedure CYMFChange(Sender: TObject);
|
||||
procedure CYNameChange(Sender: TObject);
|
||||
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure LabNameBtnClick(Sender: TObject);
|
||||
procedure ToolButton8Click(Sender: TObject);
|
||||
procedure OldCYNoKeyPress(Sender: TObject; var Key: Char);
|
||||
private
|
||||
{ Private declarations }
|
||||
CPID:string;
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
procedure InitGrid();
|
||||
procedure ReadINIFile();
|
||||
procedure InitImage();
|
||||
procedure TJGS();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPManage: TfrmCPManage;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_CPAdd,U_FileUp,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPManage.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 TfrmCPManage.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 TfrmCPManage.TJGS();
|
||||
var
|
||||
i,j:Integer;
|
||||
begin
|
||||
i:=0;
|
||||
j:=0;
|
||||
CDS_Main.DisableControls;
|
||||
with CDS_Main do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
if FieldByName('CYPriceKg').Value=0 then
|
||||
begin
|
||||
i:=i+1;
|
||||
end else
|
||||
begin
|
||||
j:=j+1;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
Label11.Caption:='定价样品数量:'+Trim(IntToStr(j));
|
||||
Label12.Caption:='未定价样品数量:'+Trim(IntToStr(i));
|
||||
end;
|
||||
procedure TfrmCPManage.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPManage:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品列表YT',Tv1,'样品管理');
|
||||
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCPManage.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
ReadCxGrid('样品列表YT',Tv1,'样品管理');
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYID='''' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_CYNO);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_CYNO);
|
||||
CDS_CYNO.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
TJGS();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
FieldName:String;
|
||||
begin
|
||||
try
|
||||
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||
with frmCPAdd do
|
||||
begin
|
||||
CopyInt:=0;
|
||||
FCYID:='';
|
||||
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
if CDS_Main.Active=False then Exit;
|
||||
Self.CDS_Main.Append;
|
||||
for i:=0 to frmCPAdd.Tv1.ColumnCount-1 do
|
||||
begin
|
||||
FieldName:=frmCPAdd.Tv1.Columns[i].DataBinding.FilterFieldName;
|
||||
if Trim(FieldName)<>'' then
|
||||
begin
|
||||
Self.CDS_Main.FieldByName(FieldName).Value:=frmCPAdd.CDS_Sub.FieldByName(FieldName).Value;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.FieldByName('CPName').Value:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||
CDS_Main.FieldByName('CYID').Value:=CDS_Sub.fieldbyname('CYID').Value;
|
||||
CDS_Main.FieldByName('CYType').Value:=CDS_Sub.fieldbyname('CYType').Value;
|
||||
Self.CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCPAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
InitGrid();
|
||||
TJGS();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.ToolButton3Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
FieldName:String;
|
||||
begin
|
||||
try
|
||||
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||
with frmCPAdd do
|
||||
begin
|
||||
CopyInt:=0;
|
||||
FCYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.CDS_Main.Edit;
|
||||
for i:=0 to frmCPAdd.Tv1.ColumnCount-1 do
|
||||
begin
|
||||
FieldName:=frmCPAdd.Tv1.Columns[i].DataBinding.FilterFieldName;
|
||||
if Trim(FieldName)<>'' then
|
||||
begin
|
||||
Self.CDS_Main.FieldByName(FieldName).Value:=frmCPAdd.CDS_Sub.FieldByName(FieldName).Value;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.FieldByName('CPName').Value:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||
CDS_Main.FieldByName('CYID').Value:=CDS_Sub.fieldbyname('CYID').Value;
|
||||
CDS_Main.FieldByName('CYType').Value:=CDS_Sub.fieldbyname('CYType').Value;
|
||||
Self.CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCPAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.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 TfrmCPManage.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 TfrmCPManage.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 TfrmCPManage.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('样品档案',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile,FFCYID:string;
|
||||
DPS,i,j:Integer;
|
||||
Txt,fImagePath:string;
|
||||
Moudle: THandle;
|
||||
Makebar:TMakebar;
|
||||
Mixtext:TMixtext;
|
||||
begin
|
||||
CYID.SetFocus;
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
//if CDS_CYNO.IsEmpty then Exit;
|
||||
if Trim(LabName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('标签名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(Edit1.Text)<>'' then
|
||||
begin
|
||||
if TryStrToInt(Edit1.Text,i)=False then
|
||||
begin
|
||||
Application.MessageBox('份数录入错误!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) +'Report\'+Trim(LabName.Text)+'.rmf';
|
||||
CDS_Main.DisableControls;
|
||||
DPS:=0;
|
||||
FFCYID:='';
|
||||
i:=1;
|
||||
if Trim(Edit1.Text)='' then
|
||||
begin
|
||||
j:=1;
|
||||
end else
|
||||
begin
|
||||
j:=StrToInt(Edit1.Text);
|
||||
end;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
for i:=1 to j do
|
||||
begin
|
||||
try
|
||||
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp';
|
||||
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
||||
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
||||
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
||||
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
||||
except
|
||||
application.MessageBox('条形码生成失败!','提示信息',MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RMVariables['QRBARCODE']:=fImagePath;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\'+Trim(LabName.Text)+'.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if DPS=0 then
|
||||
begin
|
||||
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
end;
|
||||
end;
|
||||
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||
Edit1.Text:='1';
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.ToolButton5Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmFileUp:=TfrmFileUp.Create(Application);
|
||||
with frmFileUp do
|
||||
begin
|
||||
Code.Text:=Trim(Self.CDS_Main.fieldbyname('CYNO').AsString);
|
||||
CYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
Self.CDS_Main.Locate('CYID',CYID,[]);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmFileUp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.ToolButton6Click(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
{FPath:='C:\HTTP1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XD_File where CYNO='''+Trim(CDS_Main.fieldbyname('CYNO').AsString)+'''');
|
||||
Open;
|
||||
if IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('样品图片未上传!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
try
|
||||
ReadINIFile();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName) then
|
||||
begin
|
||||
FInt:=1;
|
||||
end;
|
||||
if FInt<>1 then
|
||||
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||
);
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
procedure TfrmCPManage.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 TfrmCPManage.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ToolButton6.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.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 TfrmCPManage.InitImage();
|
||||
var
|
||||
jpg:TJpegImage;
|
||||
myStream:TADOBlobStream;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)='' then Exit;
|
||||
// if cxPageControl1.ActivePageIndex=6 then
|
||||
begin
|
||||
Image2.Picture.Assign(nil);
|
||||
try
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File A where A.WBID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
sql.Add(' and TFType=''样品'' ');
|
||||
open;
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
if trim(ADOQueryTemp.fieldbyname('FilesOther').AsString)<>'' then
|
||||
begin
|
||||
myStream:=tadoblobstream.Create(tblobfield(ADOQueryTemp.fieldbyname('FilesOther')),bmread);
|
||||
if myStream=nil then exit;
|
||||
jpg:=TJPEGImage.Create;
|
||||
jpg.LoadFromStream(myStream);
|
||||
Image2.Picture.Assign(jpg);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
jpg.Free;
|
||||
myStream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.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 TfrmCPManage.Tv1KeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key=46 then
|
||||
begin
|
||||
TBDel.Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.ToolButton7Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
FieldName:String;
|
||||
begin
|
||||
|
||||
try
|
||||
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||
with frmCPAdd do
|
||||
begin
|
||||
CopyInt:=1;
|
||||
FCYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.CDS_Main.Append;
|
||||
for i:=0 to frmCPAdd.Tv1.ColumnCount-1 do
|
||||
begin
|
||||
FieldName:=frmCPAdd.Tv1.Columns[i].DataBinding.FilterFieldName;
|
||||
if Trim(FieldName)<>'' then
|
||||
begin
|
||||
Self.CDS_Main.FieldByName(FieldName).Value:=frmCPAdd.CDS_Sub.FieldByName(FieldName).Value;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.FieldByName('CPName').Value:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||
CDS_Main.FieldByName('CYID').Value:=CDS_Sub.fieldbyname('CYID').Value;
|
||||
CDS_Main.FieldByName('CYType').Value:=CDS_Sub.fieldbyname('CYType').Value;
|
||||
Self.CDS_Main.Post;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCPAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.CYSpecChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.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 TfrmCPManage.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 TfrmCPManage.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 TfrmCPManage.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 TfrmCPManage.LabNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YPLabName';
|
||||
flagname:='样品标签';
|
||||
fnote:=True;
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.LabName.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.ToolButton8Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:string;
|
||||
Txt,fImagePath:string;
|
||||
Moudle: THandle;
|
||||
Makebar:TMakebar;
|
||||
Mixtext:TMixtext;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(LabName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('标签名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+Trim(LabName.Text)+'.rmf' ;
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
try
|
||||
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp';
|
||||
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
||||
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
||||
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
||||
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
||||
except
|
||||
application.MessageBox('条形码生成失败!','提示信息',MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
RMVariables['QRBARCODE']:=fImagePath;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\'+Trim(LabName.Text)+'.rmf'),'提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManage.OldCYNoKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
if Trim(OldCYNo.Text)='' then Exit;
|
||||
if Length(Trim(OldCYNo.Text))<4 then Exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_Select_CP_YDang :Code,8,'''' ');
|
||||
Parameters.ParamByName('Code').Value:='%'+Trim(OldCYNo.Text)+'%';
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
CYID.Text:='';
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
TJGS();
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
610
云翔OA(WTOA.dll)/U_CPManageCX.dfm
Normal file
610
云翔OA(WTOA.dll)/U_CPManageCX.dfm
Normal file
|
|
@ -0,0 +1,610 @@
|
|||
object frmCPManageCX: TfrmCPManageCX
|
||||
Left = 85
|
||||
Top = 108
|
||||
Width = 1148
|
||||
Height = 618
|
||||
Caption = #20135#21697#26723#26696
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnKeyDown = FormKeyDown
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1132
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_YPGL.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_YPGL.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 9
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 59
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object ToolButton7: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22797#21046
|
||||
ImageIndex = 57
|
||||
Visible = False
|
||||
OnClick = ToolButton7Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 54
|
||||
Visible = False
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 17
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 53
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 441
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26631#31614#25171#21360
|
||||
ImageIndex = 12
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object ToolButton8: TToolButton
|
||||
Left = 528
|
||||
Top = 0
|
||||
Caption = #26679#21697#20837#24211
|
||||
ImageIndex = 103
|
||||
Visible = False
|
||||
OnClick = ToolButton8Click
|
||||
end
|
||||
object ToolButton9: TToolButton
|
||||
Left = 611
|
||||
Top = 0
|
||||
Caption = #26679#21697#20986#24211
|
||||
ImageIndex = 107
|
||||
Visible = False
|
||||
OnClick = ToolButton9Click
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 694
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22270#29255#19978#20256
|
||||
ImageIndex = 109
|
||||
Visible = False
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 781
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22270#29255#19979#36733
|
||||
ImageIndex = 104
|
||||
OnClick = ToolButton6Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 868
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 55
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 0
|
||||
Top = 72
|
||||
Width = 121
|
||||
Height = 507
|
||||
Align = alLeft
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'CPParent'
|
||||
DataController.KeyField = 'CPID'
|
||||
OptionsBehavior.ExpandOnDblClick = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
Styles.Inactive = DataLink_YPGL.Red
|
||||
Styles.Selection = DataLink_YPGL.Red
|
||||
Styles.IncSearch = DataLink_YPGL.Red
|
||||
TabOrder = 1
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'CPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 129
|
||||
Top = 72
|
||||
Width = 1003
|
||||
Height = 507
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnKeyDown = Tv1KeyDown
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnCellClick = Tv1CellClick
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource2
|
||||
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'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 55
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #31867#21035
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 71
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 69
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Caption = #32463#32428#23494#24230
|
||||
DataBinding.FieldName = 'DefStr6'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #22383#24067#20215
|
||||
DataBinding.FieldName = 'CYPrice1'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #25104#21697#20215
|
||||
DataBinding.FieldName = 'CYPrice'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 62
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPrice2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 49
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #24065#31181
|
||||
DataBinding.FieldName = 'CYPBZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 56
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #22270#29255#19978#20256
|
||||
DataBinding.FieldName = 'TPFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_YPGL.Default
|
||||
Width = 59
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 121
|
||||
Top = 72
|
||||
Width = 8
|
||||
Height = 507
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
Control = cxDBTreeList1
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1132
|
||||
Height = 41
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
object Label2: TLabel
|
||||
Left = 16
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #25195#25551#20837#21475
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 361
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#21517#31216
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 479
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#21517#31216
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 603
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #35268#26684
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 216
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 882
|
||||
Top = 16
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20221#25968
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 723
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20811#37325
|
||||
end
|
||||
object CYID: TEdit
|
||||
Tag = 3
|
||||
Left = 72
|
||||
Top = 11
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnKeyPress = CYIDKeyPress
|
||||
end
|
||||
object CYName: TEdit
|
||||
Tag = 2
|
||||
Left = 411
|
||||
Top = 11
|
||||
Width = 56
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object CYEName: TEdit
|
||||
Tag = 2
|
||||
Left = 528
|
||||
Top = 11
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object CYSpec: TEdit
|
||||
Tag = 2
|
||||
Left = 629
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CYSpecChange
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 262
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 840
|
||||
Top = 11
|
||||
Width = 38
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
end
|
||||
object CYKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 749
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = CYSpecChange
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 512
|
||||
Top = 232
|
||||
Width = 193
|
||||
Height = 41
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree: TADOQuery
|
||||
Connection = DataLink_YPGL.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 117
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_YPGL.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 909
|
||||
Top = 17
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_YPGL.ADOLink
|
||||
Parameters = <>
|
||||
Left = 877
|
||||
Top = 17
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 456
|
||||
Top = 184
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 451
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_YPGL.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 429
|
||||
Top = 185
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 392
|
||||
Top = 184
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
Dataset = RMDB_Main
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 392
|
||||
Top = 152
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = CDS_Main
|
||||
Left = 424
|
||||
Top = 152
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 484
|
||||
Top = 157
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 485
|
||||
Top = 188
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 521
|
||||
Top = 157
|
||||
end
|
||||
end
|
||||
630
云翔OA(WTOA.dll)/U_CPManageCX.pas
Normal file
630
云翔OA(WTOA.dll)/U_CPManageCX.pas
Normal file
|
|
@ -0,0 +1,630 @@
|
|||
unit U_CPManageCX;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||||
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||||
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||||
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||||
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||||
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox;
|
||||
|
||||
type
|
||||
TfrmCPManageCX = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
CYID: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ToolButton5: TToolButton;
|
||||
ToolButton6: TToolButton;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
ToolButton7: TToolButton;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
ToolButton8: TToolButton;
|
||||
ToolButton9: TToolButton;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
Panel2: TPanel;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label3: TLabel;
|
||||
Label6: TLabel;
|
||||
CYName: TEdit;
|
||||
CYEName: TEdit;
|
||||
CYSpec: TEdit;
|
||||
CYNO: TEdit;
|
||||
Edit1: TEdit;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure CYNoChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure ToolButton6Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure Tv1KeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure ToolButton7Click(Sender: TObject);
|
||||
procedure ToolButton8Click(Sender: TObject);
|
||||
procedure ToolButton9Click(Sender: TObject);
|
||||
procedure CYSpecChange(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
CPID:string;
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
procedure InitGrid();
|
||||
procedure ReadINIFile();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPManageCX: TfrmCPManageCX;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun,U_CPAdd,U_FileUp,U_YPCR;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPManageCX.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
with ADOQueryTree do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||
Open;
|
||||
end;
|
||||
cxDBTreeList1.Items[0].Expand(false);
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.InitGrid();
|
||||
begin
|
||||
Panel2.Visible:=True;
|
||||
Panel2.Refresh;
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
||||
Parameters.ParamByName('Code').Value:='';
|
||||
Parameters.ParamByName('PState').Value:=0;
|
||||
Parameters.ParamByName('CYType').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPManageCX:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品列表查询',Tv1,'样品管理');
|
||||
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCPManageCX.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
CDS_Main.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
ReadCxGrid('样品列表查询',Tv1,'样品管理');
|
||||
if SGetServerDate(ADOQueryTemp)>StrToDate('2015-10-26') then //2013-10-26(杭州,云翔)
|
||||
begin
|
||||
ToolBar1.Visible:=False;
|
||||
Panel1.Visible:=False;
|
||||
cxDBTreeList1.Visible:=False;
|
||||
cxGrid1.Visible:=False;
|
||||
Application.MessageBox('软件升级,联系供应商!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if DParameters1='1' then
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
ToolButton3.Visible:=False;
|
||||
ToolButton5.Visible:=False;
|
||||
end;
|
||||
//InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||
with frmCPAdd do
|
||||
begin
|
||||
CopyInt:=0;
|
||||
FCYID:='';
|
||||
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCPAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||
with frmCPAdd do
|
||||
begin
|
||||
CopyInt:=0;
|
||||
FCYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
Self.CDS_Main.Locate('CYID',FCYID,[]);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCPAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CP_YDang where CYID='''+Trim(CYID.Text)+'''');
|
||||
Open;
|
||||
end;
|
||||
CPID:=Trim(ADOQueryTemp.fieldbyname('CYType').AsString);
|
||||
if Trim(CYID.Text)='' then Exit;
|
||||
SDofilter(ADOQueryMain,' CYID='''+Trim(CYID.Text)+''' ');
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
CYID.Text:='';
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.CYNoChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(CYNO.Text))<4 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('样品档案',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile,FFCYID:string;
|
||||
DPS,i,j:Integer;
|
||||
begin
|
||||
CYID.SetFocus;
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
//if CDS_CYNO.IsEmpty then Exit;
|
||||
if Trim(Edit1.Text)<>'' then
|
||||
begin
|
||||
if TryStrToInt(Edit1.Text,i)=False then
|
||||
begin
|
||||
Application.MessageBox('份数录入错误!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\样品标签.rmf';
|
||||
CDS_Main.DisableControls;
|
||||
DPS:=0;
|
||||
FFCYID:='';
|
||||
i:=1;
|
||||
if Trim(Edit1.Text)='' then
|
||||
begin
|
||||
j:=1;
|
||||
end else
|
||||
begin
|
||||
j:=StrToInt(Edit1.Text);
|
||||
end;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
for i:=1 to j do
|
||||
begin
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if DPS=0 then
|
||||
begin
|
||||
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
end;
|
||||
end;
|
||||
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||
Edit1.Text:='1';
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton5Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmFileUp:=TfrmFileUp.Create(Application);
|
||||
with frmFileUp do
|
||||
begin
|
||||
Code.Text:=Trim(Self.CDS_Main.fieldbyname('CYNO').AsString);
|
||||
CYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
Self.CDS_Main.Locate('CYID',CYID,[]);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmFileUp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton6Click(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
{FPath:='C:\HTTP1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XD_File where CYNO='''+Trim(CDS_Main.fieldbyname('CYNO').AsString)+'''');
|
||||
Open;
|
||||
if IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('样品图片未上传!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
try
|
||||
ReadINIFile();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName) then
|
||||
begin
|
||||
FInt:=1;
|
||||
end;
|
||||
if FInt<>1 then
|
||||
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||
);
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
procedure TfrmCPManageCX.ReadINIFile();
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FileName:string;
|
||||
begin
|
||||
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
||||
programIni:=Tinifile.create(FileName);
|
||||
server:=programIni.ReadString('SERVER','服务器地址','127.0.0.1');
|
||||
programIni.Free;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ToolButton6.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').asstring)+'''');
|
||||
Open;
|
||||
end;
|
||||
CPID:=Trim(ADOQueryTemp.fieldbyname('CYType').AsString);
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
{if Key= then
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定6666要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
CDS_Main.Delete;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.Tv1KeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Key=46 then
|
||||
begin
|
||||
TBDel.Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton7Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmCPAdd:=TfrmCPAdd.Create(Application);
|
||||
with frmCPAdd do
|
||||
begin
|
||||
CopyInt:=1;
|
||||
FCYID:=Trim(Self.CDS_Main.fieldbyname('CYID').AsString);
|
||||
FCPID:=Trim(Self.ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPNo:=Trim(Self.ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.InitGrid();
|
||||
Self.CDS_Main.Locate('CYID',FCYID,[]);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmCPAdd.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton8Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmYPCR:=TfrmYPCR.Create(Application);
|
||||
with frmYPCR do
|
||||
begin
|
||||
FCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
RKFlag:='入库';
|
||||
frmYPCR.InitGrid();
|
||||
with CDS_HZ do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('CYID').Value:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
FieldByName('CYName').Value:=Trim(CDS_Main.fieldbyname('CYName').AsString);
|
||||
FieldByName('CYSpec').Value:=Trim(CDS_Main.fieldbyname('CYSpec').AsString);
|
||||
FieldByName('KCUnit').Value:=Trim(CDS_Main.fieldbyname('KCUnit').AsString);
|
||||
Post;
|
||||
end;
|
||||
frmYPCR.SaveData();
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmYPCR.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.ToolButton9Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmYPCR:=TfrmYPCR.Create(Application);
|
||||
with frmYPCR do
|
||||
begin
|
||||
FCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
RKFlag:='出库';
|
||||
frmYPCR.InitGrid();
|
||||
frmYPCR.cxGridDBColumn1.Caption:='出库日期';
|
||||
frmYPCR.cxGridDBColumn5.Caption:='出库数量';
|
||||
with CDS_HZ do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('CYID').Value:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
FieldByName('CYName').Value:=Trim(CDS_Main.fieldbyname('CYName').AsString);
|
||||
FieldByName('CYSpec').Value:=Trim(CDS_Main.fieldbyname('CYSpec').AsString);
|
||||
FieldByName('KCUnit').Value:=Trim(CDS_Main.fieldbyname('KCUnit').AsString);
|
||||
Post;
|
||||
end;
|
||||
frmYPCR.SaveData();
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmYPCR.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageCX.CYSpecChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
1109
云翔OA(WTOA.dll)/U_CPManageTPCX.dfm
Normal file
1109
云翔OA(WTOA.dll)/U_CPManageTPCX.dfm
Normal file
File diff suppressed because it is too large
Load Diff
787
云翔OA(WTOA.dll)/U_CPManageTPCX.pas
Normal file
787
云翔OA(WTOA.dll)/U_CPManageTPCX.pas
Normal file
|
|
@ -0,0 +1,787 @@
|
|||
unit U_CPManageTPCX;
|
||||
|
||||
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, BtnEdit, cxButtonEdit,
|
||||
cxDropDownEdit, cxTextEdit, cxCalendar, Menus,jpeg;
|
||||
|
||||
type
|
||||
TfrmCPManageTPCX = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree10: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
CYID: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
Label1: TLabel;
|
||||
CYName: TEdit;
|
||||
Label5: TLabel;
|
||||
CYSpec: TEdit;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ToolButton6: TToolButton;
|
||||
Label3: TLabel;
|
||||
CYNO: TEdit;
|
||||
Panel2: TPanel;
|
||||
DSCYNO: TDataSource;
|
||||
CDS_CYNO: TClientDataSet;
|
||||
Edit1: TEdit;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
Label8: TLabel;
|
||||
CYCF: TEdit;
|
||||
Label10: TLabel;
|
||||
CYMF: TEdit;
|
||||
Label4: TLabel;
|
||||
CYXLType: TEdit;
|
||||
Button1: TButton;
|
||||
Panel3: TPanel;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
v1Column26: TcxGridDBColumn;
|
||||
v1Column29: TcxGridDBColumn;
|
||||
v1Column32: TcxGridDBColumn;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxSplitter2: TcxSplitter;
|
||||
Panel4: TPanel;
|
||||
cxGrid3: TcxGrid;
|
||||
Tv3: TcxGridDBTableView;
|
||||
cxGridDBColumn9: TcxGridDBColumn;
|
||||
cxGridDBColumn10: TcxGridDBColumn;
|
||||
cxGridDBColumn14: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
CDS_CB: TClientDataSet;
|
||||
DSCB: TDataSource;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
CDS_GY: TClientDataSet;
|
||||
DSGY: TDataSource;
|
||||
cxGridPopupMenu3: TcxGridPopupMenu;
|
||||
ADOQuery1: TADOQuery;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v3Column1: TcxGridDBColumn;
|
||||
v3Column2: TcxGridDBColumn;
|
||||
ToolButton11: TToolButton;
|
||||
Label9: TLabel;
|
||||
GYStr: TComboBox;
|
||||
Label11: TLabel;
|
||||
HX: TEdit;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
Button2: TButton;
|
||||
Edit2: TEdit;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Column21: TcxGridDBColumn;
|
||||
ADOQueryTree: TClientDataSet;
|
||||
TBSel: TToolButton;
|
||||
Panel5: TPanel;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
Image2: TImage;
|
||||
cxGrid62: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
v6Column1: TcxGridDBColumn;
|
||||
cxGridDBColumn40: TcxGridDBColumn;
|
||||
cxGridDBColumn41: TcxGridDBColumn;
|
||||
cxGridDBColumn42: TcxGridDBColumn;
|
||||
cxGridDBColumn49: TcxGridDBColumn;
|
||||
cxGridDBColumn51: TcxGridDBColumn;
|
||||
cxGridLevel5: 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 ToolButton6Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure CYSpecChange(Sender: TObject);
|
||||
procedure v1Column19PropertiesChange(Sender: TObject);
|
||||
procedure CYMFChange(Sender: TObject);
|
||||
procedure CYNameChange(Sender: TObject);
|
||||
procedure CYCFChange(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ToolButton11Click(Sender: TObject);
|
||||
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure GYStrChange(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure TBSelClick(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
|
||||
frmCPManageTPCX: TfrmCPManageTPCX;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun, U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPManageTPCX.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
with ADOQueryTree10 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTree10,ADOQueryTree);
|
||||
SInitCDSData20(ADOQueryTree10,ADOQueryTree);
|
||||
cxDBTreeList1.Items[0].Expand(false);
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.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 TfrmCPManageTPCX.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPManageTPCX:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
// Action:=caHide;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品列表SF',Tv1,'样品管理');
|
||||
WriteCxGrid('样品列表SF1a',Tv2,'样品管理');
|
||||
WriteCxGrid('样品列表SF2',Tv3,'样品管理');
|
||||
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCPManageTPCX.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
ReadCxGrid('样品列表SF',Tv1,'样品管理');
|
||||
ReadCxGrid('样品列表SF1a',Tv2,'样品管理');
|
||||
ReadCxGrid('样品列表SF2',Tv3,'样品管理');
|
||||
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYID='''' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_CYNO);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_CYNO);
|
||||
CDS_CYNO.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.TBRafreshClick(Sender: TObject);
|
||||
var
|
||||
DWCYID:String;
|
||||
begin
|
||||
InitTree();
|
||||
if CDS_Main.IsEmpty=False then
|
||||
DWCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
InitGrid();
|
||||
CDS_Main.Locate('CYID',DWCYID,[]);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,CPName=(select CPName from CP_Type B where B.CPID=A.CYType) ');
|
||||
sql.Add(' from CP_YDang A where CYID='''+Trim(CYID.Text)+'''');
|
||||
Open;
|
||||
end;
|
||||
CPID:=Trim(ADOQueryMain.fieldbyname('CYType').AsString);
|
||||
if Trim(CYID.Text)='' then Exit;
|
||||
//SDofilter(ADOQueryMain,' CYID='''+Trim(CYID.Text)+''' ');
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
CYID.Text:='';
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_Cost where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQuery1,CDS_CB);
|
||||
SInitCDSData20(ADOQuery1,CDS_CB);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.CYNoChange(Sender: TObject);
|
||||
begin
|
||||
if Trim(Trim(TEdit(Sender).Text))<>'' then
|
||||
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);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile,FFCYID:string;
|
||||
DPS,i,j:Integer;
|
||||
begin
|
||||
CYID.SetFocus;
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
//if CDS_CYNO.IsEmpty then Exit;
|
||||
if Trim(Edit1.Text)<>'' then
|
||||
begin
|
||||
if TryStrToInt(Edit1.Text,i)=False then
|
||||
begin
|
||||
Application.MessageBox('份数录入错误!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\样品标签.rmf';
|
||||
CDS_Main.DisableControls;
|
||||
DPS:=0;
|
||||
FFCYID:='';
|
||||
i:=1;
|
||||
if Trim(Edit1.Text)='' then
|
||||
begin
|
||||
j:=1;
|
||||
end else
|
||||
begin
|
||||
j:=StrToInt(Edit1.Text);
|
||||
end;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
for i:=1 to j do
|
||||
begin
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.PrintReport;
|
||||
//RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if DPS=0 then
|
||||
begin
|
||||
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
end;
|
||||
end;
|
||||
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||
Edit1.Text:='1';
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.InitImage();
|
||||
var
|
||||
jpg:TJpegImage;
|
||||
myStream:TADOBlobStream;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)='' then Exit;
|
||||
// if cxPageControl1.ActivePageIndex=6 then
|
||||
begin
|
||||
Image2.Picture.Assign(nil);
|
||||
try
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File A where A.WBID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
sql.Add(' and TFType=''样品'' ');
|
||||
open;
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
if trim(ADOQueryTemp.fieldbyname('FilesOther').AsString)<>'' then
|
||||
begin
|
||||
myStream:=tadoblobstream.Create(tblobfield(ADOQueryTemp.fieldbyname('FilesOther')),bmread);
|
||||
if myStream=nil then exit;
|
||||
jpg:=TJPEGImage.Create;
|
||||
jpg.LoadFromStream(myStream);
|
||||
Image2.Picture.Assign(jpg);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
jpg.Free;
|
||||
myStream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.ToolButton6Click(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
{FPath:='C:\HTTP1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XD_File where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
Open;
|
||||
if IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('样品图片未上传!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
try
|
||||
ReadINIFile();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName) then
|
||||
begin
|
||||
FInt:=1;
|
||||
end;
|
||||
if FInt<>1 then
|
||||
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||
);
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
procedure TfrmCPManageTPCX.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 TfrmCPManageTPCX.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
//ToolButton6.Click;
|
||||
if CDS_Main.FieldByName('CostFlag').AsBoolean=False then
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.CYSpecChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.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 TfrmCPManageTPCX.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);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.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);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.CYCFChange(Sender: TObject);
|
||||
begin
|
||||
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.Button1Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
||||
with frmZDYHelpSel do
|
||||
begin
|
||||
flag:='CYXLType';
|
||||
flagname:='系列';
|
||||
FGStr:=' ';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
CYXLType.Text:=ReturnStr;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelpSel.Free;
|
||||
end;
|
||||
//if Length(Trim(CYXLType.Text))<2 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.Tv2FocusedRecordChanged(
|
||||
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||
AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_Cost_HGY where PSID='''+Trim(CDS_CB.fieldbyname('PSID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_GY);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_GY);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.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,[]);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_Cost where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQuery1,CDS_CB);
|
||||
SInitCDSData20(ADOQuery1,CDS_CB);
|
||||
InitImage();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.ToolButton11Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile,FFCYID:string;
|
||||
DPS,i,j:Integer;
|
||||
begin
|
||||
CYID.SetFocus;
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\样品标签.rmf';
|
||||
with CDS_Main do
|
||||
begin
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.PrintReport;
|
||||
RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
if Trim(CYNO.Text)='' then Exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,CPName=(select CPName from CP_Type B where B.CPID=A.CYType) ');
|
||||
sql.Add(' ,HX=isnull(CYHX,'''')+isnull(CYHX2,'''')+isnull(CYHX3,'''')');
|
||||
sql.Add(' from CP_YDang A where CYNO='''+Trim(CYNO.Text)+'''');
|
||||
Open;
|
||||
end;
|
||||
CPID:=Trim(ADOQueryMain.fieldbyname('CYType').AsString);
|
||||
|
||||
//SDofilter(ADOQueryMain,' CYID='''+Trim(CYID.Text)+''' ');
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_Cost where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQuery1,CDS_CB);
|
||||
SInitCDSData20(ADOQuery1,CDS_CB);
|
||||
CYNO.Text:='';
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.GYStrChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.Button2Click(Sender: TObject);
|
||||
var
|
||||
FColumn,FColumnName,Fsj:String;
|
||||
begin
|
||||
if CDS_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
FColumn:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
FColumnName:=Tv1.Controller.FocusedColumn.Caption;
|
||||
if Trim(Edit2.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('内容不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox(Pchar('确定要一键替换<'+FColumnName+'>吗?'),'提示',32+4)<>IDYES then Exit;
|
||||
CDS_Main.DisableControls;
|
||||
with CDS_Main do
|
||||
begin
|
||||
while Locate('SSel',True,[]) do
|
||||
begin
|
||||
if Trim(fsj)='' then
|
||||
begin
|
||||
fsj:='('''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''';
|
||||
end else
|
||||
begin
|
||||
Fsj:=fsj+','''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''';
|
||||
end;
|
||||
Edit;
|
||||
FieldByName('SSel').Value:=False;
|
||||
FieldByName(FColumn).Value:=Trim(Edit2.Text);
|
||||
Post;
|
||||
|
||||
end;
|
||||
if Trim(Fsj)<>'' then
|
||||
begin
|
||||
Fsj:=Fsj+')';
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update CP_YDang Set '+FColumn+'='''+Trim(Edit2.Text)+'''');
|
||||
sql.Add(',Editer='''+Trim(DName)+''',EditTime=getdate()');
|
||||
sql.Add(' where CYID in '+fsj);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_Main,False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageTPCX.TBSelClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
907
云翔OA(WTOA.dll)/U_CPManage_Sel.dfm
Normal file
907
云翔OA(WTOA.dll)/U_CPManage_Sel.dfm
Normal file
|
|
@ -0,0 +1,907 @@
|
|||
object frmCPManageSel: TfrmCPManageSel
|
||||
Left = 189
|
||||
Top = 80
|
||||
Width = 1392
|
||||
Height = 767
|
||||
Caption = #26679#21697#20449#24687#36873#25321#21015#34920
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
WindowState = wsMaximized
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnKeyDown = FormKeyDown
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1376
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 87
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_WTOA.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 65
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
Visible = False
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TOK: TToolButton
|
||||
Left = 130
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #30830#23450
|
||||
ImageIndex = 31
|
||||
OnClick = TOKClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 195
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 58
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 260
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26631#31614#25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 351
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
object ComboBox1: TComboBox
|
||||
Left = 416
|
||||
Top = 4
|
||||
Width = 112
|
||||
Height = 21
|
||||
Style = csDropDownList
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
TabOrder = 0
|
||||
Text = #26679#21697#26631#31614
|
||||
Visible = False
|
||||
Items.Strings = (
|
||||
#26679#21697#26631#31614
|
||||
#26679#21697#26631#31614'1')
|
||||
end
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 0
|
||||
Top = 75
|
||||
Width = 196
|
||||
Height = 652
|
||||
Align = alLeft
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'CPParent'
|
||||
DataController.KeyField = 'CPID'
|
||||
OptionsBehavior.ExpandOnDblClick = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
Styles.Inactive = DataLink_WTOA.Red
|
||||
Styles.Selection = DataLink_WTOA.Red
|
||||
Styles.IncSearch = DataLink_WTOA.Red
|
||||
TabOrder = 1
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'CPName'
|
||||
Width = 160
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 196
|
||||
Top = 75
|
||||
Width = 8
|
||||
Height = 652
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
Control = cxDBTreeList1
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1376
|
||||
Height = 44
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 3
|
||||
object Label1: TLabel
|
||||
Left = 373
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 13
|
||||
Caption = #20013#25991#21517#31216
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 320
|
||||
Top = 64
|
||||
Width = 52
|
||||
Height = 13
|
||||
Caption = #33521#25991#21517#31216
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 534
|
||||
Top = 17
|
||||
Width = 26
|
||||
Height = 13
|
||||
Caption = #35268#26684
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 215
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 13
|
||||
Caption = #20135#21697#32534#21495
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 1133
|
||||
Top = 52
|
||||
Width = 26
|
||||
Height = 13
|
||||
Caption = #20221#25968
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 671
|
||||
Top = 17
|
||||
Width = 26
|
||||
Height = 13
|
||||
Caption = #20811#37325
|
||||
end
|
||||
object Label13: TLabel
|
||||
Left = 908
|
||||
Top = 51
|
||||
Width = 39
|
||||
Height = 13
|
||||
Caption = #32769#32534#21495
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 809
|
||||
Top = 17
|
||||
Width = 65
|
||||
Height = 13
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 36
|
||||
Top = 15
|
||||
Width = 68
|
||||
Height = 16
|
||||
Caption = #25195#25551#26631#31614
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object CYName: TEdit
|
||||
Tag = 2
|
||||
Left = 427
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 21
|
||||
TabOrder = 0
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object CYEName: TEdit
|
||||
Tag = 2
|
||||
Left = 368
|
||||
Top = 60
|
||||
Width = 64
|
||||
Height = 21
|
||||
TabOrder = 1
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object CYSpec: TEdit
|
||||
Tag = 2
|
||||
Left = 562
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 269
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 1088
|
||||
Top = 47
|
||||
Width = 41
|
||||
Height = 21
|
||||
TabOrder = 4
|
||||
end
|
||||
object CYKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 699
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object defstr1: TEdit
|
||||
Tag = 2
|
||||
Left = 945
|
||||
Top = 73
|
||||
Width = 82
|
||||
Height = 21
|
||||
TabOrder = 6
|
||||
OnChange = CYSpecChange
|
||||
end
|
||||
object DefStr6: TEdit
|
||||
Tag = 2
|
||||
Left = 876
|
||||
Top = 13
|
||||
Width = 87
|
||||
Height = 21
|
||||
TabOrder = 7
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object CYID: TEdit
|
||||
Tag = 2
|
||||
Left = 106
|
||||
Top = 13
|
||||
Width = 92
|
||||
Height = 21
|
||||
TabOrder = 8
|
||||
OnKeyPress = CYIDKeyPress
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 555
|
||||
Top = 251
|
||||
Width = 209
|
||||
Height = 45
|
||||
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 = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 204
|
||||
Top = 75
|
||||
Width = 1172
|
||||
Height = 652
|
||||
Align = alClient
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 5
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1168
|
||||
Height = 346
|
||||
Align = alTop
|
||||
TabOrder = 0
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
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 v1Column12: TcxGridDBColumn
|
||||
Caption = #31867#21035
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 71
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 69
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column41: TcxGridDBColumn
|
||||
Caption = #24037#21378#21495
|
||||
DataBinding.FieldName = 'DefStr9'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Caption = #32463#32428#23494#24230
|
||||
DataBinding.FieldName = 'DefStr6'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #22383#24067#20215
|
||||
DataBinding.FieldName = 'CYPrice1'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #25104#21697#20215
|
||||
DataBinding.FieldName = 'CYPrice'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 62
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPrice2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 49
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #24065#31181
|
||||
DataBinding.FieldName = 'CYPBZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 56
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #22270#29255#19978#20256
|
||||
DataBinding.FieldName = 'TPFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 59
|
||||
end
|
||||
object v1Column25: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830
|
||||
DataBinding.FieldName = 'DefStr7'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column24: TcxGridDBColumn
|
||||
Caption = #25104#26412#20215
|
||||
DataBinding.FieldName = 'ZZCBPrice'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 57
|
||||
end
|
||||
object v1Column42: TcxGridDBColumn
|
||||
Caption = #38754#26009
|
||||
DataBinding.FieldName = 'MianLiao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column43: TcxGridDBColumn
|
||||
Caption = #37324#26009
|
||||
DataBinding.FieldName = 'LiLiao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 63
|
||||
end
|
||||
object v1Column44: TcxGridDBColumn
|
||||
Caption = #20013#38388#23618
|
||||
DataBinding.FieldName = 'ZJCeng'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 64
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 2
|
||||
Top = 379
|
||||
Width = 1168
|
||||
Height = 271
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object TV2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
DataController.DataSource = DataSource3
|
||||
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 cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #31867#21035
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 71
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 68
|
||||
end
|
||||
object cxGridDBColumn6: TcxGridDBColumn
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object cxGridDBColumn7: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object cxGridDBColumn8: TcxGridDBColumn
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object cxGridDBColumn9: TcxGridDBColumn
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 69
|
||||
end
|
||||
object cxGridDBColumn10: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 73
|
||||
end
|
||||
object cxGridDBColumn11: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object cxGridDBColumn12: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object cxGridDBColumn13: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object cxGridDBColumn14: TcxGridDBColumn
|
||||
Caption = #24037#21378#21495
|
||||
DataBinding.FieldName = 'DefStr9'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object cxGridDBColumn15: TcxGridDBColumn
|
||||
Caption = #32463#32428#23494#24230
|
||||
DataBinding.FieldName = 'DefStr6'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn16: TcxGridDBColumn
|
||||
Caption = #22383#24067#20215
|
||||
DataBinding.FieldName = 'CYPrice1'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object cxGridDBColumn17: TcxGridDBColumn
|
||||
Caption = #25104#21697#20215
|
||||
DataBinding.FieldName = 'CYPrice'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 62
|
||||
end
|
||||
object cxGridDBColumn18: TcxGridDBColumn
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPrice2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 49
|
||||
end
|
||||
object cxGridDBColumn19: TcxGridDBColumn
|
||||
Caption = #24065#31181
|
||||
DataBinding.FieldName = 'CYPBZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 56
|
||||
end
|
||||
object cxGridDBColumn20: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object cxGridDBColumn21: TcxGridDBColumn
|
||||
Caption = #22270#29255#19978#20256
|
||||
DataBinding.FieldName = 'TPFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 59
|
||||
end
|
||||
object cxGridDBColumn22: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830
|
||||
DataBinding.FieldName = 'DefStr7'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 66
|
||||
end
|
||||
object cxGridDBColumn23: TcxGridDBColumn
|
||||
Caption = #25104#26412#20215
|
||||
DataBinding.FieldName = 'ZZCBPrice'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 57
|
||||
end
|
||||
object cxGridDBColumn24: TcxGridDBColumn
|
||||
Caption = #38754#26009
|
||||
DataBinding.FieldName = 'MianLiao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 67
|
||||
end
|
||||
object cxGridDBColumn25: TcxGridDBColumn
|
||||
Caption = #37324#26009
|
||||
DataBinding.FieldName = 'LiLiao'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 63
|
||||
end
|
||||
object cxGridDBColumn26: TcxGridDBColumn
|
||||
Caption = #20013#38388#23618
|
||||
DataBinding.FieldName = 'ZJCeng'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 64
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 2
|
||||
Top = 348
|
||||
Width = 1168
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 61
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_WTOA.ThreeImgList
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton9: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = ToolButton9Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 117
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 945
|
||||
Top = 177
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 877
|
||||
Top = 149
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 456
|
||||
Top = 184
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 451
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 429
|
||||
Top = 185
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 392
|
||||
Top = 184
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
Dataset = RMDB_Main
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 392
|
||||
Top = 152
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = CDS_Main
|
||||
Left = 424
|
||||
Top = 152
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 484
|
||||
Top = 157
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 485
|
||||
Top = 188
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 521
|
||||
Top = 157
|
||||
end
|
||||
object adoqueryPicture: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 479
|
||||
Top = 256
|
||||
end
|
||||
object DataSource3: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 758
|
||||
Top = 507
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 715
|
||||
Top = 514
|
||||
end
|
||||
end
|
||||
475
云翔OA(WTOA.dll)/U_CPManage_Sel.pas
Normal file
475
云翔OA(WTOA.dll)/U_CPManage_Sel.pas
Normal file
|
|
@ -0,0 +1,475 @@
|
|||
unit U_CPManage_Sel;
|
||||
|
||||
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,
|
||||
cxCurrencyEdit;
|
||||
|
||||
type
|
||||
TfrmCPManageSel = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
ToolButton2: TToolButton;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
TOK: TToolButton;
|
||||
Panel2: TPanel;
|
||||
Label1: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label3: TLabel;
|
||||
Label6: TLabel;
|
||||
CYName: TEdit;
|
||||
CYEName: TEdit;
|
||||
CYSpec: TEdit;
|
||||
CYNO: TEdit;
|
||||
Edit1: TEdit;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
defstr1: TEdit;
|
||||
Label13: TLabel;
|
||||
ComboBox1: TComboBox;
|
||||
Panel3: TPanel;
|
||||
adoqueryPicture: TADOQuery;
|
||||
DefStr6: TEdit;
|
||||
Label8: TLabel;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
v1Column41: TcxGridDBColumn;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column25: TcxGridDBColumn;
|
||||
v1Column24: TcxGridDBColumn;
|
||||
v1Column42: TcxGridDBColumn;
|
||||
v1Column43: TcxGridDBColumn;
|
||||
v1Column44: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
Label9: TLabel;
|
||||
CYID: TEdit;
|
||||
cxGrid2: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
cxGridDBColumn6: TcxGridDBColumn;
|
||||
cxGridDBColumn7: TcxGridDBColumn;
|
||||
cxGridDBColumn8: TcxGridDBColumn;
|
||||
cxGridDBColumn9: TcxGridDBColumn;
|
||||
cxGridDBColumn10: TcxGridDBColumn;
|
||||
cxGridDBColumn11: TcxGridDBColumn;
|
||||
cxGridDBColumn12: TcxGridDBColumn;
|
||||
cxGridDBColumn13: TcxGridDBColumn;
|
||||
cxGridDBColumn14: TcxGridDBColumn;
|
||||
cxGridDBColumn15: TcxGridDBColumn;
|
||||
cxGridDBColumn16: TcxGridDBColumn;
|
||||
cxGridDBColumn17: TcxGridDBColumn;
|
||||
cxGridDBColumn18: TcxGridDBColumn;
|
||||
cxGridDBColumn19: TcxGridDBColumn;
|
||||
cxGridDBColumn20: TcxGridDBColumn;
|
||||
cxGridDBColumn21: TcxGridDBColumn;
|
||||
cxGridDBColumn22: TcxGridDBColumn;
|
||||
cxGridDBColumn23: TcxGridDBColumn;
|
||||
cxGridDBColumn24: TcxGridDBColumn;
|
||||
cxGridDBColumn25: TcxGridDBColumn;
|
||||
cxGridDBColumn26: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource3: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton9: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure CYNoChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure CYSpecChange(Sender: TObject);
|
||||
procedure TOKClick(Sender: TObject);
|
||||
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure ToolButton9Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
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;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPManageSel.InitImage();
|
||||
var
|
||||
i,j:integer;
|
||||
jpg:TJpegImage;
|
||||
myStream: TADOBlobStream;
|
||||
begin
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
with ADOQueryTree do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||
Open;
|
||||
end;
|
||||
cxDBTreeList1.Items[0].Expand(false);
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.InitGrid();
|
||||
begin
|
||||
Panel2.Visible:=True;
|
||||
Panel2.Refresh;
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
||||
Parameters.ParamByName('Code').Value:='';
|
||||
Parameters.ParamByName('PState').Value:=0;
|
||||
Parameters.ParamByName('CYType').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPManageSel:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
var
|
||||
i,j:integer;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(self.Caption,Tv1,'样品管理');
|
||||
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCPManageSel.FormShow(Sender: TObject);
|
||||
begin
|
||||
Panel3.Align:=alclient;
|
||||
InitTree();
|
||||
ReadCxGrid(self.Caption,Tv1,'样品管理');
|
||||
with adoqueryPicture 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(adoqueryPicture,ClientDataSet1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
inittree();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
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:=Trim(CYID.Text);
|
||||
Parameters.ParamByName('PState').Value:=1;
|
||||
Parameters.ParamByName('CYType').Value:='';
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYNoChange(Sender: TObject);
|
||||
begin
|
||||
// if Length(Trim(CYNO.Text))<4 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('样品档案',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile,FFCYID:string;
|
||||
DPS,i,j:Integer;
|
||||
Txt,fImagePath:string;
|
||||
Moudle: THandle;
|
||||
Makebar:TMakebar;
|
||||
Mixtext:TMixtext;
|
||||
begin
|
||||
CYID.SetFocus;
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
//if CDS_CYNO.IsEmpty then Exit;
|
||||
IF trim(ComboBox1.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('样品标签不能为空!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
if Trim(Edit1.Text)<>'' then
|
||||
begin
|
||||
if TryStrToInt(Edit1.Text,i)=False then
|
||||
begin
|
||||
Application.MessageBox('份数录入错误!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+trim(ComboBox1.Text)+'.rmf';
|
||||
CDS_Main.DisableControls;
|
||||
DPS:=0;
|
||||
FFCYID:='';
|
||||
i:=1;
|
||||
if Trim(Edit1.Text)='' then
|
||||
begin
|
||||
j:=1;
|
||||
end else
|
||||
begin
|
||||
j:=StrToInt(Edit1.Text);
|
||||
end;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
try
|
||||
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
||||
@Makebar:=GetProcAddress(Moudle,'Make');
|
||||
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
||||
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp';
|
||||
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
||||
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
||||
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
||||
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
||||
except
|
||||
application.MessageBox('条形码生成失败!','提示信息',MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
RMVariables['QRBARCODE']:=fImagePath;
|
||||
for i:=1 to j do
|
||||
begin
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\样品标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if DPS=0 then
|
||||
begin
|
||||
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
end;
|
||||
end;
|
||||
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||
Edit1.Text:='1';
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.ReadINIFile();
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FileName:string;
|
||||
begin
|
||||
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
||||
programIni:=Tinifile.create(FileName);
|
||||
server:=programIni.ReadString('SERVER','服务器地址','127.0.0.1');
|
||||
programIni.Free;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
{if Key= then
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定6666要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
CDS_Main.Delete;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYSpecChange(Sender: TObject);
|
||||
begin
|
||||
// if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.TOKClick(Sender: TObject);
|
||||
begin
|
||||
IF ClientDataSet1.IsEmpty then exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.ToolButton9Click(Sender: TObject);
|
||||
begin
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPManageSel.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
InitCDSToCDS(CDS_Main,ClientDataSet1);
|
||||
end;
|
||||
|
||||
end.
|
||||
682
云翔OA(WTOA.dll)/U_CPSel.dfm
Normal file
682
云翔OA(WTOA.dll)/U_CPSel.dfm
Normal file
|
|
@ -0,0 +1,682 @@
|
|||
object frmCPSel: TfrmCPSel
|
||||
Left = 75
|
||||
Top = 75
|
||||
Width = 1175
|
||||
Height = 635
|
||||
Caption = #20135#21697#26597#35810
|
||||
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 = 1159
|
||||
Height = 31
|
||||
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 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 = #26631#31614#25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 213
|
||||
Top = 0
|
||||
Width = 174
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
object Label13: TLabel
|
||||
Left = 3
|
||||
Top = 9
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #26631#31614#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object LabName: TBtnEditA
|
||||
Left = 61
|
||||
Top = 5
|
||||
Width = 105
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnBtnClick = LabNameBtnClick
|
||||
end
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 387
|
||||
Top = 0
|
||||
Caption = #26631#31614#39044#35272
|
||||
ImageIndex = 66
|
||||
Visible = False
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 470
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22270#29255#19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = ToolButton6Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 557
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 228
|
||||
Top = 89
|
||||
Width = 931
|
||||
Height = 507
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnCellClick = Tv1CellClick
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Inactive = DataLink_DDMD.SHuangSe
|
||||
Styles.IncSearch = DataLink_DDMD.SHuangSe
|
||||
Styles.Selection = DataLink_DDMD.SHuangSe
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
Properties.OnChange = v1Column19PropertiesChange
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Hidden = True
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 40
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #31867#21035
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 71
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 69
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #20013#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column42: TcxGridDBColumn
|
||||
Caption = #33521#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColorEng'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #22270#29255#19978#20256
|
||||
DataBinding.FieldName = 'TPFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 59
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPriceKg'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 56
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #31859#20215
|
||||
DataBinding.FieldName = 'CYPriceM'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 54
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 220
|
||||
Top = 89
|
||||
Width = 8
|
||||
Height = 507
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
Control = Panel5
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1159
|
||||
Height = 58
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 3
|
||||
object Label2: TLabel
|
||||
Left = 16
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #25195#25551#20837#21475
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 364
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#21517#31216
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 482
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#21517#31216
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 216
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #35268' '#26684
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 216
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 773
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20221#25968
|
||||
Visible = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 606
|
||||
Top = 39
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20811#37325
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 364
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#25104#20998
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 482
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#25104#20998
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 606
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #38376#24133
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 832
|
||||
Top = 15
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 832
|
||||
Top = 39
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = 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 = 1
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYEName: TEdit
|
||||
Tag = 2
|
||||
Left = 531
|
||||
Top = 11
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYSpec: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = CYNoChange
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 731
|
||||
Top = 11
|
||||
Width = 38
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object CYKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 632
|
||||
Top = 35
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
object CYCF: TEdit
|
||||
Tag = 2
|
||||
Left = 414
|
||||
Top = 35
|
||||
Width = 56
|
||||
Height = 20
|
||||
TabOrder = 7
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYECF: TEdit
|
||||
Tag = 2
|
||||
Left = 531
|
||||
Top = 35
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 8
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYMF: TEdit
|
||||
Tag = 2
|
||||
Left = 632
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 9
|
||||
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 = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 0
|
||||
Top = 89
|
||||
Width = 220
|
||||
Height = 507
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 5
|
||||
object Image2: TImage
|
||||
Left = 2
|
||||
Top = 318
|
||||
Width = 216
|
||||
Height = 187
|
||||
Align = alBottom
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 216
|
||||
Height = 316
|
||||
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_DDMD.Red
|
||||
Styles.Selection = DataLink_DDMD.Red
|
||||
Styles.IncSearch = DataLink_DDMD.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 DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree20: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 61
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 989
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1029
|
||||
Top = 1
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 432
|
||||
Top = 184
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 451
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.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
|
||||
end
|
||||
578
云翔OA(WTOA.dll)/U_CPSel.pas
Normal file
578
云翔OA(WTOA.dll)/U_CPSel.pas
Normal file
|
|
@ -0,0 +1,578 @@
|
|||
unit U_CPSel; //
|
||||
|
||||
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, BtnEdit;
|
||||
|
||||
type
|
||||
TfrmCPSel = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree20: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
CYID: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
Label1: TLabel;
|
||||
CYName: TEdit;
|
||||
Label4: TLabel;
|
||||
CYEName: TEdit;
|
||||
Label5: TLabel;
|
||||
CYSpec: TEdit;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ToolButton6: TToolButton;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
CYNO: TEdit;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
Panel2: TPanel;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
DSCYNO: TDataSource;
|
||||
CDS_CYNO: TClientDataSet;
|
||||
Edit1: TEdit;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
Label8: TLabel;
|
||||
Label9: TLabel;
|
||||
CYCF: TEdit;
|
||||
CYECF: TEdit;
|
||||
Label10: TLabel;
|
||||
CYMF: TEdit;
|
||||
v1Column42: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
ADOQueryTree: TClientDataSet;
|
||||
Panel5: TPanel;
|
||||
Image2: TImage;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
Panel4: TPanel;
|
||||
Label13: TLabel;
|
||||
LabName: TBtnEditA;
|
||||
ToolButton3: TToolButton;
|
||||
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 ToolButton6Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure CYSpecChange(Sender: TObject);
|
||||
procedure v1Column19PropertiesChange(Sender: TObject);
|
||||
procedure CYMFChange(Sender: TObject);
|
||||
procedure CYNameChange(Sender: TObject);
|
||||
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure LabNameBtnClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
CPID:string;
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
procedure InitGrid();
|
||||
procedure ReadINIFile();
|
||||
procedure InitImage();
|
||||
procedure TJGS();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPSel: TfrmCPSel;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_CPAdd,U_FileUp,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPSel.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 TfrmCPSel.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 TfrmCPSel.TJGS();
|
||||
var
|
||||
i,j:Integer;
|
||||
begin
|
||||
i:=0;
|
||||
j:=0;
|
||||
CDS_Main.DisableControls;
|
||||
with CDS_Main do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
if FieldByName('CYPriceKg').Value=0 then
|
||||
begin
|
||||
i:=i+1;
|
||||
end else
|
||||
begin
|
||||
j:=j+1;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
Label11.Caption:='定价样品数量:'+Trim(IntToStr(j));
|
||||
Label12.Caption:='未定价样品数量:'+Trim(IntToStr(i));
|
||||
end;
|
||||
procedure TfrmCPSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPSel:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品列表CX1',Tv1,'样品管理');
|
||||
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCPSel.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
ReadCxGrid('样品列表CX1',Tv1,'样品管理');
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYID='''' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_CYNO);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_CYNO);
|
||||
CDS_CYNO.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
TJGS();
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
InitGrid();
|
||||
TJGS();
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.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 TfrmCPSel.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 TfrmCPSel.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 TfrmCPSel.ToolButton6Click(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
{FPath:='C:\HTTP1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XD_File where CYNO='''+Trim(CDS_Main.fieldbyname('CYNO').AsString)+'''');
|
||||
Open;
|
||||
if IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('样品图片未上传!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
try
|
||||
ReadINIFile();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName) then
|
||||
begin
|
||||
FInt:=1;
|
||||
end;
|
||||
if FInt<>1 then
|
||||
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||
);
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
procedure TfrmCPSel.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 TfrmCPSel.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.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 TfrmCPSel.InitImage();
|
||||
var
|
||||
jpg:TJpegImage;
|
||||
myStream:TADOBlobStream;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)='' then Exit;
|
||||
// if cxPageControl1.ActivePageIndex=6 then
|
||||
begin
|
||||
Image2.Picture.Assign(nil);
|
||||
try
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File A where A.WBID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
sql.Add(' and TFType=''样品'' ');
|
||||
open;
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
if trim(ADOQueryTemp.fieldbyname('FilesOther').AsString)<>'' then
|
||||
begin
|
||||
myStream:=tadoblobstream.Create(tblobfield(ADOQueryTemp.fieldbyname('FilesOther')),bmread);
|
||||
if myStream=nil then exit;
|
||||
jpg:=TJPEGImage.Create;
|
||||
jpg.LoadFromStream(myStream);
|
||||
Image2.Picture.Assign(jpg);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
jpg.Free;
|
||||
myStream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.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 TfrmCPSel.CYSpecChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.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 TfrmCPSel.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 TfrmCPSel.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 TfrmCPSel.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 TfrmCPSel.LabNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YPLabName';
|
||||
flagname:='样品标签';
|
||||
fnote:=True;
|
||||
TBAdd.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.LabName.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPSel.ToolButton3Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:string;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(LabName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('标签名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+Trim(LabName.Text)+'.rmf' ;
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\'+Trim(LabName.Text)+'.rmf'),'提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
188
云翔OA(WTOA.dll)/U_CPType.dfm
Normal file
188
云翔OA(WTOA.dll)/U_CPType.dfm
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
object frmCPType: TfrmCPType
|
||||
Left = 167
|
||||
Top = 30
|
||||
Width = 870
|
||||
Height = 505
|
||||
Caption = #20135#21697#31867#21035
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 854
|
||||
Height = 33
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.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 = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 249
|
||||
Height = 433
|
||||
Align = alLeft
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'CPParent'
|
||||
DataController.KeyField = 'CPID'
|
||||
OptionsBehavior.ExpandOnDblClick = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
TabOrder = 1
|
||||
OnClick = cxDBTreeList1Click
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'CPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 270
|
||||
Top = 54
|
||||
Width = 315
|
||||
Height = 150
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 66
|
||||
Top = 24
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #29238' '#31867
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 66
|
||||
Top = 65
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #31867#21035#21517#31216
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 66
|
||||
Top = 105
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #31867#21035#32534#30721
|
||||
end
|
||||
object CPTopName: TEdit
|
||||
Left = 129
|
||||
Top = 21
|
||||
Width = 121
|
||||
Height = 20
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
end
|
||||
object CPName: TEdit
|
||||
Left = 129
|
||||
Top = 61
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnKeyPress = CPNameKeyPress
|
||||
end
|
||||
object CPNo: TEdit
|
||||
Left = 129
|
||||
Top = 101
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree10: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 125
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 709
|
||||
Top = 209
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 677
|
||||
Top = 137
|
||||
end
|
||||
object ADOQueryTree: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 160
|
||||
Top = 152
|
||||
end
|
||||
end
|
||||
246
云翔OA(WTOA.dll)/U_CPType.pas
Normal file
246
云翔OA(WTOA.dll)/U_CPType.pas
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
unit U_CPType; //1
|
||||
|
||||
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, dxorgchr, dxdborgc;
|
||||
|
||||
type
|
||||
TfrmCPType = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree10: TADOQuery;
|
||||
ToolButton1: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
CPTopName: TEdit;
|
||||
CPName: TEdit;
|
||||
CPNo: TEdit;
|
||||
ADOQueryTree: TClientDataSet;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure cxDBTreeList1Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure CPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPType: TfrmCPType;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPType.InitTree();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
with ADOQueryTree10 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTree10,ADOQueryTree);
|
||||
SInitCDSData20(ADOQueryTree10,ADOQueryTree);
|
||||
cxDBTreeList1.Items[0].Expand(false);
|
||||
|
||||
|
||||
// dxDbOrgChart1.Items[1].Expand(False);
|
||||
// dxDbOrgChart1.Items[0].Expand(False);
|
||||
//cxDBTreeList1.Items[1].Expand(False);
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPType:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
PState:=11;
|
||||
CPTopName.Text:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||
//FTopID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FCPID:='';
|
||||
CPName.Text:='';
|
||||
CPNo.Text:='';
|
||||
CPName.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
PState:=22;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CP_Type where CPID='''+Trim(ADOQueryTree.fieldbyname('CPParent').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
FCPID:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
CPTopName.Text:=Trim(ADOQueryTemp.fieldbyname('CPName').AsString);
|
||||
CPName.Text:=Trim(ADOQueryTree.fieldbyname('CPName').AsString);
|
||||
CPNo.Text:=Trim(ADOQueryTree.fieldbyname('CPNo').AsString);
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
maxId:String;
|
||||
begin
|
||||
if Trim(CPName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('类别名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(CPNo.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('类别编码不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
if PState=11 then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxId,'CP','CP_Type',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('区最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxId:=Trim(FCPID);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_Type where CPID='''+Trim(FCPID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if PState=11 then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('CPID').Value:=Trim(maxId);
|
||||
FieldByName('CPName').Value:=Trim(CPName.Text);
|
||||
FieldByName('CPNo').Value:=Trim(CPNo.Text);
|
||||
FieldByName('CPParent').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
FieldByName('CPLevel').Value:=ADOQueryTree.fieldbyname('CPLevel').AsInteger+1;
|
||||
Post;
|
||||
end else
|
||||
if PState=22 then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('CPID').Value:=Trim(maxId);
|
||||
FieldByName('CPName').Value:=Trim(CPName.Text);
|
||||
FieldByName('CPNo').Value:=Trim(CPNo.Text);
|
||||
//FieldByName('CPParent').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
||||
//FieldByName('CPOrder').Value:=ADOQueryTree.fieldbyname('CPOrder').AsInteger+1;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTree.FieldByName('CPLevel').AsInteger=0 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CP_Type where CPParent='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('已经定义子类不能删除!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from CP_YDang where CYType='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('已经有产品属于此类不能删除!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete CP_Type where CPID='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||
sql.Add('delete CP_Type where CPParent='''+Trim(ADOQueryTree.fieldbyname('CPID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.CPNameKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
CPNo.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmCPType.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
end.
|
||||
724
云翔OA(WTOA.dll)/U_CPView.dfm
Normal file
724
云翔OA(WTOA.dll)/U_CPView.dfm
Normal file
|
|
@ -0,0 +1,724 @@
|
|||
object frmCPView: TfrmCPView
|
||||
Left = 75
|
||||
Top = 75
|
||||
Width = 1148
|
||||
Height = 618
|
||||
Caption = #20135#21697#26597#35810
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnKeyDown = FormKeyDown
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1132
|
||||
Height = 31
|
||||
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 ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 97
|
||||
Visible = False
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26631#31614#25171#21360
|
||||
ImageIndex = 4
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 276
|
||||
Top = 0
|
||||
Width = 72
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label6: TLabel
|
||||
Left = 3
|
||||
Top = 9
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20221#25968
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 29
|
||||
Top = 6
|
||||
Width = 38
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 348
|
||||
Top = 0
|
||||
Width = 174
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 0
|
||||
object Label13: TLabel
|
||||
Left = 3
|
||||
Top = 9
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #26631#31614#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object LabName: TBtnEditA
|
||||
Left = 61
|
||||
Top = 5
|
||||
Width = 105
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnBtnClick = LabNameBtnClick
|
||||
end
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 522
|
||||
Top = 0
|
||||
Caption = #26631#31614#39044#35272
|
||||
ImageIndex = 66
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 605
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22270#29255#19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = ToolButton6Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 692
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 228
|
||||
Top = 89
|
||||
Width = 904
|
||||
Height = 490
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.Delete.Enabled = False
|
||||
NavigatorButtons.Delete.Visible = False
|
||||
OnCellClick = Tv1CellClick
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Inactive = DataLink_DDMD.SHuangSe
|
||||
Styles.IncSearch = DataLink_DDMD.SHuangSe
|
||||
Styles.Selection = DataLink_DDMD.SHuangSe
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
Properties.OnChange = v1Column19PropertiesChange
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 40
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #31867#21035
|
||||
DataBinding.FieldName = 'CPName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #38472#21015#20301#32622
|
||||
DataBinding.FieldName = 'DefStr2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 71
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20013#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #32769#32534#21495
|
||||
DataBinding.FieldName = 'OldCYNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 92
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'CYSpec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #20013#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #33521#25991#21517#31216
|
||||
DataBinding.FieldName = 'CYEName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #33521#25991#25104#20998
|
||||
DataBinding.FieldName = 'CYECF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 69
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Caption = #33457#22411
|
||||
DataBinding.FieldName = 'CYHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 58
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #20013#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColor'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 67
|
||||
end
|
||||
object v1Column42: TcxGridDBColumn
|
||||
Caption = #33521#25991#39068#33394
|
||||
DataBinding.FieldName = 'CYColorEng'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #38754#26009#26469#28304
|
||||
DataBinding.FieldName = 'CYFrom'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 109
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'CYNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 66
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #22270#29255#19978#20256
|
||||
DataBinding.FieldName = 'TPFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
Width = 59
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #20844#26020#20215
|
||||
DataBinding.FieldName = 'CYPriceKg'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 56
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #31859#20215
|
||||
DataBinding.FieldName = 'CYPriceM'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 54
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 220
|
||||
Top = 89
|
||||
Width = 8
|
||||
Height = 490
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
Control = Panel5
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1132
|
||||
Height = 58
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 3
|
||||
object Label2: TLabel
|
||||
Left = 16
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #25195#25551#20837#21475
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 364
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#21517#31216
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 482
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#21517#31216
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 216
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #35268' '#26684
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 216
|
||||
Top = 15
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20135#21697#32534#21495
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 606
|
||||
Top = 39
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #20811#37325
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 364
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #20013#25991#25104#20998
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 482
|
||||
Top = 39
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #33521#25991#25104#20998
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 606
|
||||
Top = 15
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #38376#24133
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 832
|
||||
Top = 15
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 832
|
||||
Top = 39
|
||||
Width = 7
|
||||
Height = 12
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label15: TLabel
|
||||
Left = 720
|
||||
Top = 15
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = #32769#32534#21495
|
||||
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 = 1
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYEName: TEdit
|
||||
Tag = 2
|
||||
Left = 531
|
||||
Top = 11
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYSpec: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CYNoChange
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 265
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = CYNoChange
|
||||
OnKeyPress = CYNOKeyPress
|
||||
end
|
||||
object CYKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 632
|
||||
Top = 35
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
object CYCF: TEdit
|
||||
Tag = 2
|
||||
Left = 414
|
||||
Top = 35
|
||||
Width = 56
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYECF: TEdit
|
||||
Tag = 2
|
||||
Left = 531
|
||||
Top = 35
|
||||
Width = 59
|
||||
Height = 20
|
||||
TabOrder = 7
|
||||
OnChange = CYNameChange
|
||||
end
|
||||
object CYMF: TEdit
|
||||
Tag = 2
|
||||
Left = 632
|
||||
Top = 11
|
||||
Width = 76
|
||||
Height = 20
|
||||
TabOrder = 8
|
||||
OnChange = CYMFChange
|
||||
end
|
||||
object OldCYNo: TEdit
|
||||
Tag = 2
|
||||
Left = 755
|
||||
Top = 11
|
||||
Width = 73
|
||||
Height = 20
|
||||
TabOrder = 9
|
||||
OnChange = CYNoChange
|
||||
OnKeyPress = OldCYNoKeyPress
|
||||
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 = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 0
|
||||
Top = 89
|
||||
Width = 220
|
||||
Height = 490
|
||||
Align = alLeft
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 5
|
||||
object Image2: TImage
|
||||
Left = 2
|
||||
Top = 301
|
||||
Width = 216
|
||||
Height = 187
|
||||
Align = alBottom
|
||||
end
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 216
|
||||
Height = 299
|
||||
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_DDMD.Red
|
||||
Styles.Selection = DataLink_DDMD.Red
|
||||
Styles.IncSearch = DataLink_DDMD.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 DataSource1: TDataSource
|
||||
DataSet = ADOQueryTree
|
||||
Left = 91
|
||||
Top = 147
|
||||
end
|
||||
object ADOQueryTree20: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 61
|
||||
Top = 145
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 989
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1029
|
||||
Top = 1
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 432
|
||||
Top = 184
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 451
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.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
|
||||
end
|
||||
686
云翔OA(WTOA.dll)/U_CPView.pas
Normal file
686
云翔OA(WTOA.dll)/U_CPView.pas
Normal file
|
|
@ -0,0 +1,686 @@
|
|||
unit U_CPView; //3
|
||||
|
||||
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, BtnEdit;
|
||||
|
||||
type
|
||||
TfrmCPView = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTree20: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
CYID: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
Label1: TLabel;
|
||||
CYName: TEdit;
|
||||
Label4: TLabel;
|
||||
CYEName: TEdit;
|
||||
Label5: TLabel;
|
||||
CYSpec: TEdit;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
CDS_Main: TClientDataSet;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ToolButton6: TToolButton;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
CYNO: TEdit;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
Panel2: TPanel;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
DSCYNO: TDataSource;
|
||||
CDS_CYNO: TClientDataSet;
|
||||
Label7: TLabel;
|
||||
CYKZ: TEdit;
|
||||
Label8: TLabel;
|
||||
Label9: TLabel;
|
||||
CYCF: TEdit;
|
||||
CYECF: TEdit;
|
||||
Label10: TLabel;
|
||||
CYMF: TEdit;
|
||||
v1Column42: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
ADOQueryTree: TClientDataSet;
|
||||
Panel5: TPanel;
|
||||
Image2: TImage;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
Panel4: TPanel;
|
||||
Label13: TLabel;
|
||||
LabName: TBtnEditA;
|
||||
ToolButton3: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label6: TLabel;
|
||||
Edit1: TEdit;
|
||||
Label15: TLabel;
|
||||
OldCYNo: TEdit;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure CYNoChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton6Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
procedure CYSpecChange(Sender: TObject);
|
||||
procedure v1Column19PropertiesChange(Sender: TObject);
|
||||
procedure CYMFChange(Sender: TObject);
|
||||
procedure CYNameChange(Sender: TObject);
|
||||
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure LabNameBtnClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure OldCYNoKeyPress(Sender: TObject; var Key: Char);
|
||||
private
|
||||
{ Private declarations }
|
||||
CPID:string;
|
||||
PState:Integer;
|
||||
FCPID,FTopID:String;
|
||||
procedure InitTree();
|
||||
procedure InitGrid();
|
||||
procedure ReadINIFile();
|
||||
procedure InitImage();
|
||||
procedure TJGS();
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmCPView: TfrmCPView;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_CPAdd,U_FileUp,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmCPView.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 TfrmCPView.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 TfrmCPView.TJGS();
|
||||
var
|
||||
i,j:Integer;
|
||||
begin
|
||||
i:=0;
|
||||
j:=0;
|
||||
CDS_Main.DisableControls;
|
||||
with CDS_Main do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
if FieldByName('CYPriceKg').Value=0 then
|
||||
begin
|
||||
i:=i+1;
|
||||
end else
|
||||
begin
|
||||
j:=j+1;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
Label11.Caption:='定价样品数量:'+Trim(IntToStr(j));
|
||||
Label12.Caption:='未定价样品数量:'+Trim(IntToStr(i));
|
||||
end;
|
||||
procedure TfrmCPView.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmCPView:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('样品列表CX',Tv1,'样品管理');
|
||||
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmCPView.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
ReadCxGrid('样品列表CX',Tv1,'样品管理');
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select CYID='''' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,CDS_CYNO);
|
||||
SInitCDSData20(ADOQueryTemp,CDS_CYNO);
|
||||
CDS_CYNO.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
TJGS();
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
InitGrid();
|
||||
TJGS();
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.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 TfrmCPView.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 TfrmCPView.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 TfrmCPView.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('样品档案',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile,FFCYID:string;
|
||||
DPS,i,j:Integer;
|
||||
begin
|
||||
CYID.SetFocus;
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
//if CDS_CYNO.IsEmpty then Exit;
|
||||
if Trim(LabName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('标签名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(Edit1.Text)<>'' then
|
||||
begin
|
||||
if TryStrToInt(Edit1.Text,i)=False then
|
||||
begin
|
||||
Application.MessageBox('份数录入错误!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) +'Report\'+Trim(LabName.Text)+'.rmf';
|
||||
CDS_Main.DisableControls;
|
||||
DPS:=0;
|
||||
FFCYID:='';
|
||||
i:=1;
|
||||
if Trim(Edit1.Text)='' then
|
||||
begin
|
||||
j:=1;
|
||||
end else
|
||||
begin
|
||||
j:=StrToInt(Edit1.Text);
|
||||
end;
|
||||
with CDS_Main do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
for i:=1 to j do
|
||||
begin
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\'+Trim(LabName.Text)+'.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if DPS=0 then
|
||||
begin
|
||||
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
||||
end;
|
||||
end;
|
||||
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
CDS_Main.EnableControls;
|
||||
CDS_Main.Locate('CYID',FFCYID,[]);
|
||||
Edit1.Text:='1';
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.ToolButton6Click(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
{FPath:='C:\HTTP1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q C:\HTTP1209',sw_hide);}
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XD_File where CYNO='''+Trim(CDS_Main.fieldbyname('CYNO').AsString)+'''');
|
||||
Open;
|
||||
if IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('样品图片未上传!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
try
|
||||
ReadINIFile();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
FFName:=Trim(ADOQueryTemp.fieldbyname('FileName').AsString);
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName) then
|
||||
begin
|
||||
FInt:=1;
|
||||
end;
|
||||
if FInt<>1 then
|
||||
IdFTP1.Get('YP\'+Trim(ADOQueryTemp.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)
|
||||
);
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(ADOQueryTemp.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
procedure TfrmCPView.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 TfrmCPView.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ToolButton6.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.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 TfrmCPView.InitImage();
|
||||
var
|
||||
jpg:TJpegImage;
|
||||
myStream:TADOBlobStream;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(CDS_Main.fieldbyname('CYID').AsString)='' then Exit;
|
||||
// if cxPageControl1.ActivePageIndex=6 then
|
||||
begin
|
||||
Image2.Picture.Assign(nil);
|
||||
try
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File A where A.WBID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
||||
sql.Add(' and TFType=''样品'' ');
|
||||
open;
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
if trim(ADOQueryTemp.fieldbyname('FilesOther').AsString)<>'' then
|
||||
begin
|
||||
myStream:=tadoblobstream.Create(tblobfield(ADOQueryTemp.fieldbyname('FilesOther')),bmread);
|
||||
if myStream=nil then exit;
|
||||
jpg:=TJPEGImage.Create;
|
||||
jpg.LoadFromStream(myStream);
|
||||
Image2.Picture.Assign(jpg);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
jpg.Free;
|
||||
myStream.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.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 TfrmCPView.CYSpecChange(Sender: TObject);
|
||||
begin
|
||||
if Length(Trim(CYSpec.Text))<3 then Exit;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.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 TfrmCPView.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 TfrmCPView.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 TfrmCPView.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 TfrmCPView.LabNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YPLabName';
|
||||
flagname:='样品标签';
|
||||
fnote:=True;
|
||||
TBAdd.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.LabName.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.ToolButton3Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:string;
|
||||
begin
|
||||
if CDS_Main.IsEmpty then Exit;
|
||||
if Trim(LabName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('标签名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+Trim(LabName.Text)+'.rmf' ;
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\'+Trim(LabName.Text)+'.rmf'),'提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmCPView.OldCYNoKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
if Trim(OldCYNo.Text)='' then Exit;
|
||||
if Length(Trim(OldCYNo.Text))<4 then Exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
Filtered:=False;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_Select_CP_YDang :Code,8,'''' ');
|
||||
Parameters.ParamByName('Code').Value:='%'+Trim(OldCYNo.Text)+'%';
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,CDS_Main);
|
||||
SInitCDSData20(ADOQueryMain,CDS_Main);
|
||||
CYID.Text:='';
|
||||
ADOQueryTree.Locate('CPID',CPID,[]);
|
||||
TJGS();
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
905
云翔OA(WTOA.dll)/U_ContractList_CX.dfm
Normal file
905
云翔OA(WTOA.dll)/U_ContractList_CX.dfm
Normal file
|
|
@ -0,0 +1,905 @@
|
|||
object frmContractList_CX: TfrmContractList_CX
|
||||
Left = 191
|
||||
Top = 126
|
||||
Width = 1377
|
||||
Height = 701
|
||||
Caption = #35746#21333#21512#21516#26597#35810
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1361
|
||||
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_WTOA.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 = 24
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBFind: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = TBFindClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 78
|
||||
Width = 1361
|
||||
Height = 334
|
||||
Align = alTop
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
OnCustomDrawCell = Tv1CustomDrawCell
|
||||
OnFocusedRecordChanged = Tv1FocusedRecordChanged
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1PRTOrderQty
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1ConMoney
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.OnGetContentStyle = Tv1StylesGetContentStyle
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 49
|
||||
end
|
||||
object v1ConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 73
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = 'PO#'
|
||||
DataBinding.FieldName = 'KHConNO'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20844#21496#21488#22836
|
||||
DataBinding.FieldName = 'SYRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 119
|
||||
end
|
||||
object v1OrdPerson1: TcxGridDBColumn
|
||||
Caption = #19994#21153#21592
|
||||
DataBinding.FieldName = 'ConPerson1'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 83
|
||||
end
|
||||
object v1CustomerNoName: TcxGridDBColumn
|
||||
Caption = #23458#25143
|
||||
DataBinding.FieldName = 'CustomerNoName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 102
|
||||
end
|
||||
object v1OrdDate: TcxGridDBColumn
|
||||
Caption = #21046#21333#26085#26399
|
||||
DataBinding.FieldName = 'OrdDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 120
|
||||
end
|
||||
object v1DeliveryDate: TcxGridDBColumn
|
||||
Caption = #20132#36135#26085#26399
|
||||
DataBinding.FieldName = 'DlyDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.ShowTime = False
|
||||
OnCustomDrawCell = v1DeliveryDateCustomDrawCell
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 97
|
||||
end
|
||||
object v1MPRTSpec: TcxGridDBColumn
|
||||
Caption = #20132#26399#35828#26126
|
||||
DataBinding.FieldName = 'DlyNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 100
|
||||
end
|
||||
object v1OrdDefStr1: TcxGridDBColumn
|
||||
Caption = #20215#26684#26415#35821
|
||||
DataBinding.FieldName = 'PriceNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
object v1PRTOrderQty: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'PRTOrderQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 72
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'OrderUnit'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
DataBinding.FieldName = 'status'
|
||||
Visible = False
|
||||
Hidden = True
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #21512#21516#38468#20214
|
||||
DataBinding.FieldName = 'ISSC'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 58
|
||||
end
|
||||
object v1ConMoney: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'ConMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = FoneRed
|
||||
Styles.Footer = FoneRed
|
||||
Styles.Header = FoneRed
|
||||
Width = 105
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22791#27880'1'
|
||||
DataBinding.FieldName = 'condefnote2'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #22791#27880'2'
|
||||
DataBinding.FieldName = 'condefnote3'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1361
|
||||
Height = 46
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 25
|
||||
Top = 16
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #21046#21333#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 320
|
||||
Top = 16
|
||||
Width = 44
|
||||
Height = 13
|
||||
Caption = #23458' '#25143
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 713
|
||||
Top = 16
|
||||
Width = 58
|
||||
Height = 13
|
||||
Caption = #19994' '#21153' '#21592
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 496
|
||||
Top = 94
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #33521#25991#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 510
|
||||
Top = 16
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #21512#21516#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 363
|
||||
Top = 90
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #20811#37325
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label13: TLabel
|
||||
Left = 363
|
||||
Top = 116
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #38376#24133
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 178
|
||||
Top = 17
|
||||
Width = 8
|
||||
Height = 13
|
||||
Caption = '-'
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 917
|
||||
Top = 16
|
||||
Width = 24
|
||||
Height = 13
|
||||
Caption = 'PO#'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 1153
|
||||
Top = 17
|
||||
Width = 59
|
||||
Height = 13
|
||||
Caption = #38144#21806#39069#65306'0'
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 82
|
||||
Top = 12
|
||||
Width = 94
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 186
|
||||
Top = 12
|
||||
Width = 95
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object CustomerNoName: TEdit
|
||||
Tag = 2
|
||||
Left = 372
|
||||
Top = 12
|
||||
Width = 108
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
OnChange = CustomerNoNameChange
|
||||
OnKeyPress = ConNoKeyPress
|
||||
end
|
||||
object ConPerson1: TEdit
|
||||
Tag = 2
|
||||
Left = 779
|
||||
Top = 12
|
||||
Width = 108
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
OnChange = CustomerNoNameChange
|
||||
OnKeyPress = ConNoKeyPress
|
||||
end
|
||||
object MPRTCodeName: TEdit
|
||||
Tag = 2
|
||||
Left = 554
|
||||
Top = 90
|
||||
Width = 82
|
||||
Height = 21
|
||||
ImeName = #20013#25991' ('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861
|
||||
TabOrder = 4
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object ConNo: TEdit
|
||||
Tag = 2
|
||||
Left = 559
|
||||
Top = 12
|
||||
Width = 108
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
OnChange = CustomerNoNameChange
|
||||
OnKeyPress = ConNoKeyPress
|
||||
end
|
||||
object MPRTKZ: TEdit
|
||||
Tag = 2
|
||||
Left = 394
|
||||
Top = 86
|
||||
Width = 61
|
||||
Height = 21
|
||||
ImeName = #20013#25991' ('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861
|
||||
TabOrder = 6
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object MPRTMF: TEdit
|
||||
Tag = 2
|
||||
Left = 394
|
||||
Top = 112
|
||||
Width = 61
|
||||
Height = 21
|
||||
ImeName = #20013#25991' ('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861
|
||||
TabOrder = 7
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object KHConNO: TEdit
|
||||
Tag = 2
|
||||
Left = 948
|
||||
Top = 12
|
||||
Width = 108
|
||||
Height = 21
|
||||
TabOrder = 8
|
||||
OnChange = CustomerNoNameChange
|
||||
OnKeyPress = ConNoKeyPress
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 0
|
||||
Top = 433
|
||||
Width = 1361
|
||||
Height = 8
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
AlignSplitter = salBottom
|
||||
Control = cxGrid2
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 441
|
||||
Width = 1361
|
||||
Height = 220
|
||||
Align = alBottom
|
||||
TabOrder = 4
|
||||
object TV2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
Column = cxGridDBColumn3
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn3
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object V2Column2: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'PRTCode'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #33521#25991#21697#21517
|
||||
DataBinding.FieldName = 'PrtCodeName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #35268#26684
|
||||
DataBinding.FieldName = 'PRTspec'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object V2Column4: TcxGridDBColumn
|
||||
Caption = #25104#20221
|
||||
DataBinding.FieldName = 'PRTCF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object V2Column1: TcxGridDBColumn
|
||||
Caption = #33394#21495
|
||||
DataBinding.FieldName = 'SOrddefstr1'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 69
|
||||
end
|
||||
object v1PRTColor: TcxGridDBColumn
|
||||
Caption = #39068#33394
|
||||
DataBinding.FieldName = 'PRTColor'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.handBlack
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #39068#33394#33521#25991
|
||||
DataBinding.FieldName = 'SOrdDefStr4'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #33457#22411#33457#21495
|
||||
DataBinding.FieldName = 'PRTHX'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.FonePurple
|
||||
Width = 70
|
||||
end
|
||||
object V2Column3: TcxGridDBColumn
|
||||
Caption = #23458#25143#27454#21495
|
||||
DataBinding.FieldName = 'prtkuanno'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'PRTMF'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'PRTKZ'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'PRTOrderQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object v1OrderUnit: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'OrderUnit'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 70
|
||||
end
|
||||
object V2Column5: TcxGridDBColumn
|
||||
Caption = #27719#29575
|
||||
DataBinding.FieldName = 'huilv'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object V2Column6: TcxGridDBColumn
|
||||
Caption = #21333#20215
|
||||
DataBinding.FieldName = 'prtprice'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
object V2Column7: TcxGridDBColumn
|
||||
Caption = #24065#31181
|
||||
DataBinding.FieldName = 'PriceUnit'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 60
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 544
|
||||
Top = 176
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 688
|
||||
Top = 224
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 552
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 316
|
||||
Top = 232
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 440
|
||||
Top = 184
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 464
|
||||
Top = 208
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbPageSetup, pbExit, pbSaveToXLS, pbExport, pbNavigator]
|
||||
DefaultCollate = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
Dataset = RMDBDataSet1
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 336
|
||||
Top = 200
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBDataSet1: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = CDS_Print
|
||||
Left = 392
|
||||
Top = 200
|
||||
end
|
||||
object RMXLSExport1: TRMXLSExport
|
||||
ShowAfterExport = True
|
||||
ExportPrecision = 1
|
||||
PagesOfSheet = 1
|
||||
ExportImages = True
|
||||
ExportFrames = True
|
||||
ExportImageFormat = ifBMP
|
||||
JPEGQuality = 0
|
||||
ScaleX = 1.000000000000000000
|
||||
ScaleY = 1.000000000000000000
|
||||
CompressFile = False
|
||||
Left = 576
|
||||
Top = 248
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 288
|
||||
Top = 184
|
||||
object N2: TMenuItem
|
||||
Caption = #26377#20379#24212#21830
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 360
|
||||
Top = 240
|
||||
end
|
||||
object CDS_Print: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 344
|
||||
Top = 288
|
||||
end
|
||||
object PopupMenu2: TPopupMenu
|
||||
Left = 648
|
||||
Top = 168
|
||||
object N11: TMenuItem
|
||||
Caption = #26684#24335'1'
|
||||
end
|
||||
object N21: TMenuItem
|
||||
Caption = #26684#24335'2'
|
||||
end
|
||||
object N31: TMenuItem
|
||||
Caption = #26684#24335'3'
|
||||
end
|
||||
end
|
||||
object ADOQuerySub: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 556
|
||||
Top = 416
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = ADOQuerySub
|
||||
Left = 488
|
||||
Top = 440
|
||||
end
|
||||
object ThreeColorBase: TcxStyleRepository
|
||||
Left = 425
|
||||
Top = 237
|
||||
object SHuangSe: TcxStyle
|
||||
AssignedValues = [svColor, svFont, svTextColor]
|
||||
Color = 4707838
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
TextColor = clBtnText
|
||||
end
|
||||
object SkyBlue: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
end
|
||||
object Default: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object QHuangSe: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = 8454143
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
end
|
||||
object 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 FontBlue: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object TextSHuangSe: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clBlack
|
||||
end
|
||||
object FonePurple: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindow
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clBlack
|
||||
end
|
||||
object FoneClMaroon: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clMaroon
|
||||
end
|
||||
object FoneRed: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clRed
|
||||
end
|
||||
object RowColor: TcxStyle
|
||||
AssignedValues = [svColor]
|
||||
Color = 16311512
|
||||
end
|
||||
object handBlack: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxBlue: TcxStyle
|
||||
AssignedValues = [svColor, svFont]
|
||||
Color = 16711731
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
end
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svColor]
|
||||
Color = clLime
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 544
|
||||
Top = 316
|
||||
end
|
||||
end
|
||||
576
云翔OA(WTOA.dll)/U_ContractList_CX.pas
Normal file
576
云翔OA(WTOA.dll)/U_ContractList_CX.pas
Normal file
|
|
@ -0,0 +1,576 @@
|
|||
unit U_ContractList_CX;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
|
||||
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,
|
||||
Menus, cxPC, cxButtonEdit, cxTextEdit;
|
||||
|
||||
type
|
||||
TfrmContractList_CX = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBFind: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
v1OrdDate: TcxGridDBColumn;
|
||||
v1DeliveryDate: TcxGridDBColumn;
|
||||
v1OrdPerson1: TcxGridDBColumn;
|
||||
v1ConNo: TcxGridDBColumn;
|
||||
v1MPRTSpec: TcxGridDBColumn;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBDataSet1: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
v1CustomerNoName: TcxGridDBColumn;
|
||||
v1PRTOrderQty: TcxGridDBColumn;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
v1OrdDefStr1: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
CDS_Print: TClientDataSet;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
PopupMenu2: TPopupMenu;
|
||||
N11: TMenuItem;
|
||||
N21: TMenuItem;
|
||||
N31: TMenuItem;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label8: TLabel;
|
||||
Label9: TLabel;
|
||||
Label12: TLabel;
|
||||
Label13: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
CustomerNoName: TEdit;
|
||||
ConPerson1: TEdit;
|
||||
MPRTCodeName: TEdit;
|
||||
ConNo: TEdit;
|
||||
MPRTKZ: TEdit;
|
||||
MPRTMF: TEdit;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
cxSplitter1: TcxSplitter;
|
||||
cxGrid2: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1PRTColor: TcxGridDBColumn;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
v1OrderUnit: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
ADOQuerySub: TADOQuery;
|
||||
DataSource2: TDataSource;
|
||||
KHConNO: TEdit;
|
||||
Label3: TLabel;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
Label6: TLabel;
|
||||
v1ConMoney: TcxGridDBColumn;
|
||||
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;
|
||||
cxStyle1: TcxStyle;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
V2Column2: TcxGridDBColumn;
|
||||
V2Column3: TcxGridDBColumn;
|
||||
V2Column4: TcxGridDBColumn;
|
||||
V2Column5: TcxGridDBColumn;
|
||||
V2Column6: TcxGridDBColumn;
|
||||
V2Column7: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
V2Column1: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure TBTPClick(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure CheckBox2Click(Sender: TObject);
|
||||
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView;
|
||||
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
|
||||
out AStyle: TcxStyle);
|
||||
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView;
|
||||
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
||||
var ADone: Boolean);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure CustomerNoNameChange(Sender: TObject);
|
||||
procedure ConNoKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView;
|
||||
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
||||
var ADone: Boolean);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
private
|
||||
DQdate:TDateTime;
|
||||
fuserName:string;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
function DelData():Boolean;
|
||||
procedure InitGridFH();
|
||||
procedure SetStatus();
|
||||
procedure InitSub();
|
||||
{ Private declarations }
|
||||
public
|
||||
FFInt,FCloth:Integer;
|
||||
canshu1:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmContractList_CX: TfrmContractList_CX;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun,U_ZDYHelp, U_FjList_RZ;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmContractList_CX.InitSub();
|
||||
begin
|
||||
ADOQuerySub.Close;
|
||||
IF Order_Main.IsEmpty then exit;
|
||||
with ADOQuerySub do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrderCon_sub ');
|
||||
sql.Add('where mainID ='+quotedstr((Order_Main.fieldbyname('mainID').AsString)));
|
||||
open;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmContractList_CX.SetStatus();
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmContractList_CX:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxgrid1.Align:=alClient;
|
||||
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
||||
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
||||
DQdate:=SGetServerDate(ADOQueryTemp);
|
||||
canshu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid(self.Caption+tv1.Name,Tv1,'生产指示单管理');
|
||||
WriteCxGrid(self.Caption+tv2.Name,Tv2,'生产指示单管理');
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,A.ConNo ConNoM ');
|
||||
SQL.Add(',PRTOrderQty=(select Sum(PRTOrderQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',ConMoney=(select Sum((PRTOrderQty*PRTPrice+sordQty1+sordQty2)*huilv) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',OrderUnit=(select top 1 OrderUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',PriceUnit=(select top 1 PriceUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',PRTPrice=(select top 1 PRTPrice from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',case when isnull((select top 1 X.conNO from Contract_Main X where X.conNo=A.conNO) ,'''')='''' then ''否'' else ''是'' end as IScg ');
|
||||
sql.Add(',ISSC=cast((case when isnull((select count(WBID) from TP_File X where X.WBID=A.maiNID and X.TFType=''合同''),0)>0 then 1 else 0 end) as bit)');
|
||||
sql.Add(' from JYOrderCon_Main A ');
|
||||
SQL.Add('where A.OrdDate>='''+FormatDateTime('yyyy-MM-dd',BegDate.DateTime)+'''');
|
||||
SQL.Add(' and A.OrdDate<'''+FormatDateTime('yyyy-MM-dd',enddate.DateTime+1)+'''');
|
||||
//sql.Add(' and A.MPRTType=''外销'' ');
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
sql.Add('and A.Filler='''+Trim(DName)+'''');
|
||||
end;
|
||||
sql.Add(' and isnull(A.status,''0'')=''1''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmContractList_CX.InitGridFH();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('exec Order_QryList :MainId,:WSql');
|
||||
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
|
||||
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.InitForm();
|
||||
begin
|
||||
|
||||
readCxGrid(self.Caption+tv1.Name,Tv1,'生产指示单管理');
|
||||
readCxGrid(self.Caption+tv2.Name,Tv2,'生产指示单管理');
|
||||
|
||||
if FCloth=1 then
|
||||
begin
|
||||
v1Column4.Visible:=True;
|
||||
// v1PRTPrice.Visible:=False;
|
||||
// v1PRTPrice.Hidden:=True;
|
||||
end else
|
||||
begin
|
||||
v1Column4.Visible:=False;
|
||||
// v1PRTPrice.Visible:=True;
|
||||
// v1PRTPrice.Hidden:=False;
|
||||
end;
|
||||
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-30;
|
||||
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
||||
InitGrid();
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
end;
|
||||
|
||||
function TfrmContractList_CX.DelData():Boolean;
|
||||
begin
|
||||
try
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete JYOrderCon_Sub where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
||||
sql.Add('delete JYOrderCon_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
||||
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
||||
sql.Add(' '+quotedstr(trim(DName)));
|
||||
sql.Add(',getdate() ');
|
||||
sql.Add(','+quotedstr(trim(self.Caption)));
|
||||
sql.Add(','+quotedstr(trim('外销合同删除')));
|
||||
sql.Add(','+quotedstr(trim('合同号:'+trim(Order_Main.FieldByName('conNo').AsString))));
|
||||
sql.Add(','+quotedstr(trim('成功')));
|
||||
sql.Add(')');
|
||||
ExecSQL;
|
||||
end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('数据删除异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
InitGrid();
|
||||
|
||||
TBFind.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.FormShow(Sender: TObject);
|
||||
begin
|
||||
|
||||
InitForm();
|
||||
SetStatus();
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.Tv1CellDblClick(
|
||||
Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if ToolButton1.Visible=False then Exit;
|
||||
ToolButton1.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.TBTPClick(Sender: TObject);
|
||||
var
|
||||
FQty,FQty1,FMxQty,FPQty,FMxQtyS,FPQtyS:String;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.CheckBox1Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.CheckBox2Click(Sender: TObject);
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.Tv1StylesGetContentStyle(
|
||||
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
|
||||
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
||||
var
|
||||
id,id10:Integer;
|
||||
begin
|
||||
{try
|
||||
if Tv1.GroupedItemCount=0 then
|
||||
begin
|
||||
Id:=Tv1.GetColumnByFieldName('DeliveryDate').Index-tv1.GroupedItemCount;
|
||||
Id10:=Tv1.GetColumnByFieldName('SubStatus').Index-tv1.GroupedItemCount;
|
||||
if Trim(VarToStr(ARecord.Values[id]))='' then Exit;
|
||||
if Id<0 then Exit;
|
||||
if ARecord.Values[id10]='完成' then exit;
|
||||
if (ARecord.Values[id]-DQdate)>=4 then Exit;
|
||||
if ((ARecord.Values[id]-DQdate)>=0) and ((ARecord.Values[id]-DQdate)<4) then
|
||||
AStyle:=DataLink_.QHuangSe
|
||||
else
|
||||
if ARecord.Values[id]-DQdate<0 then
|
||||
begin
|
||||
AStyle:=DataLink_OrderManage.FenHongS;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
|
||||
end;
|
||||
except
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.v1DeliveryDateCustomDrawCell(
|
||||
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
||||
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
||||
begin
|
||||
{ Id:=TV1.GetColumnByFieldName('DeliveryDate').Index;//;-TV1.GroupedItemCount;
|
||||
Id10:=TV1.GetColumnByFieldName('SubStatus').Index;
|
||||
if Id<0 then Exit;
|
||||
if AViewInfo.GridRecord.Values[Id10]='完成' then Exit;
|
||||
if AViewInfo.GridRecord.Values[Id]-SGetServerDate(ADOQueryTemp)>=4 then Exit;
|
||||
if ((AViewInfo.GridRecord.Values[id]-SGetServerDate10(ADOQueryTemp))>=0) and ((AViewInfo.GridRecord.Values[id]-SGetServerDate(ADOQueryTemp))<4) then
|
||||
ACanvas.Brush.Color:=clYellow
|
||||
else
|
||||
if (AViewInfo.GridRecord.Values[id])-(SGetServerDate10(ADOQueryTemp)<0) then
|
||||
begin
|
||||
ACanvas.Brush.Color:=clRed;
|
||||
end;
|
||||
begin
|
||||
ACanvas.Brush.Color:=clRed;
|
||||
end else
|
||||
if AViewInfo.GridRecord.Values[Id]='Purple' then
|
||||
begin
|
||||
ACanvas.Brush.Color:=clPurple;
|
||||
end else
|
||||
if AViewInfo.GridRecord.Values[Id]='Olive' then
|
||||
begin
|
||||
ACanvas.Brush.Color:=clOlive;
|
||||
end else
|
||||
if AViewInfo.GridRecord.Values[Id]='Teal' then
|
||||
begin
|
||||
ACanvas.Brush.Color:=clTeal;
|
||||
end else
|
||||
if AViewInfo.GridRecord.Values[Id]='Background' then
|
||||
begin
|
||||
ACanvas.Brush.Color:=clBackground;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.N1Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:string;
|
||||
Porderno:string;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\生产指示单10.rmf' ;
|
||||
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
//RMVariables['begindate']:=begindate.DateTime;
|
||||
//RMVariables['enddate']:=enddate.DateTime;
|
||||
//RMVariables['printtime']:=Now;
|
||||
//RMVariables['printer']:=Trim(gUserName);
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\生产指示单10.rmf'),'提示',0);
|
||||
end;
|
||||
SDofilter(ADOQueryMain,'');
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
Order_Main.Locate('ordernoM',Porderno,[]);
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.N2Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:string;
|
||||
Porderno:string;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\生产指示单.rmf' ;
|
||||
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
//RMVariables['begindate']:=begindate.DateTime;
|
||||
//RMVariables['enddate']:=enddate.DateTime;
|
||||
//RMVariables['printtime']:=Now;
|
||||
//RMVariables['printer']:=Trim(gUserName);
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
RM1.ShowReport;
|
||||
end else
|
||||
begin
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\生产指示单.rmf'),'提示',0);
|
||||
end;
|
||||
SDofilter(ADOQueryMain,'');
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
Order_Main.Locate('ordernoM',Porderno,[]);
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.CustomerNoNameChange(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 TfrmContractList_CX.ConNoKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key=#13 then
|
||||
begin
|
||||
if Length(Tedit(Sender).Text)<1 then Exit;
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select A.*,A.ConNo ConNoM ');
|
||||
SQL.Add(',PRTOrderQty=(select Sum(PRTOrderQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',ConMoney=(select Sum(PRTOrderQty*PRTPrice) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',OrderUnit=(select top 1 OrderUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',PriceUnit=(select top 1 PriceUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',PRTPrice=(select top 1 PRTPrice from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
||||
SQL.Add(',case when isnull((select top 1 X.conNO from Contract_Main X where X.conNo=A.conNO) ,'''')='''' then ''否'' else ''是'' end as IScg ');
|
||||
sql.Add(',ISSC=cast((case when isnull((select count(WBID) from TP_File X where X.WBID=A.maiNID and X.TFType=''合同''),0)>0 then 1 else 0 end) as bit)');
|
||||
sql.Add(' from JYOrderCon_Main A ');
|
||||
SQL.Add('where OrdDate>='''+'1899-01-01'+'''');
|
||||
SQL.Add('and OrdDate<'''+'2050-01-01'+'''');
|
||||
sql.Add(' and MPRTType=''外销'' ');
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
sql.Add('and A.Filler='''+Trim(DName)+'''');
|
||||
end;
|
||||
sql.Add(' and '+Tedit(Sender).Name+' like '+quotedstr(trim('%'+trim(Tedit(Sender).Text)+'%')));
|
||||
// sql.Add(' and ConNo like '''+'%'+Trim(ConNoM.Text)+'%'+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
SetStatus();
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.Tv1FocusedRecordChanged(
|
||||
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||
AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
begin
|
||||
InitSub();
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.Tv1CustomDrawCell(
|
||||
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
||||
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
||||
begin
|
||||
IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('status').Index]='2' then
|
||||
ACanvas.Brush.Color:=clLime;
|
||||
end;
|
||||
|
||||
procedure TfrmContractList_CX.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
17985
云翔OA(WTOA.dll)/U_DataLink.dfm
Normal file
17985
云翔OA(WTOA.dll)/U_DataLink.dfm
Normal file
File diff suppressed because it is too large
Load Diff
87
云翔OA(WTOA.dll)/U_DataLink.pas
Normal file
87
云翔OA(WTOA.dll)/U_DataLink.pas
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
unit U_DataLink;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, DB, ADODB, ImgList, Controls, cxStyles, cxLookAndFeels,
|
||||
Windows, Messages, forms, OleCtnrs, DateUtils, cxClasses, 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;
|
||||
|
||||
var
|
||||
DConString: string; {全局连接字符串}
|
||||
server, dtbase, user, pswd: string; {数据库连接参数}
|
||||
DCurHandle: hwnd; //当前窗体句柄
|
||||
DName: string; //#用户名#//
|
||||
DCode: string; //#用户编号#//
|
||||
Ddatabase: string; //#数据库名称#//
|
||||
DTitCaption: string; //#主窗体名称#//
|
||||
PicSvr: string;
|
||||
UserDataFlag: string;
|
||||
DParameters1, DParameters2, DParameters3, DParameters4, DParameters5: string; // 外部参数;
|
||||
DParameters6, DParameters7, DParameters8, DParameters9, DParameters10: string; //外部参数;
|
||||
OldDllApp: Tapplication; //保存原有句柄
|
||||
NewDllApp: Tapplication; //当前句柄
|
||||
MainApplication: Tapplication;
|
||||
DFormCode: integer; //当前窗口号
|
||||
IsDelphiLanguage: integer;
|
||||
DServerDate: TdateTime; //服务器时间
|
||||
DCompany: string; //公司
|
||||
|
||||
type
|
||||
TDataLink_WTOA = 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_WTOA: TDataLink_WTOA;
|
||||
|
||||
implementation
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TDataLink_WTOA.DataModuleDestroy(Sender: TObject);
|
||||
begin
|
||||
DataLink_WTOA := nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
188
云翔OA(WTOA.dll)/U_FileUp.dfm
Normal file
188
云翔OA(WTOA.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 = 368
|
||||
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 = 368
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object FileUp: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 48
|
||||
Wrap = True
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 0
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
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 = 22
|
||||
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 = 92
|
||||
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 = 408
|
||||
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 = 413
|
||||
Top = 285
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 500
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
end
|
||||
357
云翔OA(WTOA.dll)/U_FileUp.pas
Normal file
357
云翔OA(WTOA.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=''PZ''');
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
189
云翔OA(WTOA.dll)/U_FileUp2.dfm
Normal file
189
云翔OA(WTOA.dll)/U_FileUp2.dfm
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
object frmFileUp2: TfrmFileUp2
|
||||
Left = 247
|
||||
Top = 162
|
||||
Width = 660
|
||||
Height = 441
|
||||
Caption = #19978#20256#25991#20214
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 41
|
||||
Width = 581
|
||||
Height = 361
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
object FileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 121
|
||||
end
|
||||
object FileDate: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #19978#20256#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 104
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 190
|
||||
Top = 126
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 581
|
||||
Top = 41
|
||||
Width = 63
|
||||
Height = 361
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.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 = 3
|
||||
Wrap = True
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 644
|
||||
Height = 41
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Top = 14
|
||||
Width = 72
|
||||
Height = 17
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -17
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Image2: TImage
|
||||
Left = 445
|
||||
Top = 8
|
||||
Width = 60
|
||||
Height = 28
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 78
|
||||
Top = 9
|
||||
Width = 211
|
||||
Height = 25
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -17
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ImeName = #20013#25991'('#31616#20307') - '#25628#29399#25340#38899#36755#20837#27861
|
||||
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_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
end
|
||||
350
云翔OA(WTOA.dll)/U_FileUp2.pas
Normal file
350
云翔OA(WTOA.dll)/U_FileUp2.pas
Normal file
|
|
@ -0,0 +1,350 @@
|
|||
unit U_FileUp2;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ComCtrls, ToolWin, ExtCtrls, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP, StdCtrls, ADODB, jpeg, BtnEdit, IniFiles,
|
||||
strutils, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
||||
|
||||
type
|
||||
TfrmFileUp2 = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
FileName: TcxGridDBColumn;
|
||||
FileDate: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel16: TPanel;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
Image2: TImage;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
procedure CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer);
|
||||
procedure SaveImageOther(FTFID: string);
|
||||
procedure ReadINIFile10();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp2: TfrmFileUp2;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp2.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 TfrmFileUp2.FileUpClick(Sender: TObject);
|
||||
var
|
||||
i, j: Integer;
|
||||
PatFile: string;
|
||||
FTPPath, FConNo, MaxNo: string;
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
begin
|
||||
if Trim(Code.Text) = '' then
|
||||
begin
|
||||
Application.MessageBox('编号不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
lstPat.Clear;
|
||||
if ODPat.Execute then
|
||||
begin
|
||||
lstPat.AddStrings(ODPat.Files);
|
||||
end;
|
||||
if lstPat.Count > 0 then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host := PicSvr; //PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Panel16.Visible := True;
|
||||
Panel16.Refresh;
|
||||
|
||||
try
|
||||
AJpeg := TJpegImage.Create();
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select isnull(max(abs(cast(right(left(FileName,charindex(''.'',FileName)-1),2) as int))),0)+1 as BH from XD_File');
|
||||
sql.Add('where CYID=''' + trim(CYID) + ''' ');
|
||||
open;
|
||||
end;
|
||||
|
||||
PatFile := trim(Code.Text) + '-' + inttostr(ADOQueryTemp.fieldbyname('BH').AsInteger) + '.' + Copy(ExtractFileName(lstPat[i]), (Pos('.', ExtractFileName(lstPat[i])) + 1), (Length(ExtractFileName(lstPat[i])) - Pos('.', ExtractFileName(lstPat[i]))));
|
||||
|
||||
AJpeg.LoadFromFile(ExtractFileName(lstPat[i]));
|
||||
CreThumb(AJpeg, Image2, 160, 120);
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Put(lstPat[i], Trim('YP') + '\' + Trim(PatFile));
|
||||
|
||||
if GetLSNo(ADOQueryCmd, MaxNo, 'YP', 'XD_File', 4, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取图片最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value := Trim(MaxNo);
|
||||
FieldByName('CYID').Value := Trim(CYID);
|
||||
FieldByName('CYNO').Value := Trim(Code.Text);
|
||||
FieldByName('filename').Value := Trim(PatFile);
|
||||
FieldByName('FileDate').Value := SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value := Trim('YP');
|
||||
Post;
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File where TFID=''' + Trim(MaxNo) + '''');
|
||||
open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value := Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value := Trim(DName);
|
||||
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('TFID').Value := Trim(MaxNo);
|
||||
FieldByName('WBID').Value := Trim(CYID);
|
||||
FieldByName('TFType').Value := '样品';
|
||||
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
AJpeg.SaveToStream(myStream);
|
||||
myStream.Free;
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update CP_YDang Set TPFlag=1 where CYID=''' + Trim(CYID) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
AJpeg.Free;
|
||||
except
|
||||
AJpeg.Free;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('图片上传失败!', '提示', 0);
|
||||
end;
|
||||
if IdFTP1.Connected then
|
||||
IdFTP1.Quit;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||
open;
|
||||
end;
|
||||
Panel16.Visible := False;
|
||||
if i > 0 then
|
||||
Application.MessageBox(PChar(inttostr(i) + '个文件上传成功!'), '提示', 0);
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp2.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 TfrmFileUp2.SaveImageOther(FTFID: string);
|
||||
var
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
ImgMaxNo: string;
|
||||
i, j: Integer;
|
||||
PatFile: string;
|
||||
FConNo, MaxNo: string;
|
||||
begin
|
||||
if Image2.Picture = nil then
|
||||
Exit;
|
||||
AJpeg := TJpegImage.Create();
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File where TFID=''' + Trim(FTFID) + '''');
|
||||
open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FTFID) = '' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value := Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value := Trim(DName);
|
||||
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('TFID').Value := Trim(FTFID);
|
||||
FieldByName('WBID').Value := Trim(CYID);
|
||||
FieldByName('TFType').Value := '样品';
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
AJpeg.SaveToStream(myStream);
|
||||
myStream.Free;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp2.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp2.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||
SQL.Add(' Delete TP_File where TFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||
SQL.Add(' and FileType=''YP''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryFile.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update CP_YDang Set TPFlag=0 where CYID=''' + Trim(CYID) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp2.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.
|
||||
|
||||
188
云翔OA(WTOA.dll)/U_FileUp3.dfm
Normal file
188
云翔OA(WTOA.dll)/U_FileUp3.dfm
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
object frmFileUp3: TfrmFileUp3
|
||||
Left = 247
|
||||
Top = 162
|
||||
Width = 660
|
||||
Height = 441
|
||||
Caption = #19978#20256#25991#20214
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 41
|
||||
Width = 581
|
||||
Height = 361
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
object FileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 121
|
||||
end
|
||||
object FileDate: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #19978#20256#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 104
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 190
|
||||
Top = 126
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 581
|
||||
Top = 41
|
||||
Width = 63
|
||||
Height = 361
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object FileUp: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 48
|
||||
Wrap = True
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 0
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
Wrap = True
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 644
|
||||
Height = 41
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Top = 14
|
||||
Width = 72
|
||||
Height = 17
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -17
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Image2: TImage
|
||||
Left = 445
|
||||
Top = 9
|
||||
Width = 60
|
||||
Height = 28
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 78
|
||||
Top = 9
|
||||
Width = 211
|
||||
Height = 25
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -17
|
||||
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_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
end
|
||||
349
云翔OA(WTOA.dll)/U_FileUp3.pas
Normal file
349
云翔OA(WTOA.dll)/U_FileUp3.pas
Normal file
|
|
@ -0,0 +1,349 @@
|
|||
unit U_FileUp3;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ComCtrls, ToolWin, ExtCtrls, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP, StdCtrls, ADODB, jpeg, BtnEdit, IniFiles,
|
||||
strutils, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
||||
|
||||
type
|
||||
TfrmFileUp3 = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
FileName: TcxGridDBColumn;
|
||||
FileDate: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel16: TPanel;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
Image2: TImage;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
procedure CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer);
|
||||
procedure SaveImageOther(FTFID: string);
|
||||
procedure ReadINIFile10();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp3: TfrmFileUp3;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp3.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 TfrmFileUp3.FileUpClick(Sender: TObject);
|
||||
var
|
||||
i, j: Integer;
|
||||
PatFile: string;
|
||||
FTPPath, FConNo, MaxNo: string;
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
begin
|
||||
if Trim(Code.Text) = '' then
|
||||
begin
|
||||
Application.MessageBox('编号不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
lstPat.Clear;
|
||||
if ODPat.Execute then
|
||||
begin
|
||||
lstPat.AddStrings(ODPat.Files);
|
||||
end;
|
||||
if lstPat.Count > 0 then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host := PicSvr; //PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Panel16.Visible := True;
|
||||
Panel16.Refresh;
|
||||
|
||||
try
|
||||
AJpeg := TJpegImage.Create();
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select isnull(max(abs(cast(right(left(FileName,charindex(''.'',FileName)-1),2) as int))),0)+1 as BH from XD_File');
|
||||
sql.Add('where CYID=''' + trim(CYID) + ''' ');
|
||||
open;
|
||||
end;
|
||||
PatFile := trim(Code.Text) + '-' + inttostr(ADOQueryTemp.fieldbyname('BH').AsInteger) + '.' + Copy(ExtractFileName(lstPat[i]), (Pos('.', ExtractFileName(lstPat[i])) + 1), (Length(ExtractFileName(lstPat[i])) - Pos('.', ExtractFileName(lstPat[i]))));
|
||||
|
||||
AJpeg.LoadFromFile(ExtractFileName(lstPat[i]));
|
||||
CreThumb(AJpeg, Image2, 6400, 4800);
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Put(lstPat[i], Trim(UserDataFlag + 'YP') + '\' + Trim(PatFile));
|
||||
|
||||
if GetLSNo(ADOQueryCmd, MaxNo, 'YP', 'XD_File', 4, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取图片最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value := Trim(MaxNo);
|
||||
FieldByName('CYID').Value := Trim(CYID);
|
||||
FieldByName('CYNO').Value := Trim(Code.Text);
|
||||
FieldByName('filename').Value := Trim(PatFile);
|
||||
FieldByName('FileDate').Value := SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value := Trim('ZM');
|
||||
Post;
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File where TFID=''' + Trim(MaxNo) + '''');
|
||||
open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value := Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value := Trim(DName);
|
||||
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('TFID').Value := Trim(MaxNo);
|
||||
FieldByName('WBID').Value := Trim(CYID);
|
||||
FieldByName('TFType').Value := '样品';
|
||||
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
AJpeg.SaveToStream(myStream);
|
||||
myStream.Free;
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// with ADOQueryCmd do
|
||||
// begin
|
||||
// Close;
|
||||
// sql.Clear;
|
||||
// sql.Add('Update CP_YDang Set TPFlag=1 where CYID=''' + Trim(CYID) + '''');
|
||||
// ExecSQL;
|
||||
// end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
AJpeg.Free;
|
||||
except
|
||||
AJpeg.Free;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('图片上传失败!', '提示', 0);
|
||||
end;
|
||||
if IdFTP1.Connected then
|
||||
IdFTP1.Quit;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where FileType =''ZM'' and CYID=''' + Trim(CYID) + '''');
|
||||
open;
|
||||
end;
|
||||
Panel16.Visible := False;
|
||||
if i > 0 then
|
||||
Application.MessageBox(PChar(inttostr(i) + '个文件上传成功!'), '提示', 0);
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp3.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 TfrmFileUp3.SaveImageOther(FTFID: string);
|
||||
var
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
ImgMaxNo: string;
|
||||
i, j: Integer;
|
||||
PatFile: string;
|
||||
FConNo, MaxNo: string;
|
||||
begin
|
||||
if Image2.Picture = nil then
|
||||
Exit;
|
||||
AJpeg := TJpegImage.Create();
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File where TFID=''' + Trim(FTFID) + '''');
|
||||
open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FTFID) = '' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value := Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value := Trim(DName);
|
||||
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('TFID').Value := Trim(FTFID);
|
||||
FieldByName('WBID').Value := Trim(CYID);
|
||||
FieldByName('TFType').Value := '样品';
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
AJpeg.SaveToStream(myStream);
|
||||
myStream.Free;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp3.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp3.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||
SQL.Add(' Delete TP_File where TFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||
SQL.Add(' and FileType=''ZM''');
|
||||
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 TfrmFileUp3.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=''ZM''');
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
188
云翔OA(WTOA.dll)/U_FileUp4.dfm
Normal file
188
云翔OA(WTOA.dll)/U_FileUp4.dfm
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
object frmFileUp4: TfrmFileUp4
|
||||
Left = 247
|
||||
Top = 162
|
||||
Width = 660
|
||||
Height = 441
|
||||
Caption = #19978#20256#25991#20214
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 41
|
||||
Width = 581
|
||||
Height = 361
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
object FileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 121
|
||||
end
|
||||
object FileDate: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #19978#20256#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 104
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 190
|
||||
Top = 126
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 581
|
||||
Top = 41
|
||||
Width = 63
|
||||
Height = 361
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object FileUp: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 48
|
||||
Wrap = True
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 0
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
Wrap = True
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 644
|
||||
Height = 41
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
object Label1: TLabel
|
||||
Left = 8
|
||||
Top = 14
|
||||
Width = 72
|
||||
Height = 17
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -17
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Image2: TImage
|
||||
Left = 445
|
||||
Top = 9
|
||||
Width = 60
|
||||
Height = 28
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 78
|
||||
Top = 9
|
||||
Width = 211
|
||||
Height = 25
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -17
|
||||
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_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
end
|
||||
349
云翔OA(WTOA.dll)/U_FileUp4.pas
Normal file
349
云翔OA(WTOA.dll)/U_FileUp4.pas
Normal file
|
|
@ -0,0 +1,349 @@
|
|||
unit U_FileUp4;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ComCtrls, ToolWin, ExtCtrls, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP, StdCtrls, ADODB, jpeg, BtnEdit, IniFiles,
|
||||
strutils, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
||||
|
||||
type
|
||||
TfrmFileUp4 = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
FileName: TcxGridDBColumn;
|
||||
FileDate: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel16: TPanel;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
Image2: TImage;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
procedure CreThumb(AJPeg: TJPEGImage; Image1: TImage; Width, Height: Integer);
|
||||
procedure SaveImageOther(FTFID: string);
|
||||
procedure ReadINIFile10();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp4: TfrmFileUp4;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp4.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 TfrmFileUp4.FileUpClick(Sender: TObject);
|
||||
var
|
||||
i, j: Integer;
|
||||
PatFile: string;
|
||||
FTPPath, FConNo, MaxNo: string;
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
begin
|
||||
if Trim(Code.Text) = '' then
|
||||
begin
|
||||
Application.MessageBox('编号不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
lstPat.Clear;
|
||||
if ODPat.Execute then
|
||||
begin
|
||||
lstPat.AddStrings(ODPat.Files);
|
||||
end;
|
||||
if lstPat.Count > 0 then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host := PicSvr; //PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
Panel16.Visible := True;
|
||||
Panel16.Refresh;
|
||||
|
||||
try
|
||||
AJpeg := TJpegImage.Create();
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select isnull(max(abs(cast(right(left(FileName,charindex(''.'',FileName)-1),2) as int))),0)+1 as BH from XD_File');
|
||||
sql.Add('where CYID=''' + trim(CYID) + ''' ');
|
||||
open;
|
||||
end;
|
||||
PatFile := trim(Code.Text) + '-' + inttostr(ADOQueryTemp.fieldbyname('BH').AsInteger) + '.' + Copy(ExtractFileName(lstPat[i]), (Pos('.', ExtractFileName(lstPat[i])) + 1), (Length(ExtractFileName(lstPat[i])) - Pos('.', ExtractFileName(lstPat[i]))));
|
||||
|
||||
AJpeg.LoadFromFile(ExtractFileName(lstPat[i]));
|
||||
CreThumb(AJpeg, Image2, 6400, 4800);
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Put(lstPat[i], Trim(UserDataFlag + 'YP') + '\' + Trim(PatFile));
|
||||
|
||||
if GetLSNo(ADOQueryCmd, MaxNo, 'YP', 'XD_File', 4, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取图片最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value := Trim(MaxNo);
|
||||
FieldByName('CYID').Value := Trim(CYID);
|
||||
FieldByName('CYNO').Value := Trim(Code.Text);
|
||||
FieldByName('filename').Value := Trim(PatFile);
|
||||
FieldByName('FileDate').Value := SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value := Trim('FM');
|
||||
Post;
|
||||
end;
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File where TFID=''' + Trim(MaxNo) + '''');
|
||||
open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if ADOQueryCmd.IsEmpty then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value := Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value := Trim(DName);
|
||||
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('TFID').Value := Trim(MaxNo);
|
||||
FieldByName('WBID').Value := Trim(CYID);
|
||||
FieldByName('TFType').Value := '样品';
|
||||
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
AJpeg.SaveToStream(myStream);
|
||||
myStream.Free;
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// with ADOQueryCmd do
|
||||
// begin
|
||||
// Close;
|
||||
// sql.Clear;
|
||||
// sql.Add('Update CP_YDang Set TPFlag=1 where CYID=''' + Trim(CYID) + '''');
|
||||
// ExecSQL;
|
||||
// end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
AJpeg.Free;
|
||||
except
|
||||
AJpeg.Free;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('图片上传失败!', '提示', 0);
|
||||
end;
|
||||
if IdFTP1.Connected then
|
||||
IdFTP1.Quit;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where FileType =''FM'' and CYID=''' + Trim(CYID) + '''');
|
||||
open;
|
||||
end;
|
||||
Panel16.Visible := False;
|
||||
if i > 0 then
|
||||
Application.MessageBox(PChar(inttostr(i) + '个文件上传成功!'), '提示', 0);
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp4.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 TfrmFileUp4.SaveImageOther(FTFID: string);
|
||||
var
|
||||
AJpeg: TJPEGImage;
|
||||
myStream: TADOBlobStream;
|
||||
ImgMaxNo: string;
|
||||
i, j: Integer;
|
||||
PatFile: string;
|
||||
FConNo, MaxNo: string;
|
||||
begin
|
||||
if Image2.Picture = nil then
|
||||
Exit;
|
||||
AJpeg := TJpegImage.Create();
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select * from TP_File where TFID=''' + Trim(FTFID) + '''');
|
||||
open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if Trim(FTFID) = '' then
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Filler').Value := Trim(DName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Editer').Value := Trim(DName);
|
||||
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||
end;
|
||||
FieldByName('TFID').Value := Trim(FTFID);
|
||||
FieldByName('WBID').Value := Trim(CYID);
|
||||
FieldByName('TFType').Value := '样品';
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('FilesOther')), bmWrite);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
AJpeg.SaveToStream(myStream);
|
||||
myStream.Free;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp4.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp4.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||
SQL.Add(' Delete TP_File where TFID=''' + Trim(ADOQueryFile.fieldbyname('XFID').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID=''' + Trim(CYID) + '''');
|
||||
SQL.Add(' and FileType=''FM''');
|
||||
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 TfrmFileUp4.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=''FM''');
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
502
云翔OA(WTOA.dll)/U_FileUp_GRWJ.dfm
Normal file
502
云翔OA(WTOA.dll)/U_FileUp_GRWJ.dfm
Normal file
|
|
@ -0,0 +1,502 @@
|
|||
object frmFileUp_GRWJ: TfrmFileUp_GRWJ
|
||||
Left = 189
|
||||
Top = 129
|
||||
Width = 1062
|
||||
Height = 591
|
||||
Caption = #20010#20154#25991#20214#24402#26723#19978#20256
|
||||
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 cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 97
|
||||
Width = 1046
|
||||
Height = 456
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = V7FileDate
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle1
|
||||
object V7FileDate: TcxGridDBColumn
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 121
|
||||
end
|
||||
object vFileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 317
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1046
|
||||
Height = 33
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 320
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 390
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1042
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object FileUp: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 18
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDown: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = FileDownClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 1046
|
||||
Height = 64
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label4: TLabel
|
||||
Left = 199
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #25991#20214#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 34
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object FileName: TEdit
|
||||
Tag = 2
|
||||
Left = 251
|
||||
Top = 11
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 324
|
||||
Top = 119
|
||||
Width = 245
|
||||
Height = 174
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object Label6: TLabel
|
||||
Left = 48
|
||||
Top = 96
|
||||
Width = 6
|
||||
Height = 12
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 35
|
||||
Top = 52
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 36
|
||||
Top = 91
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #22270#29255#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 23
|
||||
Top = 187
|
||||
Width = 68
|
||||
Height = 15
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 243
|
||||
Height = 23
|
||||
Align = alTop
|
||||
Alignment = taLeftJustify
|
||||
BevelOuter = bvNone
|
||||
Caption = #20844#21496#25991#20214#26723#26696#20449#24687
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object Image1: TImage
|
||||
Left = 221
|
||||
Top = 3
|
||||
Width = 22
|
||||
Height = 16
|
||||
ParentShowHint = False
|
||||
Picture.Data = {
|
||||
07544269746D617076040000424D760400000000000036000000280000001500
|
||||
0000110000000100180000000000400400000000000000000000000000000000
|
||||
0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFF0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6
|
||||
F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFF404040404040404040404040404040404040404040404040
|
||||
404040404040404040404040404040404040404040404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFF808080808080808080808080808080808080808080
|
||||
808080808080808080808080808080808080808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000
|
||||
000000C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00}
|
||||
ShowHint = True
|
||||
Transparent = True
|
||||
OnClick = Image1Click
|
||||
end
|
||||
end
|
||||
object TSure: TButton
|
||||
Left = 85
|
||||
Top = 122
|
||||
Width = 85
|
||||
Height = 29
|
||||
Caption = #19978' '#20256
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = TSureClick
|
||||
end
|
||||
object ETaiTou: TEdit
|
||||
Left = 72
|
||||
Top = 288
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
end
|
||||
object FileDate: TDateTimePicker
|
||||
Left = 104
|
||||
Top = 49
|
||||
Width = 110
|
||||
Height = 20
|
||||
Date = 42466.625210844900000000
|
||||
Time = 42466.625210844900000000
|
||||
TabOrder = 3
|
||||
end
|
||||
object FCYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 91
|
||||
Top = 184
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object FYWYName: TBtnEditA
|
||||
Left = 104
|
||||
Top = 88
|
||||
Width = 109
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnBtnClick = FYWYNameBtnClick
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19979#36733#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 604
|
||||
Top = 173
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 601
|
||||
Top = 212
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 597
|
||||
Top = 257
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 640
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_SC
|
||||
Left = 336
|
||||
Top = 332
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 568
|
||||
Top = 312
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid7
|
||||
PopupMenus = <>
|
||||
Left = 256
|
||||
Top = 240
|
||||
end
|
||||
object CDS_SC: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 372
|
||||
Top = 316
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clRed
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 508
|
||||
Top = 348
|
||||
end
|
||||
object ADOQuery2: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 428
|
||||
Top = 316
|
||||
end
|
||||
end
|
||||
378
云翔OA(WTOA.dll)/U_FileUp_GRWJ.pas
Normal file
378
云翔OA(WTOA.dll)/U_FileUp_GRWJ.pas
Normal file
|
|
@ -0,0 +1,378 @@
|
|||
unit U_FileUp_GRWJ;
|
||||
|
||||
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, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI,
|
||||
cxCalendar, cxCheckBox;
|
||||
|
||||
type
|
||||
TfrmFileUp_GRWJ = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
vFileName: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
CDS_SC: TClientDataSet;
|
||||
FileDown: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label4: TLabel;
|
||||
FileName: TEdit;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ToolButton3: TToolButton;
|
||||
V7FileDate: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Panel4: TPanel;
|
||||
Label6: TLabel;
|
||||
Label5: TLabel;
|
||||
Panel5: TPanel;
|
||||
Image1: TImage;
|
||||
TSure: TButton;
|
||||
ETaiTou: TEdit;
|
||||
FileDate: TDateTimePicker;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
FCYNO: TEdit;
|
||||
Panel2: TPanel;
|
||||
Panel16: TPanel;
|
||||
cxStyle2: TcxStyle;
|
||||
FYWYName: TBtnEditA;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FileDownClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FileNameChange(Sender: TObject);
|
||||
procedure Image1Click(Sender: TObject);
|
||||
procedure TSureClick(Sender: TObject);
|
||||
procedure FYWYNameBtnClick(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
Canshu1,FDEPT,FDPName:string;
|
||||
procedure ReadINIFile10();
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp_GRWJ: TfrmFileUp_GRWJ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp_GRWJ.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_GRWJ.FileUpClick(Sender: TObject);
|
||||
begin
|
||||
fileDate.DateTime:=SGetServerDate(ADOQuery2);
|
||||
TSure.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
canShu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除文件吗?','提示',32+4)<>IDYES then Exit;
|
||||
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
||||
begin
|
||||
application.MessageBox('不能删除他人文件','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FormShow(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('归档',TV7,'文件上传');
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=EndDate.Date-7;
|
||||
InitGrid();
|
||||
if Trim(canShu1)='查询' then
|
||||
begin
|
||||
FileUp.Visible:=False;
|
||||
FileDel.Visible:=False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FileUp.Visible:=True;
|
||||
FileDel.Visible:=True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.InitGrid();
|
||||
begin
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.add('select * ');
|
||||
sql.add(' from XD_File where ');
|
||||
sql.Add(' FileType=''GD'' ');
|
||||
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
sql.add(' and CYID=''个人归档'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFileUp_GRWJ:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FPath:String;
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('归档',TV7,'文件上传');
|
||||
FPath:='D:\Right1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FileDownClick(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
{ }
|
||||
try
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'GD1310280002' then
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
||||
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('GD\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
||||
);
|
||||
end;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
end else
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
||||
if FileExists(FPath+FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('GD\'+FFName,FPath+FFName);
|
||||
end;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
if FileExists(FPath+FFName) then
|
||||
begin
|
||||
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FileNameChange(Sender: TObject);
|
||||
begin
|
||||
toolButton3.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.Image1Click(Sender: TObject);
|
||||
begin
|
||||
Panel4.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.TSureClick(Sender: TObject);
|
||||
var
|
||||
i,j: Integer;
|
||||
PatFile,HZStr: String;
|
||||
FTPPath,FConNo,MaxNo:string;
|
||||
begin
|
||||
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 else
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'GD','XD_File',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取文件最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
IdFTP1.Put(lstPat[i], Trim('\GD')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1=2');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value:=Trim(MaxNo);
|
||||
FieldByName('CYID').Value:='个人归档';
|
||||
FieldByName('CYNO').Value:=Trim(FDPName);
|
||||
FieldByName('filename').Value:=Trim(PatFile);
|
||||
FieldByName('FileDate').Value:=fileDate.DateTime;
|
||||
FieldByName('Filltime').Value:=SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value:=Trim('GD');
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
FieldByName('YWYName').Value:=Trim(FYWYName.Text);
|
||||
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
Panel16.Visible:=False;
|
||||
Panel4.Visible:=False;
|
||||
InitGrid();
|
||||
Application.MessageBox('上传成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GRWJ.FYWYNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='FYWYName';
|
||||
flagname:='图片类型';
|
||||
if showModal=1 then
|
||||
begin
|
||||
FYWYName.Text:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
538
云翔OA(WTOA.dll)/U_FileUp_GSCW.dfm
Normal file
538
云翔OA(WTOA.dll)/U_FileUp_GSCW.dfm
Normal file
|
|
@ -0,0 +1,538 @@
|
|||
object frmFileUp_GSCW: TfrmFileUp_GSCW
|
||||
Left = 189
|
||||
Top = 129
|
||||
Width = 1062
|
||||
Height = 591
|
||||
Caption = #20844#21496#22270#26696#36164#26009#24211
|
||||
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 cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 97
|
||||
Width = 1046
|
||||
Height = 456
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = V7FileDate
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle1
|
||||
object V7Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 59
|
||||
end
|
||||
object V7FileDate: TcxGridDBColumn
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 108
|
||||
end
|
||||
object V7YWYName: TcxGridDBColumn
|
||||
Caption = #22270#29255#31867#22411
|
||||
DataBinding.FieldName = 'YWYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 100
|
||||
end
|
||||
object vFileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 176
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1046
|
||||
Height = 33
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 320
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 390
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1042
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object FileUp: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 18
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDown: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = FileDownClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 1046
|
||||
Height = 64
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label4: TLabel
|
||||
Left = 199
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #25991#20214#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 34
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 199
|
||||
Top = 39
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #22270#29255#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object FileName: TEdit
|
||||
Tag = 2
|
||||
Left = 251
|
||||
Top = 11
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 2
|
||||
end
|
||||
object YWYName: TEdit
|
||||
Tag = 2
|
||||
Left = 251
|
||||
Top = 35
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 324
|
||||
Top = 119
|
||||
Width = 245
|
||||
Height = 174
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object Label6: TLabel
|
||||
Left = 48
|
||||
Top = 96
|
||||
Width = 6
|
||||
Height = 12
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 35
|
||||
Top = 52
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 36
|
||||
Top = 91
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #22270#29255#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 23
|
||||
Top = 187
|
||||
Width = 68
|
||||
Height = 15
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 243
|
||||
Height = 23
|
||||
Align = alTop
|
||||
Alignment = taLeftJustify
|
||||
BevelOuter = bvNone
|
||||
Caption = #20844#21496#25991#20214#26723#26696#20449#24687
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object Image1: TImage
|
||||
Left = 221
|
||||
Top = 3
|
||||
Width = 22
|
||||
Height = 16
|
||||
ParentShowHint = False
|
||||
Picture.Data = {
|
||||
07544269746D617076040000424D760400000000000036000000280000001500
|
||||
0000110000000100180000000000400400000000000000000000000000000000
|
||||
0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFF0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6
|
||||
F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFF404040404040404040404040404040404040404040404040
|
||||
404040404040404040404040404040404040404040404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFF808080808080808080808080808080808080808080
|
||||
808080808080808080808080808080808080808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000
|
||||
000000C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00}
|
||||
ShowHint = True
|
||||
Transparent = True
|
||||
OnClick = Image1Click
|
||||
end
|
||||
end
|
||||
object TSure: TButton
|
||||
Left = 85
|
||||
Top = 122
|
||||
Width = 85
|
||||
Height = 29
|
||||
Caption = #19978' '#20256
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = TSureClick
|
||||
end
|
||||
object ETaiTou: TEdit
|
||||
Left = 72
|
||||
Top = 288
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
end
|
||||
object FileDate: TDateTimePicker
|
||||
Left = 104
|
||||
Top = 49
|
||||
Width = 110
|
||||
Height = 20
|
||||
Date = 42466.625210844900000000
|
||||
Time = 42466.625210844900000000
|
||||
TabOrder = 3
|
||||
end
|
||||
object FCYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 91
|
||||
Top = 184
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object FYWYName: TBtnEditA
|
||||
Left = 104
|
||||
Top = 88
|
||||
Width = 109
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnBtnClick = FYWYNameBtnClick
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19979#36733#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 604
|
||||
Top = 173
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 601
|
||||
Top = 212
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 597
|
||||
Top = 257
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 640
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_SC
|
||||
Left = 336
|
||||
Top = 332
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 568
|
||||
Top = 312
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid7
|
||||
PopupMenus = <>
|
||||
Left = 256
|
||||
Top = 240
|
||||
end
|
||||
object CDS_SC: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 372
|
||||
Top = 316
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clRed
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 508
|
||||
Top = 348
|
||||
end
|
||||
object ADOQuery2: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 428
|
||||
Top = 316
|
||||
end
|
||||
end
|
||||
398
云翔OA(WTOA.dll)/U_FileUp_GSCW.pas
Normal file
398
云翔OA(WTOA.dll)/U_FileUp_GSCW.pas
Normal file
|
|
@ -0,0 +1,398 @@
|
|||
unit U_FileUp_GSCW;
|
||||
|
||||
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, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI,
|
||||
cxCalendar, cxCheckBox;
|
||||
|
||||
type
|
||||
TfrmFileUp_GSCW = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
vFileName: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
CDS_SC: TClientDataSet;
|
||||
FileDown: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label4: TLabel;
|
||||
FileName: TEdit;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ToolButton3: TToolButton;
|
||||
V7FileDate: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Panel4: TPanel;
|
||||
Label6: TLabel;
|
||||
Label5: TLabel;
|
||||
Panel5: TPanel;
|
||||
Image1: TImage;
|
||||
TSure: TButton;
|
||||
ETaiTou: TEdit;
|
||||
FileDate: TDateTimePicker;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
FCYNO: TEdit;
|
||||
Panel2: TPanel;
|
||||
Panel16: TPanel;
|
||||
cxStyle2: TcxStyle;
|
||||
V7YWYName: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
YWYName: TEdit;
|
||||
FYWYName: TBtnEditA;
|
||||
V7Ssel: TcxGridDBColumn;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FileDownClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FileNameChange(Sender: TObject);
|
||||
procedure Image1Click(Sender: TObject);
|
||||
procedure TSureClick(Sender: TObject);
|
||||
procedure FYWYNameBtnClick(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
Canshu1,FDEPT,FDPName:string;
|
||||
procedure ReadINIFile10();
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp_GSCW: TfrmFileUp_GSCW;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp_GSCW.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_GSCW.FileUpClick(Sender: TObject);
|
||||
begin
|
||||
fileDate.DateTime:=SGetServerDate(ADOQuery2);
|
||||
Panel4.Visible:=true;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
canShu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
if CDS_SC.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要删除文件吗?','提示',32+4)<>IDYES then Exit;
|
||||
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
||||
begin
|
||||
application.MessageBox('不能删除他人文件','提示');
|
||||
exit;
|
||||
end;
|
||||
with CDS_SC do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').Asboolean=true then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FormShow(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('正排表',TV7,'文件上传');
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=EndDate.Date-7;
|
||||
InitGrid();
|
||||
if Trim(canShu1)='查询' then
|
||||
begin
|
||||
FileUp.Visible:=False;
|
||||
FileDel.Visible:=False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FileUp.Visible:=True;
|
||||
FileDel.Visible:=True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.InitGrid();
|
||||
begin
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.add('select * ');
|
||||
sql.add(' from XD_File where ');
|
||||
sql.Add(' FileType=''SC'' ');
|
||||
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
sql.add(' and CYID=''公司图片文件'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFileUp_GSCW:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FPath:String;
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('正排表',TV7,'文件上传');
|
||||
FPath:='D:\Right1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FileDownClick(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
{ }
|
||||
try
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'TP1310280002' then
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
||||
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
||||
);
|
||||
end;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
end else
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
||||
if FileExists(FPath+FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+FFName,FPath+FFName);
|
||||
end;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
if FileExists(FPath+FFName) then
|
||||
begin
|
||||
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FileNameChange(Sender: TObject);
|
||||
begin
|
||||
toolButton3.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.Image1Click(Sender: TObject);
|
||||
begin
|
||||
Panel4.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.TSureClick(Sender: TObject);
|
||||
var
|
||||
i,j: Integer;
|
||||
PatFile,HZStr: String;
|
||||
FTPPath,FConNo,MaxNo:string;
|
||||
begin
|
||||
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 else
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'TP','XD_File',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取文件最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
IdFTP1.Put(lstPat[i], Trim('\SC')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1=2');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value:=Trim(MaxNo);
|
||||
FieldByName('CYID').Value:='公司图片文件';
|
||||
FieldByName('CYNO').Value:=Trim(FDPName);
|
||||
FieldByName('filename').Value:=Trim(PatFile);
|
||||
FieldByName('FileDate').Value:=fileDate.DateTime;
|
||||
FieldByName('Filltime').Value:=SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value:=Trim('SC');
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
FieldByName('YWYName').Value:=Trim(FYWYName.Text);
|
||||
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
Panel16.Visible:=False;
|
||||
Panel4.Visible:=False;
|
||||
InitGrid();
|
||||
Application.MessageBox('上传成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSCW.FYWYNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='FYWYName';
|
||||
flagname:='图片类型';
|
||||
if showModal=1 then
|
||||
begin
|
||||
FYWYName.Text:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
534
云翔OA(WTOA.dll)/U_FileUp_GSHY.dfm
Normal file
534
云翔OA(WTOA.dll)/U_FileUp_GSHY.dfm
Normal file
|
|
@ -0,0 +1,534 @@
|
|||
object frmFileUp_GSHY: TfrmFileUp_GSHY
|
||||
Left = 234
|
||||
Top = 127
|
||||
Width = 1036
|
||||
Height = 592
|
||||
Caption = #20844#21496#25991#20214#28023#36816#36153#26356#26032
|
||||
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 cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 97
|
||||
Width = 1020
|
||||
Height = 457
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = V7FileDate
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle1
|
||||
object V7Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 56
|
||||
end
|
||||
object V7FileDate: TcxGridDBColumn
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 93
|
||||
end
|
||||
object vFileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 301
|
||||
end
|
||||
object V7chkStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'chkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 86
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1020
|
||||
Height = 33
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 320
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 390
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1016
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object FileUp: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 18
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDown: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = FileDownClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
object TTJ: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25552#20132
|
||||
ImageIndex = 75
|
||||
OnClick = TTJClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 1020
|
||||
Height = 64
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label4: TLabel
|
||||
Left = 199
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #25991#20214#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 34
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object FileName: TEdit
|
||||
Tag = 2
|
||||
Left = 255
|
||||
Top = 11
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 324
|
||||
Top = 119
|
||||
Width = 245
|
||||
Height = 174
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object Label6: TLabel
|
||||
Left = 48
|
||||
Top = 96
|
||||
Width = 6
|
||||
Height = 12
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 35
|
||||
Top = 52
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 35
|
||||
Top = 91
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #30003#25253#25968#25454
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 23
|
||||
Top = 187
|
||||
Width = 68
|
||||
Height = 15
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 243
|
||||
Height = 23
|
||||
Align = alTop
|
||||
Alignment = taLeftJustify
|
||||
BevelOuter = bvNone
|
||||
Caption = #20844#21496#25991#20214#26723#26696#20449#24687
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object Image1: TImage
|
||||
Left = 221
|
||||
Top = 3
|
||||
Width = 22
|
||||
Height = 16
|
||||
ParentShowHint = False
|
||||
Picture.Data = {
|
||||
07544269746D617076040000424D760400000000000036000000280000001500
|
||||
0000110000000100180000000000400400000000000000000000000000000000
|
||||
0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFF0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6
|
||||
F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFF404040404040404040404040404040404040404040404040
|
||||
404040404040404040404040404040404040404040404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFF808080808080808080808080808080808080808080
|
||||
808080808080808080808080808080808080808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000
|
||||
000000C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00}
|
||||
ShowHint = True
|
||||
Transparent = True
|
||||
OnClick = Image1Click
|
||||
end
|
||||
end
|
||||
object TSure: TButton
|
||||
Left = 85
|
||||
Top = 122
|
||||
Width = 85
|
||||
Height = 29
|
||||
Caption = #19978' '#20256
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = TSureClick
|
||||
end
|
||||
object ETaiTou: TEdit
|
||||
Left = 72
|
||||
Top = 288
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
end
|
||||
object FileDate: TDateTimePicker
|
||||
Left = 104
|
||||
Top = 49
|
||||
Width = 110
|
||||
Height = 20
|
||||
Date = 42466.625210844900000000
|
||||
Time = 42466.625210844900000000
|
||||
TabOrder = 3
|
||||
end
|
||||
object FCYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 91
|
||||
Top = 184
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object SBQty: TEdit
|
||||
Left = 104
|
||||
Top = 88
|
||||
Width = 109
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19979#36733#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 604
|
||||
Top = 173
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 601
|
||||
Top = 204
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 597
|
||||
Top = 257
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 640
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_SC
|
||||
Left = 336
|
||||
Top = 332
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 568
|
||||
Top = 312
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid7
|
||||
PopupMenus = <>
|
||||
Left = 256
|
||||
Top = 240
|
||||
end
|
||||
object CDS_SC: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 372
|
||||
Top = 316
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clRed
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 508
|
||||
Top = 348
|
||||
end
|
||||
object ADOQuery2: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 428
|
||||
Top = 316
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 292
|
||||
Top = 304
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
484
云翔OA(WTOA.dll)/U_FileUp_GSHY.pas
Normal file
484
云翔OA(WTOA.dll)/U_FileUp_GSHY.pas
Normal file
|
|
@ -0,0 +1,484 @@
|
|||
unit U_FileUp_GSHY;
|
||||
|
||||
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, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI,
|
||||
cxCalendar, cxCheckBox, Menus;
|
||||
|
||||
type
|
||||
TfrmFileUp_GSHY = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
vFileName: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
CDS_SC: TClientDataSet;
|
||||
FileDown: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label4: TLabel;
|
||||
FileName: TEdit;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ToolButton3: TToolButton;
|
||||
V7FileDate: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Panel4: TPanel;
|
||||
Label6: TLabel;
|
||||
Label5: TLabel;
|
||||
Panel5: TPanel;
|
||||
Image1: TImage;
|
||||
TSure: TButton;
|
||||
ETaiTou: TEdit;
|
||||
FileDate: TDateTimePicker;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
FCYNO: TEdit;
|
||||
Panel2: TPanel;
|
||||
Panel16: TPanel;
|
||||
SBQty: TEdit;
|
||||
cxStyle2: TcxStyle;
|
||||
V7chkStatus: TcxGridDBColumn;
|
||||
TTJ: TToolButton;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
V7Ssel: TcxGridDBColumn;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FileDownClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FileNameChange(Sender: TObject);
|
||||
procedure Image1Click(Sender: TObject);
|
||||
procedure TSureClick(Sender: TObject);
|
||||
procedure TTJClick(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
Canshu1,FDEPT,FDPName:string;
|
||||
procedure ReadINIFile10();
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp_GSHY: TfrmFileUp_GSHY;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun, U_ZDYHelp, U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp_GSHY.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_GSHY.FileUpClick(Sender: TObject);
|
||||
begin
|
||||
//Panel4.Visible:=True;
|
||||
fileDate.DateTime:=SGetServerDate(ADOQuery2);
|
||||
TSure.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
canShu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
if CDS_SC.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要删除文件吗?','提示',32+4)<>IDYES then Exit;
|
||||
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
||||
begin
|
||||
application.MessageBox('不能删除他人文件','提示');
|
||||
exit;
|
||||
end;
|
||||
with CDS_SC do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').Asboolean=true then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete OA_Chk where Mainid='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FormShow(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('正排表',TV7,'文件上传');
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=EndDate.Date-7;
|
||||
InitGrid();
|
||||
if Trim(canShu1)='查询' then
|
||||
begin
|
||||
FileUp.Visible:=False;
|
||||
FileDel.Visible:=False;
|
||||
TTJ.Visible:=False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FileUp.Visible:=True;
|
||||
FileDel.Visible:=True;
|
||||
TTJ.Visible:=True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.InitGrid();
|
||||
begin
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.add('select *, ');
|
||||
sql.add(' chkStatus=(case when isnull((select Chkstatus from OA_Chk where Mainid=XFID),'''')='''' then ''未提交'' else ''已提交'' end)');
|
||||
sql.add(' from XD_File where ');
|
||||
sql.Add(' FileType=''SC'' ');
|
||||
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
sql.add(' and CYID=''公司海运费''');
|
||||
sql.add(' order by FileDate desc');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFileUp_GSHY:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FPath:String;
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('正排表',TV7,'文件上传');
|
||||
FPath:='D:\Right1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FileDownClick(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
Panel2.Visible:=True;
|
||||
Panel2.Refresh;
|
||||
{ }
|
||||
try
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'HY1310280009' then
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
||||
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
||||
);
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
end else
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
||||
if FileExists(FPath+FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+FFName,FPath+FFName);
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
if FileExists(FPath+FFName) then
|
||||
begin
|
||||
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.FileNameChange(Sender: TObject);
|
||||
begin
|
||||
toolButton3.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.Image1Click(Sender: TObject);
|
||||
begin
|
||||
Panel4.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.TSureClick(Sender: TObject);
|
||||
var
|
||||
i,j: Integer;
|
||||
PatFile,HZStr: String;
|
||||
FTPPath,FConNo,MaxNo:string;
|
||||
begin
|
||||
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 else
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'HY','XD_File',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取文件最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
IdFTP1.Put(lstPat[i], Trim('\SC')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1=2');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value:=Trim(MaxNo);
|
||||
FieldByName('CYID').Value:='公司海运费';
|
||||
FieldByName('CYNO').Value:=Trim(FDPName);
|
||||
FieldByName('filename').Value:=Trim(PatFile);
|
||||
FieldByName('FileDate').Value:=SGetServerDate(ADOQueryTemp);
|
||||
FieldByName('Filltime').Value:=SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value:=Trim('SC');
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
Panel16.Visible:=False;
|
||||
Panel4.Visible:=False;
|
||||
InitGrid();
|
||||
Application.MessageBox('上传成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.TTJClick(Sender: TObject);
|
||||
var maxno: string;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then exit;
|
||||
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
||||
with frmZDYHelpSel do
|
||||
begin
|
||||
flag:='SPR';
|
||||
flagname:='阅读人';
|
||||
MainType:=Trim(DName);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where UserName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('阅读人定义错误!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''档案管理'' ');
|
||||
sql.Add(' and isnull(Chker,'''')='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'FB','OA_Chk',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where 1=2 ');
|
||||
Open;
|
||||
append;
|
||||
FieldByName('CKID').Value:=Trim(maxno);
|
||||
FieldByName('Mainid').Value:=Trim(CDS_SC.fieldbyname('XFID').AsString);
|
||||
FieldByName('OAType').value:='档案管理';
|
||||
FieldByName('Chker').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
InitGrid();
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_SC,True);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHY.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_SC,False);
|
||||
end;
|
||||
|
||||
end.
|
||||
528
云翔OA(WTOA.dll)/U_FileUp_GSHYCX.dfm
Normal file
528
云翔OA(WTOA.dll)/U_FileUp_GSHYCX.dfm
Normal file
|
|
@ -0,0 +1,528 @@
|
|||
object frmFileUp_GSHYCX: TfrmFileUp_GSHYCX
|
||||
Left = 260
|
||||
Top = 129
|
||||
Width = 1036
|
||||
Height = 592
|
||||
Caption = #20844#21496#25991#20214#28023#36816#36153#26356#26032#26597#35810
|
||||
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 cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 97
|
||||
Width = 1020
|
||||
Height = 457
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skCount
|
||||
Column = V7FileDate
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle1
|
||||
object V7FileDate: TcxGridDBColumn
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 97
|
||||
end
|
||||
object vFileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 301
|
||||
end
|
||||
object V7chkStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'chkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1020
|
||||
Height = 33
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 320
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 390
|
||||
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
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1016
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TTJ: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#30475#23436#25104
|
||||
ImageIndex = 75
|
||||
OnClick = TTJClick
|
||||
end
|
||||
object FileUp: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 18
|
||||
Visible = False
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDown: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = FileDownClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 402
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 33
|
||||
Width = 1020
|
||||
Height = 64
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label4: TLabel
|
||||
Left = 199
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #25991#20214#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 34
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object FileName: TEdit
|
||||
Tag = 2
|
||||
Left = 255
|
||||
Top = 11
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 11
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 35
|
||||
Width = 89
|
||||
Height = 20
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 324
|
||||
Top = 119
|
||||
Width = 245
|
||||
Height = 174
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object Label6: TLabel
|
||||
Left = 48
|
||||
Top = 96
|
||||
Width = 6
|
||||
Height = 12
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 35
|
||||
Top = 52
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 35
|
||||
Top = 91
|
||||
Width = 64
|
||||
Height = 15
|
||||
Caption = #30003#25253#25968#25454
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 23
|
||||
Top = 187
|
||||
Width = 68
|
||||
Height = 15
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 243
|
||||
Height = 23
|
||||
Align = alTop
|
||||
Alignment = taLeftJustify
|
||||
BevelOuter = bvNone
|
||||
Caption = #20844#21496#25991#20214#26723#26696#20449#24687
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object Image1: TImage
|
||||
Left = 221
|
||||
Top = 3
|
||||
Width = 22
|
||||
Height = 16
|
||||
ParentShowHint = False
|
||||
Picture.Data = {
|
||||
07544269746D617076040000424D760400000000000036000000280000001500
|
||||
0000110000000100180000000000400400000000000000000000000000000000
|
||||
0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFF0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6
|
||||
F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFF404040404040404040404040404040404040404040404040
|
||||
404040404040404040404040404040404040404040404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFF808080808080808080808080808080808080808080
|
||||
808080808080808080808080808080808080808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000
|
||||
000000C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00}
|
||||
ShowHint = True
|
||||
Transparent = True
|
||||
OnClick = Image1Click
|
||||
end
|
||||
end
|
||||
object TSure: TButton
|
||||
Left = 85
|
||||
Top = 122
|
||||
Width = 85
|
||||
Height = 29
|
||||
Caption = #19978' '#20256
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = TSureClick
|
||||
end
|
||||
object ETaiTou: TEdit
|
||||
Left = 72
|
||||
Top = 288
|
||||
Width = 121
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
end
|
||||
object FileDate: TDateTimePicker
|
||||
Left = 104
|
||||
Top = 49
|
||||
Width = 110
|
||||
Height = 20
|
||||
Date = 42466.625210844900000000
|
||||
Time = 42466.625210844900000000
|
||||
TabOrder = 3
|
||||
end
|
||||
object FCYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 91
|
||||
Top = 184
|
||||
Width = 110
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
object SBQty: TEdit
|
||||
Left = 104
|
||||
Top = 88
|
||||
Width = 109
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19979#36733#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 194
|
||||
Top = 138
|
||||
Width = 138
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 552
|
||||
Top = 329
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 493
|
||||
Top = 332
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 521
|
||||
Top = 329
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 584
|
||||
Top = 328
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_SC
|
||||
Left = 348
|
||||
Top = 332
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 464
|
||||
Top = 332
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid7
|
||||
PopupMenus = <>
|
||||
Left = 292
|
||||
Top = 332
|
||||
end
|
||||
object CDS_SC: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 376
|
||||
Top = 332
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clRed
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 432
|
||||
Top = 332
|
||||
end
|
||||
object ADOQuery2: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 404
|
||||
Top = 332
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 320
|
||||
Top = 332
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
393
云翔OA(WTOA.dll)/U_FileUp_GSHYCX.pas
Normal file
393
云翔OA(WTOA.dll)/U_FileUp_GSHYCX.pas
Normal file
|
|
@ -0,0 +1,393 @@
|
|||
unit U_FileUp_GSHYCX;
|
||||
|
||||
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, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI,
|
||||
cxCalendar, cxCheckBox, Menus;
|
||||
|
||||
type
|
||||
TfrmFileUp_GSHYCX = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
vFileName: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
CDS_SC: TClientDataSet;
|
||||
FileDown: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label4: TLabel;
|
||||
FileName: TEdit;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ToolButton3: TToolButton;
|
||||
V7FileDate: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Panel4: TPanel;
|
||||
Label6: TLabel;
|
||||
Label5: TLabel;
|
||||
Panel5: TPanel;
|
||||
Image1: TImage;
|
||||
TSure: TButton;
|
||||
ETaiTou: TEdit;
|
||||
FileDate: TDateTimePicker;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
FCYNO: TEdit;
|
||||
Panel2: TPanel;
|
||||
Panel16: TPanel;
|
||||
SBQty: TEdit;
|
||||
cxStyle2: TcxStyle;
|
||||
V7chkStatus: TcxGridDBColumn;
|
||||
TTJ: TToolButton;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FileDownClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FileNameChange(Sender: TObject);
|
||||
procedure Image1Click(Sender: TObject);
|
||||
procedure TSureClick(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure TTJClick(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
Canshu1,FDEPT,FDPName:string;
|
||||
procedure ReadINIFile10();
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp_GSHYCX: TfrmFileUp_GSHYCX;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.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_GSHYCX.FileUpClick(Sender: TObject);
|
||||
begin
|
||||
//Panel4.Visible:=True;
|
||||
fileDate.DateTime:=SGetServerDate(ADOQuery2);
|
||||
TSure.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
canShu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除文件吗?','提示',32+4)<>IDYES then Exit;
|
||||
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
||||
begin
|
||||
application.MessageBox('不能删除他人文件','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete OA_Chk where Mainid='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
CDS_SC.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FormShow(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('海运费',TV7,'文件上传');
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=EndDate.Date-7;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.InitGrid();
|
||||
begin
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.add('select A.*,B.* ');
|
||||
sql.add(' from XD_File A ');
|
||||
sql.add(' inner join OA_Chk B On B.Mainid=A.XFID and B.OAType=''档案管理''');
|
||||
sql.Add(' where FileType=''SC'' ');
|
||||
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
sql.add(' and CYID=''公司海运费''');
|
||||
sql.add(' and B.Chker='''+trim(DName)+'''');
|
||||
sql.add(' order by FileDate desc');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFileUp_GSHYCX:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FPath:String;
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('海运费',TV7,'文件上传');
|
||||
FPath:='D:\Right1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FileDownClick(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
{ }
|
||||
try
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'HY1310280002' then
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
||||
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
||||
);
|
||||
end;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
end else
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
||||
if FileExists(FPath+FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+FFName,FPath+FFName);
|
||||
end;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
if FileExists(FPath+FFName) then
|
||||
begin
|
||||
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.FileNameChange(Sender: TObject);
|
||||
begin
|
||||
toolButton3.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.Image1Click(Sender: TObject);
|
||||
begin
|
||||
Panel4.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.TSureClick(Sender: TObject);
|
||||
var
|
||||
i,j: Integer;
|
||||
PatFile,HZStr: String;
|
||||
FTPPath,FConNo,MaxNo:string;
|
||||
begin
|
||||
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 else
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'DA','XD_File',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取文件最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
IdFTP1.Put(lstPat[i], Trim('\SC')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1=2');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value:=Trim(MaxNo);
|
||||
FieldByName('CYID').Value:='公司海运费';
|
||||
FieldByName('CYNO').Value:=Trim(FDPName);
|
||||
FieldByName('filename').Value:=Trim(PatFile);
|
||||
FieldByName('FileDate').Value:=SGetServerDate(ADOQueryTemp);
|
||||
FieldByName('Filltime').Value:=SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value:=Trim('SC');
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
Panel16.Visible:=False;
|
||||
Panel4.Visible:=False;
|
||||
InitGrid();
|
||||
Application.MessageBox('上传成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_SC,True);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(CDS_SC,False);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSHYCX.TTJClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_Chk set Chkstatus=''已查看'' where CKID='''+trim(CDS_SC.fieldbyname('CKID').AsString)+''' ');
|
||||
execsql;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
end.
|
||||
641
云翔OA(WTOA.dll)/U_FileUp_GSWJ.dfm
Normal file
641
云翔OA(WTOA.dll)/U_FileUp_GSWJ.dfm
Normal file
|
|
@ -0,0 +1,641 @@
|
|||
object frmFileUp_GSWJ: TfrmFileUp_GSWJ
|
||||
Left = 189
|
||||
Top = 128
|
||||
Width = 1062
|
||||
Height = 592
|
||||
Caption = #20844#21496#25991#20214#26723#26696#30331#35760
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 105
|
||||
Width = 1046
|
||||
Height = 447
|
||||
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
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle1
|
||||
object V7Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 62
|
||||
end
|
||||
object V7ConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 85
|
||||
end
|
||||
object V7FileDate: TcxGridDBColumn
|
||||
Caption = #21512#21516#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 81
|
||||
end
|
||||
object V7YWYName: TcxGridDBColumn
|
||||
Caption = #19994#21153#21592
|
||||
DataBinding.FieldName = 'YWYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 96
|
||||
end
|
||||
object V7CYNO: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'CYNO'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 92
|
||||
end
|
||||
object V7SBQty: TcxGridDBColumn
|
||||
Caption = #30003#25253#25968#25454
|
||||
DataBinding.FieldName = 'SBQty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object V7SBBFB: TcxGridDBColumn
|
||||
Caption = #30003#25253#30334#20998#27604'%'
|
||||
DataBinding.FieldName = 'SBBFB'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = cxStyle2
|
||||
Width = 85
|
||||
end
|
||||
object V7Filltime: TcxGridDBColumn
|
||||
Caption = #19978#20256#26085#26399
|
||||
DataBinding.FieldName = 'Filltime'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 88
|
||||
end
|
||||
object vFileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 241
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1046
|
||||
Height = 36
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 347
|
||||
Top = 15
|
||||
Width = 76
|
||||
Height = 18
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -18
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 423
|
||||
Top = 10
|
||||
Width = 228
|
||||
Height = 24
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -18
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1042
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 61
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 65
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object FileUp: TToolButton
|
||||
Left = 130
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 18
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDown: TToolButton
|
||||
Left = 195
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = FileDownClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 260
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 325
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 36
|
||||
Width = 1046
|
||||
Height = 69
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label4: TLabel
|
||||
Left = 216
|
||||
Top = 16
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #19994#21153#21592
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 37
|
||||
Top = 16
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #21512#21516#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 216
|
||||
Top = 42
|
||||
Width = 44
|
||||
Height = 13
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 405
|
||||
Top = 16
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #21512#21516#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object YWYName: TEdit
|
||||
Tag = 2
|
||||
Left = 259
|
||||
Top = 12
|
||||
Width = 119
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = YWYNameChange
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 94
|
||||
Top = 12
|
||||
Width = 97
|
||||
Height = 21
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 94
|
||||
Top = 38
|
||||
Width = 97
|
||||
Height = 21
|
||||
Date = 42172.726043136570000000
|
||||
Time = 42172.726043136570000000
|
||||
TabOrder = 2
|
||||
end
|
||||
object CYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 259
|
||||
Top = 38
|
||||
Width = 119
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = YWYNameChange
|
||||
end
|
||||
object Conno: TEdit
|
||||
Tag = 2
|
||||
Left = 449
|
||||
Top = 12
|
||||
Width = 119
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = YWYNameChange
|
||||
end
|
||||
end
|
||||
object Panel4: TPanel
|
||||
Left = 416
|
||||
Top = 129
|
||||
Width = 287
|
||||
Height = 279
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object Label6: TLabel
|
||||
Left = 52
|
||||
Top = 115
|
||||
Width = 7
|
||||
Height = 13
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 39
|
||||
Top = 82
|
||||
Width = 68
|
||||
Height = 16
|
||||
Caption = #21512#21516#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 39
|
||||
Top = 111
|
||||
Width = 69
|
||||
Height = 16
|
||||
Caption = #19994' '#21153' '#21592
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label8: TLabel
|
||||
Left = 39
|
||||
Top = 142
|
||||
Width = 70
|
||||
Height = 16
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label9: TLabel
|
||||
Left = 39
|
||||
Top = 171
|
||||
Width = 68
|
||||
Height = 16
|
||||
Caption = #30003#25253#25968#25454
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 39
|
||||
Top = 54
|
||||
Width = 69
|
||||
Height = 16
|
||||
Caption = #21512' '#21516' '#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 43
|
||||
Top = 193
|
||||
Width = 206
|
||||
Height = 13
|
||||
Caption = '('#27880':'#30003#25253#25968#25454#21482#19982#21457#31080#37329#39069#26377#20851')'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Panel5: TPanel
|
||||
Left = 1
|
||||
Top = 1
|
||||
Width = 285
|
||||
Height = 25
|
||||
Align = alTop
|
||||
Alignment = taLeftJustify
|
||||
BevelOuter = bvNone
|
||||
Caption = #20844#21496#25991#20214#26723#26696#20449#24687
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -18
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object Image1: TImage
|
||||
Left = 261
|
||||
Top = 3
|
||||
Width = 24
|
||||
Height = 18
|
||||
ParentShowHint = False
|
||||
Picture.Data = {
|
||||
07544269746D617076040000424D760400000000000036000000280000001500
|
||||
0000110000000100180000000000400400000000000000000000000000000000
|
||||
0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFF0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6
|
||||
F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFF404040404040404040404040404040404040404040404040
|
||||
404040404040404040404040404040404040404040404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFF808080808080808080808080808080808080808080
|
||||
808080808080808080808080808080808080808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000
|
||||
000000C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4000000000000
|
||||
000000000000C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4000000000000C8D0D4
|
||||
C8D0D4000000000000C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4000000000000C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4000000000000C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFC8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4
|
||||
C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4C8D0D4808080404040F0CAA6FFFFFFFFFF
|
||||
FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FF00}
|
||||
ShowHint = True
|
||||
Transparent = True
|
||||
OnClick = Image1Click
|
||||
end
|
||||
end
|
||||
object TSure: TButton
|
||||
Left = 104
|
||||
Top = 226
|
||||
Width = 92
|
||||
Height = 30
|
||||
Caption = #19978' '#20256
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = TSureClick
|
||||
end
|
||||
object ETaiTou: TEdit
|
||||
Left = 78
|
||||
Top = 312
|
||||
Width = 131
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
end
|
||||
object FileDate: TDateTimePicker
|
||||
Left = 112
|
||||
Top = 79
|
||||
Width = 136
|
||||
Height = 21
|
||||
Date = 42466.625210844900000000
|
||||
Time = 42466.625210844900000000
|
||||
TabOrder = 3
|
||||
end
|
||||
object FCYNO: TEdit
|
||||
Tag = 2
|
||||
Left = 112
|
||||
Top = 139
|
||||
Width = 135
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = YWYNameChange
|
||||
end
|
||||
object FYWYName: TBtnEditA
|
||||
Left = 112
|
||||
Top = 108
|
||||
Width = 136
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
OnBtnClick = FYWYNameBtnClick
|
||||
end
|
||||
object CConNo: TEdit
|
||||
Left = 112
|
||||
Top = 51
|
||||
Width = 135
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
end
|
||||
object SBQty: TcxCurrencyEdit
|
||||
Left = 112
|
||||
Top = 168
|
||||
Properties.AssignedValues.DisplayFormat = True
|
||||
TabOrder = 7
|
||||
Width = 135
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 210
|
||||
Top = 150
|
||||
Width = 150
|
||||
Height = 32
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19979#36733#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 210
|
||||
Top = 150
|
||||
Width = 150
|
||||
Height = 32
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 648
|
||||
Top = 177
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 661
|
||||
Top = 228
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 669
|
||||
Top = 277
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 748
|
||||
Top = 244
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_SC
|
||||
Left = 344
|
||||
Top = 364
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 608
|
||||
Top = 340
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid7
|
||||
PopupMenus = <>
|
||||
Left = 256
|
||||
Top = 240
|
||||
end
|
||||
object CDS_SC: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 396
|
||||
Top = 372
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clRed
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 364
|
||||
end
|
||||
object ADOQuery2: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 452
|
||||
Top = 400
|
||||
end
|
||||
end
|
||||
481
云翔OA(WTOA.dll)/U_FileUp_GSWJ.pas
Normal file
481
云翔OA(WTOA.dll)/U_FileUp_GSWJ.pas
Normal file
|
|
@ -0,0 +1,481 @@
|
|||
unit U_FileUp_GSWJ;
|
||||
|
||||
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, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI,
|
||||
cxCalendar, cxContainer, cxTextEdit, cxCurrencyEdit, cxCheckBox;
|
||||
|
||||
type
|
||||
TfrmFileUp_GSWJ = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
vFileName: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
CDS_SC: TClientDataSet;
|
||||
FileDown: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label4: TLabel;
|
||||
YWYName: TEdit;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ToolButton3: TToolButton;
|
||||
V7FileDate: TcxGridDBColumn;
|
||||
V7YWYName: TcxGridDBColumn;
|
||||
V7CYNO: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label2: TLabel;
|
||||
CYNO: TEdit;
|
||||
Panel4: TPanel;
|
||||
Label6: TLabel;
|
||||
Label5: TLabel;
|
||||
Panel5: TPanel;
|
||||
Image1: TImage;
|
||||
TSure: TButton;
|
||||
ETaiTou: TEdit;
|
||||
FileDate: TDateTimePicker;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
FCYNO: TEdit;
|
||||
FYWYName: TBtnEditA;
|
||||
Panel2: TPanel;
|
||||
Panel16: TPanel;
|
||||
Label9: TLabel;
|
||||
Label10: TLabel;
|
||||
CConNo: TEdit;
|
||||
V7ConNo: TcxGridDBColumn;
|
||||
V7SBQty: TcxGridDBColumn;
|
||||
V7Filltime: TcxGridDBColumn;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
Conno: TEdit;
|
||||
V7SBBFB: TcxGridDBColumn;
|
||||
cxStyle2: TcxStyle;
|
||||
SBQty: TcxCurrencyEdit;
|
||||
V7Ssel: TcxGridDBColumn;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FileDownClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure YWYNameChange(Sender: TObject);
|
||||
procedure Image1Click(Sender: TObject);
|
||||
procedure TSureClick(Sender: TObject);
|
||||
procedure FYWYNameBtnClick(Sender: TObject);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
Canshu1,FDEPT,FDPName:string;
|
||||
procedure ReadINIFile10();
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp_GSWJ: TfrmFileUp_GSWJ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp_GSWJ.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_GSWJ.FileUpClick(Sender: TObject);
|
||||
begin
|
||||
Panel4.Visible:=True;
|
||||
fileDate.DateTime:=SGetServerDate(ADOQuery2);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
canShu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
if CDS_SC.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要删除文件吗?','提示',32+4)<>IDYES then Exit;
|
||||
with CDS_SC do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').Asboolean=true then
|
||||
begin
|
||||
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
||||
begin
|
||||
application.MessageBox('不能删除他人文件','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FormShow(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('档案',TV7,'文件上传');
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=EndDate.Date-7;
|
||||
InitGrid();
|
||||
if Trim(canShu1)<>'登记' then
|
||||
begin
|
||||
FileUp.Visible:=False;
|
||||
FileDel.Visible:=False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FileUp.Visible:=True;
|
||||
FileDel.Visible:=True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.InitGrid();
|
||||
var Fint:integer;
|
||||
begin
|
||||
with ADOQuery2 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_DangAn A ');
|
||||
sql.Add('inner join SY_Dept B on A.DPID=B.DPID');
|
||||
SQL.Add('where isnull(A.YGEName,YGName)='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
FDEPT:=ADOQuery2.fieldbyname('DPParent').AsString;
|
||||
for Fint:=4 to ADOQuery2.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDEPT)+'''');
|
||||
open;
|
||||
end;
|
||||
FDEPT:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
if FDEPT<>'' then
|
||||
begin
|
||||
FDPName:=ADOQueryCmd.fieldbyname('DPName').AsString;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FDPName:='';
|
||||
end;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.add('select AA.*,SBBFB=(case when SumSBQty=0 then 0 else (SBQty/SumSBQty)*100 end) from (select *, ');
|
||||
SQL.Add(' SumSBQty=(select Sum(isnull(SBQty,0))');
|
||||
sql.add(' from XD_File where ');
|
||||
sql.Add(' FileType=''SC'' ');
|
||||
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
sql.add(' and CYID=''公司档案'')');
|
||||
sql.add(' from XD_File where ');
|
||||
sql.Add(' FileType=''SC'' ');
|
||||
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
sql.add(' and CYID=''公司档案'') AA where CYID=''公司档案''');
|
||||
if trim(CanShu1)='部门' then
|
||||
sql.add(' and (isnull(CYNo,'''')='''+trim(FDPName)+'''');
|
||||
if trim(CanShu1)='查询' then
|
||||
sql.add(' and YWYName='''+trim(DName)+'''');
|
||||
if trim(CanShu1)='登记' then
|
||||
sql.add(' and filler='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFileUp_GSWJ:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FPath:String;
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('档案',TV7,'文件上传');
|
||||
FPath:='D:\Right1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FileDownClick(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
Panel2.Visible:=True;
|
||||
Panel2.Refresh;
|
||||
{ }
|
||||
try
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'DA1310280009' then
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
||||
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
||||
);
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
end else
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
||||
if FileExists(FPath+FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+FFName,FPath+FFName);
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
if FileExists(FPath+FFName) then
|
||||
begin
|
||||
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.YWYNameChange(Sender: TObject);
|
||||
begin
|
||||
toolButton3.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.Image1Click(Sender: TObject);
|
||||
begin
|
||||
Panel4.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.TSureClick(Sender: TObject);
|
||||
var
|
||||
i,j: Integer;
|
||||
PatFile,HZStr: String;
|
||||
FTPPath,FConNo,MaxNo:string;
|
||||
begin
|
||||
if FYWYName.Text='' then
|
||||
begin
|
||||
application.MessageBox('业务员不能为空','提示');
|
||||
exit;
|
||||
end;
|
||||
if CConNo.Text='' then
|
||||
begin
|
||||
application.MessageBox('合同号不能为空','提示');
|
||||
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 else
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'DA','XD_File',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取文件最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
IdFTP1.Put(lstPat[i], Trim('\SC')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1=2');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value:=Trim(MaxNo);
|
||||
FieldByName('CYID').Value:='公司档案';
|
||||
FieldByName('CYNO').Value:=Trim(FCYNo.Text);
|
||||
FieldByName('filename').Value:=Trim(PatFile);
|
||||
FieldByName('FileDate').Value:=fileDate.DateTime;
|
||||
FieldByName('Filltime').Value:=SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value:=Trim('SC');
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
fieldbyname('YWYName').Value:=trim(FYWYName.Text);
|
||||
fieldbyname('ConNo').Value:=trim(CConNo.Text);
|
||||
if SBQty.Text='' then
|
||||
fieldbyname('SBQty').Value:=0
|
||||
else
|
||||
fieldbyname('SBQty').Value:=trim(SBQty.Text);
|
||||
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
Panel16.Visible:=False;
|
||||
Panel4.Visible:=False;
|
||||
InitGrid();
|
||||
Application.MessageBox('上传成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_GSWJ.FYWYNameBtnClick(Sender: TObject);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YWYName';
|
||||
flagname:='业务员';
|
||||
MainType:=trim(DName);
|
||||
if showModal=1 then
|
||||
begin
|
||||
FYWYName.Text:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
with ADOQuery2 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* from OA_YG_DangAn A ');
|
||||
SQL.Add('where isnull(A.YGEName,YGName)='''+trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
FCYNO.Text:=ADOQuery2.fieldbyname('Dept').AsString;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
207
云翔OA(WTOA.dll)/U_FileUp_PZ.dfm
Normal file
207
云翔OA(WTOA.dll)/U_FileUp_PZ.dfm
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
object frmFileUpPZ: TfrmFileUpPZ
|
||||
Left = 274
|
||||
Top = 143
|
||||
Width = 620
|
||||
Height = 447
|
||||
Caption = #19978#20256#25991#20214
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 44
|
||||
Width = 539
|
||||
Height = 363
|
||||
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 = 123
|
||||
end
|
||||
object FileDate: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #19978#20256#26085#26399
|
||||
DataBinding.FieldName = 'FileDate'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 118
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 206
|
||||
Top = 150
|
||||
Width = 149
|
||||
Height = 32
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 539
|
||||
Top = 44
|
||||
Width = 65
|
||||
Height = 363
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 61
|
||||
Caption = 'ToolBar1'
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object FileUp: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 48
|
||||
Wrap = True
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 0
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
Wrap = True
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 604
|
||||
Height = 44
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
object Label1: TLabel
|
||||
Left = 41
|
||||
Top = 15
|
||||
Width = 76
|
||||
Height = 18
|
||||
Caption = #22270#29255#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -18
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Image2: TImage
|
||||
Left = 595
|
||||
Top = 18
|
||||
Width = 25
|
||||
Height = 18
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 373
|
||||
Top = 17
|
||||
Width = 187
|
||||
Height = 15
|
||||
Caption = #27880#65306#35831#19978#20256'JPG'#26684#24335#22270#29255#65281
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -15
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 117
|
||||
Top = 10
|
||||
Width = 229
|
||||
Height = 26
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -18
|
||||
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 = 408
|
||||
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 = 413
|
||||
Top = 285
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryFile
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 500
|
||||
Top = 216
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 440
|
||||
Top = 227
|
||||
end
|
||||
end
|
||||
358
云翔OA(WTOA.dll)/U_FileUp_PZ.pas
Normal file
358
云翔OA(WTOA.dll)/U_FileUp_PZ.pas
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
unit U_FileUp_PZ;
|
||||
|
||||
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
|
||||
TfrmFileUpPZ = 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;
|
||||
Label2: TLabel;
|
||||
ADOQuery1: TADOQuery;
|
||||
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
|
||||
frmFileUpPZ: TfrmFileUpPZ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUpPZ.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 TfrmFileUpPZ.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();
|
||||
Image2.Picture.LoadFromFile(ODPat.FileName);
|
||||
AJpeg.Assign(Image2.Picture.Graphic);
|
||||
CreThumb(AJpeg,Image2,800,400); //216,187
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select Count(*) MM from XD_File where filename='''+Trim(PatFile)+''' ');
|
||||
SQL.Add('and filetype=''PZ''');
|
||||
Open;
|
||||
j:=fieldbyname('MM').AsInteger;
|
||||
end;
|
||||
if j>1 then
|
||||
begin
|
||||
PatFile:=IntToStr(j)+PatFile;
|
||||
end;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Put(lstPat[i], Trim('\PZ')+'\'+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=''PZ''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Panel16.Visible:=False;
|
||||
Application.MessageBox(PChar('文件<'+Trim(PatFile)+'>重复,'+inttostr(i)+'个文件上传成功!'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'PZ','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=2');
|
||||
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('PZ');
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('图片不是JPG格式!','提示',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 TfrmFileUpPZ.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 TfrmFileUpPZ.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 TfrmFileUpPZ.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFileUpPZ.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 ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where CYID='''+Trim(CYID)+'''');
|
||||
SQL.Add(' and FileType=''PZ''');
|
||||
open;
|
||||
end;
|
||||
if ADOQuery1.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;
|
||||
application.MessageBox('删除成功','提示');
|
||||
end;
|
||||
|
||||
procedure TfrmFileUpPZ.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=''PZ''');
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
281
云翔OA(WTOA.dll)/U_FileUp_ZZD.dfm
Normal file
281
云翔OA(WTOA.dll)/U_FileUp_ZZD.dfm
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
object frmFileUp_ZZD: TfrmFileUp_ZZD
|
||||
Left = 197
|
||||
Top = 132
|
||||
Width = 1076
|
||||
Height = 608
|
||||
Caption = #20844#21496#35268#31456#21046#24230#20844#24067#26639
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object cxGrid7: TcxGrid
|
||||
Left = 0
|
||||
Top = 79
|
||||
Width = 1060
|
||||
Height = 489
|
||||
Align = alClient
|
||||
TabOrder = 0
|
||||
object TV7: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = TV7CellDblClick
|
||||
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
|
||||
Styles.Header = cxStyle1
|
||||
object vFileName: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #20844#21496#35268#31456#21046#24230#26631#39064
|
||||
DataBinding.FieldName = 'FileName'
|
||||
FooterAlignmentHorz = taCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 541
|
||||
end
|
||||
end
|
||||
object cxGridLevel6: TcxGridLevel
|
||||
GridView = TV7
|
||||
end
|
||||
end
|
||||
object Panel16: TPanel
|
||||
Left = 206
|
||||
Top = 137
|
||||
Width = 149
|
||||
Height = 32
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19978#20256#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1060
|
||||
Height = 36
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 347
|
||||
Top = 15
|
||||
Width = 76
|
||||
Height = 18
|
||||
Caption = #20135#21697#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -18
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Visible = False
|
||||
end
|
||||
object Code: TEdit
|
||||
Left = 423
|
||||
Top = 10
|
||||
Width = 228
|
||||
Height = 24
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -18
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
ReadOnly = True
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
end
|
||||
object ToolBar6: TToolBar
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1056
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 61
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 24
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 65
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object FileUp: TToolButton
|
||||
Left = 130
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19978#20256
|
||||
ImageIndex = 18
|
||||
OnClick = FileUpClick
|
||||
end
|
||||
object FileDown: TToolButton
|
||||
Left = 195
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #19979#36733
|
||||
ImageIndex = 19
|
||||
OnClick = FileDownClick
|
||||
end
|
||||
object FileDel: TToolButton
|
||||
Left = 260
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = FileDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 325
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 206
|
||||
Top = 137
|
||||
Width = 149
|
||||
Height = 32
|
||||
BevelInner = bvRaised
|
||||
Caption = #27491#22312#19979#36733#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
end
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 36
|
||||
Width = 1060
|
||||
Height = 43
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 4
|
||||
object Label4: TLabel
|
||||
Left = 62
|
||||
Top = 15
|
||||
Width = 112
|
||||
Height = 13
|
||||
Caption = #20844#21496#35268#31456#21046#24230#26631#39064
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object FileName: TEdit
|
||||
Left = 176
|
||||
Top = 11
|
||||
Width = 274
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = FileNameChange
|
||||
end
|
||||
end
|
||||
object ODPat: TOpenDialog
|
||||
Options = [ofReadOnly, ofAllowMultiSelect, ofPathMustExist, ofFileMustExist, ofEnableSizing]
|
||||
Left = 580
|
||||
Top = 161
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 581
|
||||
Top = 200
|
||||
end
|
||||
object SaveDialog1: TSaveDialog
|
||||
Left = 585
|
||||
Top = 249
|
||||
end
|
||||
object ADOQueryFile: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 488
|
||||
Top = 144
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_SC
|
||||
Left = 392
|
||||
Top = 168
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 264
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid7
|
||||
PopupMenus = <>
|
||||
Left = 296
|
||||
Top = 232
|
||||
end
|
||||
object CDS_SC: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 416
|
||||
Top = 224
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 496
|
||||
Top = 216
|
||||
end
|
||||
object ADOQuery2: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 440
|
||||
Top = 272
|
||||
end
|
||||
end
|
||||
374
云翔OA(WTOA.dll)/U_FileUp_ZZD.pas
Normal file
374
云翔OA(WTOA.dll)/U_FileUp_ZZD.pas
Normal file
|
|
@ -0,0 +1,374 @@
|
|||
unit U_FileUp_ZZD;
|
||||
|
||||
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, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI;
|
||||
|
||||
type
|
||||
TfrmFileUp_ZZD = class(TForm)
|
||||
cxGrid7: TcxGrid;
|
||||
TV7: TcxGridDBTableView;
|
||||
vFileName: TcxGridDBColumn;
|
||||
cxGridLevel6: TcxGridLevel;
|
||||
Panel16: TPanel;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Code: TEdit;
|
||||
ODPat: TOpenDialog;
|
||||
IdFTP1: TIdFTP;
|
||||
SaveDialog1: TSaveDialog;
|
||||
ADOQueryFile: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ToolBar6: TToolBar;
|
||||
FileUp: TToolButton;
|
||||
FileDel: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
CDS_SC: TClientDataSet;
|
||||
FileDown: TToolButton;
|
||||
Panel2: TPanel;
|
||||
ToolButton2: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label4: TLabel;
|
||||
FileName: TEdit;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ToolButton3: TToolButton;
|
||||
procedure FileUpClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FileDelClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure FileDownClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FileNameChange(Sender: TObject);
|
||||
procedure TV7CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
private
|
||||
lstPat: TStringList;
|
||||
AJpeg: TJPEGImage;
|
||||
Canshu1,FDEPT,FDPName:string;
|
||||
procedure ReadINIFile10();
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
CYID:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFileUp_ZZD: TfrmFileUp_ZZD;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFileUp_ZZD.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_ZZD.FileUpClick(Sender: TObject);
|
||||
var
|
||||
i,j: Integer;
|
||||
PatFile,HZStr: String;
|
||||
FTPPath,FConNo,MaxNo:string;
|
||||
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 else
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
Panel16.Visible:=True;
|
||||
Panel16.Refresh;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
for i := 0 to lstPat.Count - 1 do
|
||||
begin
|
||||
PatFile := ExtractFileName(lstPat[i]);
|
||||
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
try
|
||||
if GetLSNo(ADOQueryCmd,MaxNo,'SC','XD_File',4,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取文件最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
IdFTP1.Put(lstPat[i], Trim('\SC')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where 1=2');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('XFID').Value:=Trim(MaxNo);
|
||||
FieldByName('CYID').Value:='公司规章';
|
||||
FieldByName('CYNO').Value:=Trim(FDPName);
|
||||
FieldByName('filename').Value:=Trim(PatFile);
|
||||
FieldByName('FileDate').Value:=SGetServerDate(ADOQueryTemp);
|
||||
fieldbyname('FileType').value:=Trim('SC');
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
||||
Post;
|
||||
end;
|
||||
except
|
||||
//ADOQueryCmd.Connection.RollbackTrans;
|
||||
//Application.MessageBox('图片上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
Panel16.Visible:=False;
|
||||
InitGrid();
|
||||
Application.MessageBox('上传成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('上传失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FormCreate(Sender: TObject);
|
||||
begin
|
||||
lstPat := TStringList.Create;
|
||||
canShu1:=trim(DParameters1);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FileDelClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除文件吗?','提示',32+4)<>IDYES then Exit;
|
||||
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
||||
begin
|
||||
application.MessageBox('不能删除他人文件','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
CDS_SC.Delete;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FormShow(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('正排表',TV7,'文件上传');
|
||||
InitGrid();
|
||||
if Trim(canShu1)='查询' then
|
||||
begin
|
||||
FileUp.Visible:=False;
|
||||
FileDel.Visible:=False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FileUp.Visible:=True;
|
||||
FileDel.Visible:=True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.InitGrid();
|
||||
var Fint:integer;
|
||||
begin
|
||||
with ADOQuery2 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_DangAn A ');
|
||||
sql.Add('inner join SY_Dept B on A.DPID=B.DPID');
|
||||
SQL.Add('where isnull(A.YGEName,YGName)='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
FDEPT:=ADOQuery2.fieldbyname('DPParent').AsString;
|
||||
for Fint:=2 to ADOQuery2.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDEPT)+'''');
|
||||
open;
|
||||
end;
|
||||
FDEPT:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
if FDEPT<>'' then
|
||||
begin
|
||||
FDPName:=ADOQueryCmd.fieldbyname('DPName').AsString;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FDPName:='';
|
||||
end;
|
||||
with ADOQueryFile do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from XD_File where ');
|
||||
sql.Add(' FileType=''SC'' ');
|
||||
//sql.add(' and (isnull(CYNo,'''')='''+trim(FDPName)+''' or isnull(CYNo,'''')=''总经办'')');
|
||||
sql.add(' and CYID=''公司规章''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFileUp_ZZD:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
FPath:String;
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('正排表',TV7,'文件上传');
|
||||
FPath:='D:\Right1209\';
|
||||
if DirectoryExists(ExtractFileDir(FPath)) then
|
||||
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FileDownClick(Sender: TObject);
|
||||
var
|
||||
fHandle:THandle;
|
||||
FInt:Integer;
|
||||
FFName,FPath:String;
|
||||
begin
|
||||
if CDS_SC.IsEmpty then Exit;
|
||||
Panel2.Visible:=True;
|
||||
Panel2.Refresh;
|
||||
{ }
|
||||
try
|
||||
ReadINIFile10();
|
||||
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||
if Length(server)<6 then
|
||||
begin
|
||||
server:='127.0.0.1';
|
||||
end;
|
||||
IdFTP1.Host :=server;//PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('无法连接到文件服务器,请检查!', '提示', MB_ICONWARNING);
|
||||
Exit;
|
||||
end;
|
||||
FPath:='D:\Right1209\';
|
||||
if not DirectoryExists(ExtractFileDir(FPath)) then
|
||||
CreateDir(ExtractFileDir(FPath));
|
||||
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'SC1310280002' then
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
||||
|
||||
FFName:=FPath+FFName;
|
||||
if FileExists(FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
||||
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
||||
);
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
||||
end else
|
||||
begin
|
||||
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
||||
if FileExists(FPath+FFName)=false then
|
||||
begin
|
||||
IdFTP1.Get('SC\'+FFName,FPath+FFName);
|
||||
end;
|
||||
Panel2.Visible:=False;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
if FileExists(FPath+FFName) then
|
||||
begin
|
||||
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryFile,CDS_SC);
|
||||
SInitCDSData20(ADOQueryFile,CDS_SC);
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.FileNameChange(Sender: TObject);
|
||||
begin
|
||||
toolButton3.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFileUp_ZZD.TV7CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
FileDown.Click;
|
||||
end;
|
||||
|
||||
end.
|
||||
172
云翔OA(WTOA.dll)/U_FjList.dfm
Normal file
172
云翔OA(WTOA.dll)/U_FjList.dfm
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
object frmFjList: TfrmFjList
|
||||
Left = 154
|
||||
Top = 62
|
||||
Width = 1049
|
||||
Height = 540
|
||||
BorderIcons = [biSystemMenu, biMinimize]
|
||||
Caption = #38468#20214#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 ListView1: TListView
|
||||
Left = 36
|
||||
Top = 88
|
||||
Width = 141
|
||||
Height = 137
|
||||
Columns = <>
|
||||
TabOrder = 0
|
||||
OnDblClick = ListView1DblClick
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 882
|
||||
Top = 0
|
||||
Width = 151
|
||||
Height = 501
|
||||
Align = alRight
|
||||
TabOrder = 1
|
||||
object FileName: TcxButton
|
||||
Left = 30
|
||||
Top = 60
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #28155#21152
|
||||
TabOrder = 0
|
||||
OnClick = FileNameClick
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton1: TcxButton
|
||||
Left = 30
|
||||
Top = 96
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #21024#38500
|
||||
TabOrder = 1
|
||||
OnClick = cxButton1Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton2: TcxButton
|
||||
Left = 30
|
||||
Top = 132
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #20445#23384
|
||||
TabOrder = 2
|
||||
OnClick = cxButton2Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton3: TcxButton
|
||||
Left = 30
|
||||
Top = 172
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #20851#38381
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
OnClick = cxButton3Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton4: TcxButton
|
||||
Left = 30
|
||||
Top = 220
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #28155#21152#25991#20214#22841
|
||||
TabOrder = 4
|
||||
OnClick = cxButton4Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 24
|
||||
Top = 124
|
||||
Width = 193
|
||||
Height = 41
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'Panel2'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
OnDblClick = Panel2DblClick
|
||||
end
|
||||
object ShellListView1: TShellListView
|
||||
Left = 177
|
||||
Top = 0
|
||||
Width = 705
|
||||
Height = 501
|
||||
ObjectTypes = [otFolders, otNonFolders]
|
||||
Root = 'rfDesktop'
|
||||
ShellTreeView = ShellTreeView1
|
||||
Sorted = True
|
||||
Align = alClient
|
||||
ReadOnly = False
|
||||
TabOrder = 3
|
||||
end
|
||||
object ShellTreeView1: TShellTreeView
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 177
|
||||
Height = 501
|
||||
ObjectTypes = [otFolders]
|
||||
Root = 'rfDesktop'
|
||||
ShellListView = ShellListView1
|
||||
UseShellImages = True
|
||||
Align = alLeft
|
||||
AutoRefresh = False
|
||||
Indent = 19
|
||||
ParentColor = False
|
||||
RightClickSelect = True
|
||||
ShowRoot = False
|
||||
TabOrder = 4
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 512
|
||||
Top = 28
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 560
|
||||
Top = 24
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
Left = 520
|
||||
Top = 212
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 340
|
||||
Top = 190
|
||||
end
|
||||
object ADOConnection1: TADOConnection
|
||||
LoginPrompt = False
|
||||
Left = 484
|
||||
Top = 240
|
||||
end
|
||||
end
|
||||
436
云翔OA(WTOA.dll)/U_FjList.pas
Normal file
436
云翔OA(WTOA.dll)/U_FjList.pas
Normal file
|
|
@ -0,0 +1,436 @@
|
|||
unit U_FjList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, ComCtrls, Menus, cxLookAndFeelPainters, StdCtrls,
|
||||
cxButtons, DB, ADODB, ImgList,shellapi, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP, ShlObj, cxShellCommon, cxControls,
|
||||
cxContainer, cxShellTreeView, cxShellListView, ShellCtrls;
|
||||
|
||||
type
|
||||
TfrmFjList = class(TForm)
|
||||
ListView1: TListView;
|
||||
Panel1: TPanel;
|
||||
FileName: TcxButton;
|
||||
cxButton1: TcxButton;
|
||||
cxButton2: TcxButton;
|
||||
cxButton3: TcxButton;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ImageList1: TImageList;
|
||||
Panel2: TPanel;
|
||||
IdFTP1: TIdFTP;
|
||||
ADOConnection1: TADOConnection;
|
||||
cxButton4: TcxButton;
|
||||
ShellListView1: TShellListView;
|
||||
ShellTreeView1: TShellTreeView;
|
||||
procedure cxButton3Click(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FileNameClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ListView1DblClick(Sender: TObject);
|
||||
procedure cxButton1Click(Sender: TObject);
|
||||
procedure cxButton2Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure Panel2DblClick(Sender: TObject);
|
||||
procedure cxButton4Click(Sender: TObject);
|
||||
private
|
||||
procedure InitData();
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO:string;
|
||||
fType:string;
|
||||
fId:integer;
|
||||
|
||||
fstatus:integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFjList: TfrmFjList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
{$R *.dfm}
|
||||
procedure TfrmFjList.InitData();
|
||||
var
|
||||
ListItem: TListItem;
|
||||
Flag: Cardinal;
|
||||
info: SHFILEINFOA;
|
||||
Icon: TIcon;
|
||||
begin
|
||||
ListView1.Items.Clear;
|
||||
try
|
||||
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select fileName from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ListView1 do
|
||||
begin
|
||||
LargeImages := ImageList1;
|
||||
Icon := TIcon.Create;
|
||||
ListItem := Items.Add;
|
||||
Listitem.Caption := trim(fieldbyname('fileName').AsString);
|
||||
// Listitem.SubItems.Add(OpenDiaLog.FileName);
|
||||
Flag := (SHGFI_SMALLICON or SHGFI_ICON or SHGFI_USEFILEATTRIBUTES);
|
||||
SHGetFileInfo(Pchar(trim(fieldbyname('fileName').AsString)), 0, info, Sizeof(info), Flag);
|
||||
Icon.Handle := info.hIcon;
|
||||
ImageList1.AddIcon(Icon);
|
||||
ListItem.ImageIndex := ImageList1.Count - 1;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton3Click(Sender: TObject);
|
||||
begin
|
||||
ADOQueryTmp.Close;
|
||||
ADOQuerycmd.Close;
|
||||
ListView1.Items.Free;
|
||||
ModalResult:=-1;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFjList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FileNameClick(Sender: TObject);
|
||||
var
|
||||
OpenDiaLog: TOpenDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
maxNo:string;
|
||||
// myStream: TADOBlobStream;
|
||||
// FJStream : TMemoryStream;
|
||||
begin
|
||||
|
||||
try
|
||||
OpenDiaLog := TOpenDialog.Create(Self);
|
||||
if OpenDiaLog.Execute then
|
||||
begin
|
||||
fFilePath:=OpenDiaLog.FileName;
|
||||
fFileName:=ExtractFileName(OpenDiaLog.FileName);
|
||||
|
||||
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select TFId from TP_File ');
|
||||
sql.Add('where WBID<>'+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
IF not adoqueryCmd.IsEmpty then
|
||||
begin
|
||||
application.MessageBox('此附件名称已存在,请修改文件名,继续上传!','提示信息',MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Panel2.Caption:='正在上传数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
|
||||
if GetLSNo(ADOQueryCmd,maxNo,'FJ','TP_File',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
adoqueryCmd.Connection.BeginTrans;
|
||||
|
||||
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
try
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
append;
|
||||
fieldbyname('TFID').Value:=trim(maxNO);
|
||||
fieldbyname('WBID').Value:=trim(fkeyNO);
|
||||
fieldbyname('TFType').Value:=trim(fType);
|
||||
fieldbyname('FileName').Value:=trim(fFileName);
|
||||
// tblobfield(FieldByName('Filesother')).LoadFromFile(fFilePath);
|
||||
post;
|
||||
end;
|
||||
|
||||
if fFilePath <> '' then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host :='127.0.0.1';
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
||||
IdFTP1.Quit;
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('上传客户图样文件失败,请检查文件服务器!', '提示', MB_ICONWARNING);
|
||||
end;
|
||||
end;
|
||||
IdFTP1.Quit;
|
||||
|
||||
Panel2.Visible:=false;
|
||||
initdata();
|
||||
finally
|
||||
// FJStream.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
adoqueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
adoqueryCmd.Connection.RollbackTrans;
|
||||
application.MessageBox('附件保存失败!','提示信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
ListView1.Align:=alclient;
|
||||
fstatus:=0;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormShow(Sender: TObject);
|
||||
begin
|
||||
IF fstatus=0 then Panel1.Visible:=true
|
||||
else Panel1.Visible:=false;
|
||||
//initdata();
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.ListView1DblClick(Sender: TObject);
|
||||
var
|
||||
sFieldName:string;
|
||||
fileName:string;
|
||||
begin
|
||||
if ListView1.Items.Count<1 THEN EXIT;
|
||||
|
||||
if listView1.SelCount<1 then exit;
|
||||
sFieldName:='D:\图片查看';
|
||||
|
||||
if not DirectoryExists(pchar(sFieldName)) then
|
||||
CreateDirectory(pchar(sFieldName),nil);
|
||||
|
||||
fileName:=ListView1.Selected.Caption;
|
||||
|
||||
sFieldName:=sFieldName+'\'+trim(fileName);
|
||||
|
||||
try
|
||||
IdFTP1.Host :='127.0.0.1';
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fileName), sFieldName,false, true);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton1Click(Sender: TObject);
|
||||
var
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
begin
|
||||
if listView1.SelCount<1 then exit;
|
||||
|
||||
try
|
||||
fFileName:=ListView1.Selected.Caption;
|
||||
// ADOQueryTmp.Locate('fileName',fFileName,[]);
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
initData();
|
||||
|
||||
except
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton2Click(Sender: TObject);
|
||||
var
|
||||
SaveDialog: TSaveDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
begin
|
||||
if listView1.SelCount<1 then exit;
|
||||
|
||||
try
|
||||
|
||||
fFileName:=ListView1.Selected.Caption;
|
||||
|
||||
SaveDialog := TSaveDialog.Create(Self);
|
||||
|
||||
SaveDialog.FileName:=fFileName;
|
||||
if SaveDialog.Execute then
|
||||
begin
|
||||
Panel2.Caption:='正在保存数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
fFilePath:=SaveDialog.FileName;
|
||||
try
|
||||
IdFTP1.Host := '127.0.0.1';
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fFileName), fFilePath,false, true);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
end;
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
if fId=10 then Action:=cafree
|
||||
else
|
||||
Action:=cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.Panel2DblClick(Sender: TObject);
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton4Click(Sender: TObject);
|
||||
var
|
||||
fFilePath,FName:string;
|
||||
begin
|
||||
if Assigned(ShellListView1.Selected) then
|
||||
begin
|
||||
if ShellListView1.Selected.Selected then
|
||||
begin
|
||||
if ShellListView1.SelectedFolder.IsFolder then
|
||||
begin
|
||||
ShowMessage(ShellListView1.SelectedFolder.PathName);
|
||||
end
|
||||
else
|
||||
begin
|
||||
ShowMessage(ShellListView1.SelectedFolder.PathName);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
//if fFilePath <> '' then
|
||||
//fFilePath:=ShellListView1.SelectedFolder.PathName;
|
||||
// FName:=ShellListView1.SelectedFolder.DisplayName;
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host :='127.0.0.1';
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
IdFTP1.Put(ShellListView1.SelectedFolder.PathName, 'FJ\' +ShellListView1.SelectedFolder.PathName);
|
||||
IdFTP1.Quit;
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('上传客户图样文件失败,请检查文件服务器!', '提示', MB_ICONWARNING);
|
||||
end;
|
||||
end;
|
||||
IdFTP1.Quit;
|
||||
end;
|
||||
|
||||
end.
|
||||
183
云翔OA(WTOA.dll)/U_FjList_RZ.dfm
Normal file
183
云翔OA(WTOA.dll)/U_FjList_RZ.dfm
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
object frmFjList_RZ: TfrmFjList_RZ
|
||||
Left = 192
|
||||
Top = 134
|
||||
Width = 867
|
||||
Height = 502
|
||||
BorderIcons = [biSystemMenu, biMinimize]
|
||||
Caption = #38468#20214#20449#24687
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ListView1: TListView
|
||||
Left = 43
|
||||
Top = 22
|
||||
Width = 465
|
||||
Height = 83
|
||||
Columns = <>
|
||||
TabOrder = 0
|
||||
OnDblClick = ListView1DblClick
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 687
|
||||
Top = 0
|
||||
Width = 164
|
||||
Height = 462
|
||||
Align = alRight
|
||||
TabOrder = 1
|
||||
object FileName: TcxButton
|
||||
Left = 33
|
||||
Top = 65
|
||||
Width = 81
|
||||
Height = 27
|
||||
Hint = 'Filesother'
|
||||
Caption = #28155#21152
|
||||
TabOrder = 0
|
||||
OnClick = FileNameClick
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton1: TcxButton
|
||||
Left = 33
|
||||
Top = 104
|
||||
Width = 81
|
||||
Height = 27
|
||||
Hint = 'Filesother'
|
||||
Caption = #21024#38500
|
||||
TabOrder = 1
|
||||
OnClick = cxButton1Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton2: TcxButton
|
||||
Left = 33
|
||||
Top = 143
|
||||
Width = 81
|
||||
Height = 27
|
||||
Hint = 'Filesother'
|
||||
Caption = #19979#36733
|
||||
TabOrder = 2
|
||||
OnClick = cxButton2Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
object cxButton3: TcxButton
|
||||
Left = 33
|
||||
Top = 186
|
||||
Width = 81
|
||||
Height = 27
|
||||
Hint = 'Filesother'
|
||||
Caption = #20851#38381
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
OnClick = cxButton3Click
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 191
|
||||
Top = 152
|
||||
Width = 209
|
||||
Height = 44
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'Panel2'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
OnDblClick = Panel2DblClick
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 4
|
||||
Top = 22
|
||||
Width = 673
|
||||
Height = 391
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnDblClick = Tv1DblClick
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #25991#20214#21517#31216
|
||||
DataBinding.FieldName = 'FileName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 146
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #25991#20214#20462#25913#26102#38388
|
||||
DataBinding.FieldName = 'TFdate'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 140
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #25805#20316#21592
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 83
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #19978#20256#26102#38388
|
||||
DataBinding.FieldName = 'FillTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 140
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 28
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 568
|
||||
Top = 32
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
Left = 536
|
||||
Top = 228
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
MaxLineAction = maException
|
||||
ReadTimeout = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
Left = 500
|
||||
Top = 198
|
||||
end
|
||||
object ADOConnection1: TADOConnection
|
||||
LoginPrompt = False
|
||||
Left = 532
|
||||
Top = 240
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryTmp
|
||||
Left = 548
|
||||
Top = 140
|
||||
end
|
||||
end
|
||||
380
云翔OA(WTOA.dll)/U_FjList_RZ.pas
Normal file
380
云翔OA(WTOA.dll)/U_FjList_RZ.pas
Normal file
|
|
@ -0,0 +1,380 @@
|
|||
unit U_FjList_RZ;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, ComCtrls, Menus, cxLookAndFeelPainters, StdCtrls,
|
||||
cxButtons, DB, ADODB, ImgList,shellapi, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP, cxStyles, cxCustomData, cxGraphics,
|
||||
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid;
|
||||
|
||||
type
|
||||
TfrmFjList_RZ = class(TForm)
|
||||
ListView1: TListView;
|
||||
Panel1: TPanel;
|
||||
FileName: TcxButton;
|
||||
cxButton1: TcxButton;
|
||||
cxButton2: TcxButton;
|
||||
cxButton3: TcxButton;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ImageList1: TImageList;
|
||||
Panel2: TPanel;
|
||||
IdFTP1: TIdFTP;
|
||||
ADOConnection1: TADOConnection;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
DataSource1: TDataSource;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
procedure cxButton3Click(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FileNameClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ListView1DblClick(Sender: TObject);
|
||||
procedure cxButton1Click(Sender: TObject);
|
||||
procedure cxButton2Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure Panel2DblClick(Sender: TObject);
|
||||
procedure Tv1DblClick(Sender: TObject);
|
||||
private
|
||||
procedure InitData();
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO:string;
|
||||
fType:string;
|
||||
fId:integer;
|
||||
fstatus:integer;
|
||||
// fmanage:string;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFjList_RZ: TfrmFjList_RZ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10,U_CompressionFun;
|
||||
{$R *.dfm}
|
||||
procedure TfrmFjList_RZ.InitData();
|
||||
var
|
||||
ListItem: TListItem;
|
||||
Flag: Cardinal;
|
||||
info: SHFILEINFOA;
|
||||
Icon: TIcon;
|
||||
begin
|
||||
ListView1.Items.Clear;
|
||||
try
|
||||
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
open;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.cxButton3Click(Sender: TObject);
|
||||
begin
|
||||
ADOQueryTmp.Close;
|
||||
ADOQuerycmd.Close;
|
||||
ListView1.Items.Free;
|
||||
ModalResult:=-1;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFjList_RZ:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.FileNameClick(Sender: TObject);
|
||||
var
|
||||
OpenDiaLog: TOpenDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
maxNo:string;
|
||||
// myStream: TADOBlobStream;
|
||||
FJStream : TMemoryStream;
|
||||
mfileSize:integer;
|
||||
mCreationTime:TdateTime;
|
||||
mWriteTime:TdateTime;
|
||||
begin
|
||||
|
||||
try
|
||||
adoqueryCmd.Connection.BeginTrans;
|
||||
OpenDiaLog := TOpenDialog.Create(Self);
|
||||
if OpenDiaLog.Execute then
|
||||
begin
|
||||
fFilePath:=OpenDiaLog.FileName;
|
||||
fFileName:=ExtractFileName(OpenDiaLog.FileName);
|
||||
Panel2.Caption:='正在上传数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
|
||||
if GetLSNo(ADOQueryCmd,maxNo,'FJ','TP_File',4,1)=False then
|
||||
begin
|
||||
adoqueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
//获取文件信息
|
||||
GetFileInfo(fFilePath,mfileSize,mCreationTime,mWriteTime);
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where TFID='+quotedstr(trim(maxNO)));
|
||||
execsql;
|
||||
end;
|
||||
try
|
||||
FJStream:=TMemoryStream.Create;
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File ');
|
||||
sql.Add('where TFID='+quotedstr(trim(maxNO)));
|
||||
// sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
// sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
// sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
append;
|
||||
fieldbyname('TFID').Value:=trim(maxNO);
|
||||
fieldbyname('WBID').Value:=trim(fkeyNO);
|
||||
fieldbyname('TFType').Value:=trim(fType);
|
||||
fieldbyname('Filler').Value:=trim(DName);
|
||||
fieldbyname('FileName').Value:=trim(fFileName);
|
||||
fieldbyname('TFDate').Value:=mWriteTime;
|
||||
FJStream.LoadFromFile(fFilePath);
|
||||
CompressionStream(FJStream);
|
||||
tblobfield(FieldByName('Filesother')).LoadFromStream(FJStream);
|
||||
post;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
initdata();
|
||||
finally
|
||||
FJStream.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
adoqueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
adoqueryCmd.Connection.RollbackTrans;
|
||||
application.MessageBox('附件保存失败!','提示信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.FormCreate(Sender: TObject);
|
||||
begin
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
cxGrid1.Align:=alclient;
|
||||
fstatus:=0;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.FormShow(Sender: TObject);
|
||||
begin
|
||||
IF fstatus=0 then Panel1.Visible:=true
|
||||
else Panel1.Visible:=false;
|
||||
initdata();
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.ListView1DblClick(Sender: TObject);
|
||||
var
|
||||
sFieldName:string;
|
||||
fileName:string;
|
||||
begin
|
||||
if ListView1.Items.Count<1 THEN EXIT;
|
||||
|
||||
if listView1.SelCount<1 then exit;
|
||||
sFieldName:='D:\图片查看';
|
||||
|
||||
if not DirectoryExists(pchar(sFieldName)) then
|
||||
CreateDirectory(pchar(sFieldName),nil);
|
||||
|
||||
fileName:=ListView1.Selected.Caption;
|
||||
|
||||
sFieldName:=sFieldName+'\'+trim(fileName);
|
||||
|
||||
try
|
||||
IdFTP1.Host := PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fileName), sFieldName,false, true);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.cxButton1Click(Sender: TObject);
|
||||
var
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
begin
|
||||
// if listView1.SelCount<1 then exit;
|
||||
|
||||
IF ADOQueryTmp.IsEmpty then exit;
|
||||
|
||||
try
|
||||
// fFileName:=ListView1.Selected.Caption;
|
||||
// ADOQueryTmp.Locate('fileName',fFileName,[]);
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where TFID='+quotedstr(trim(ADOQueryTmp.fieldbyname('TFID').AsString)));
|
||||
// sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
// sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
initData();
|
||||
|
||||
except
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.cxButton2Click(Sender: TObject);
|
||||
var
|
||||
SaveDialog: TSaveDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
ff: TADOBlobStream;
|
||||
FJStream : TMemoryStream;
|
||||
begin
|
||||
if adoqueryTmp.IsEmpty then exit;
|
||||
|
||||
try
|
||||
|
||||
fFileName:=adoqueryTmp.fieldbyname('FileName').AsString;
|
||||
|
||||
SaveDialog := TSaveDialog.Create(Self);
|
||||
|
||||
SaveDialog.FileName:=fFileName;
|
||||
if SaveDialog.Execute then
|
||||
begin
|
||||
Panel2.Caption:='正在保存数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
fFilePath:=SaveDialog.FileName;
|
||||
|
||||
try
|
||||
ff := TADOBlobstream.Create(adoqueryTmp.fieldByName('FilesOther') as TblobField, bmRead);
|
||||
|
||||
fjStream:= TMemoryStream.Create ;
|
||||
ff.SaveToStream(fjStream);
|
||||
UnCompressionStream(fjStream);
|
||||
fjStream.SaveToFile(fFilePath);
|
||||
// ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
finally
|
||||
fjStream.free;
|
||||
ff.Free;
|
||||
end;
|
||||
|
||||
|
||||
Panel2.Visible:=false;
|
||||
// if IdFTP1.Connected then IdFTP1.Quit;
|
||||
end;
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
if fId=10 then Action:=cafree
|
||||
else
|
||||
Action:=cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.Panel2DblClick(Sender: TObject);
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList_RZ.Tv1DblClick(Sender: TObject);
|
||||
var
|
||||
sFieldName:string;
|
||||
fileName:string;
|
||||
ff: TADOBlobStream;
|
||||
FJStream : TMemoryStream;
|
||||
begin
|
||||
|
||||
IF adoqueryTmp.IsEmpty then exit;
|
||||
|
||||
sFieldName:='D:\图片查看';
|
||||
|
||||
if not DirectoryExists(pchar(sFieldName)) then
|
||||
CreateDirectory(pchar(sFieldName),nil);
|
||||
|
||||
fileName:=adoqueryTmp.fieldbyname('FileName').AsString;
|
||||
|
||||
sFieldName:=sFieldName+'\'+trim(fileName);
|
||||
|
||||
try
|
||||
ff := TADOBlobstream.Create(adoqueryTmp.fieldByName('FilesOther') as TblobField, bmRead);
|
||||
|
||||
fjStream:= TMemoryStream.Create ;
|
||||
ff.SaveToStream(fjStream);
|
||||
UnCompressionStream(fjStream);
|
||||
fjStream.SaveToFile(sFieldName);
|
||||
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
finally
|
||||
fjStream.free;
|
||||
ff.Free;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
713
云翔OA(WTOA.dll)/U_GRYearPFList.dfm
Normal file
713
云翔OA(WTOA.dll)/U_GRYearPFList.dfm
Normal file
|
|
@ -0,0 +1,713 @@
|
|||
object frmGRYearPFList: TfrmGRYearPFList
|
||||
Left = 190
|
||||
Top = 126
|
||||
Width = 1113
|
||||
Height = 577
|
||||
Caption = #20010#20154#24180#24230#35780#20998#33258#35780
|
||||
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 = 1097
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBUpdate: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBUpdateClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBTJ: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25552#20132
|
||||
ImageIndex = 31
|
||||
OnClick = TBTJClick
|
||||
end
|
||||
object TBCXTJ: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#25552#20132
|
||||
ImageIndex = 52
|
||||
OnClick = TBCXTJClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 465
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 528
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 591
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1097
|
||||
Height = 47
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 177
|
||||
Top = 18
|
||||
Width = 18
|
||||
Height = 12
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 18
|
||||
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 lbl1: TLabel
|
||||
Left = 310
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #34987#32771#26680#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 484
|
||||
Top = 18
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 664
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#24180#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 839
|
||||
Top = 17
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#26376#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 92
|
||||
Top = 14
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 195
|
||||
Top = 14
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object GRName: TEdit
|
||||
Tag = 2
|
||||
Left = 362
|
||||
Top = 14
|
||||
Width = 96
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object Dept: TEdit
|
||||
Tag = 2
|
||||
Left = 540
|
||||
Top = 14
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFYear: TEdit
|
||||
Tag = 2
|
||||
Left = 717
|
||||
Top = 13
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFMonth: TEdit
|
||||
Tag = 2
|
||||
Left = 892
|
||||
Top = 13
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 79
|
||||
Width = 1097
|
||||
Height = 21
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#25552#20132
|
||||
#24050#25552#20132
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 23
|
||||
ClientRectRight = 1097
|
||||
ClientRectTop = 23
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 100
|
||||
Width = 1097
|
||||
Height = 257
|
||||
Align = alTop
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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 = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Filltime: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'Filltime'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GRName: TcxGridDBColumn
|
||||
Caption = #34987#32771#26680#20154
|
||||
DataBinding.FieldName = 'GRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1PFNum: TcxGridDBColumn
|
||||
Caption = #33258#35780#24635#20998
|
||||
DataBinding.FieldName = 'PFNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1PFSJNum: TcxGridDBColumn
|
||||
Caption = #19978#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFSJNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1PFXJNum: TcxGridDBColumn
|
||||
Caption = #19979#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFXJNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object TVPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#24179#22343#20998
|
||||
DataBinding.FieldName = 'PFSumNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Dept: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'Dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object TVPFStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'PFStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GangWei: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'GangWei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #20837#32844#26085#26399
|
||||
DataBinding.FieldName = 'RZDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1PFMonth: TcxGridDBColumn
|
||||
Caption = #35780#20998#26376#20221
|
||||
DataBinding.FieldName = 'PFMonth'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1PFYear: TcxGridDBColumn
|
||||
Caption = #35780#20998#24180#20221
|
||||
DataBinding.FieldName = 'PFYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object TVv1PFNote: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'PFNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid3: TcxGrid
|
||||
Left = 913
|
||||
Top = 365
|
||||
Width = 184
|
||||
Height = 174
|
||||
Align = alClient
|
||||
TabOrder = 4
|
||||
object TV2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource3
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object V2Chker: TcxGridDBColumn
|
||||
Caption = #35780#20998#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object V2ChkStatus: TcxGridDBColumn
|
||||
Caption = #35780#20998#29366#24577
|
||||
DataBinding.FieldName = 'ChkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 0
|
||||
Top = 357
|
||||
Width = 1097
|
||||
Height = 8
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
AlignSplitter = salTop
|
||||
Control = cxGrid3
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 365
|
||||
Width = 913
|
||||
Height = 174
|
||||
Align = alLeft
|
||||
TabOrder = 6
|
||||
object TV3: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = Source1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn3
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn4
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = cxGridDBColumn5
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #35780#20215#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 596
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 74
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #33258#35780
|
||||
DataBinding.FieldName = 'PFZPNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 39
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #19978#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFSJNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 74
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #19979#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFXJNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 74
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV3
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 552
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 944
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1063
|
||||
Top = 3
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1097
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 208
|
||||
Top = 344
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 264
|
||||
Top = 352
|
||||
end
|
||||
object PF_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 304
|
||||
Top = 348
|
||||
end
|
||||
object DataSource3: TDataSource
|
||||
DataSet = PF_Sub
|
||||
Left = 360
|
||||
Top = 356
|
||||
end
|
||||
end
|
||||
513
云翔OA(WTOA.dll)/U_GRYearPFList.pas
Normal file
513
云翔OA(WTOA.dll)/U_GRYearPFList.pas
Normal file
|
|
@ -0,0 +1,513 @@
|
|||
unit U_GRYearPFList;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Filltime: TcxGridDBColumn;
|
||||
v1GRName: TcxGridDBColumn;
|
||||
v1PFSJNum: TcxGridDBColumn;
|
||||
TVv1PFNote: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
lbl1: TLabel;
|
||||
lbl3: TLabel;
|
||||
GRName: TEdit;
|
||||
Dept: TEdit;
|
||||
TBAdd: TToolButton;
|
||||
TVPFSumNum: TcxGridDBColumn;
|
||||
TVPFStatus: TcxGridDBColumn;
|
||||
TBTJ: TToolButton;
|
||||
TBCXTJ: TToolButton;
|
||||
TBUpdate: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
cxGrid3: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
v1PFXJNum: TcxGridDBColumn;
|
||||
v1GangWei: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1PFNum: TcxGridDBColumn;
|
||||
v1Dept: TcxGridDBColumn;
|
||||
v1PFMonth: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
PFYear: TEdit;
|
||||
Label4: TLabel;
|
||||
PFMonth: TEdit;
|
||||
v1PFYear: TcxGridDBColumn;
|
||||
cxGrid2: TcxGrid;
|
||||
TV3: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
V2Chker: TcxGridDBColumn;
|
||||
V2ChkStatus: TcxGridDBColumn;
|
||||
PF_Sub: TClientDataSet;
|
||||
DataSource3: TDataSource;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBUpdateClick(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure GRNameChange(Sender: TObject);
|
||||
procedure TBTJClick(Sender: TObject);
|
||||
procedure TBCXTJClick(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList: TfrmGRYearPFList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFlist.setstatus();
|
||||
begin
|
||||
TBUpdate.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBTJ.Visible:=False;
|
||||
TBCXTJ.Visible:=False;
|
||||
TBAdd.Visible:=False;
|
||||
cxTabControl1.Visible:=true;
|
||||
if trim(DParameters1)<>'高权限' then
|
||||
begin
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TBUpdate.Visible:=true;
|
||||
TBDel.Visible:=true;
|
||||
TBTJ.Visible:=true;
|
||||
TBAdd.Visible:=true;
|
||||
end;
|
||||
1:begin
|
||||
TBCXTJ.Visible:=true;
|
||||
end;
|
||||
2:begin
|
||||
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
cxTabControl1.Visible:=False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('个人年度考核评分',Tv1,'薪酬管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.InitGrid();
|
||||
begin
|
||||
with ADOQueryMain DO
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_Sub ');
|
||||
sql.Add('where Filltime>='''+formatdatetime('yyyy-MM-dd',BegDate.Time)+''' ');
|
||||
sql.Add('and Filltime<'''+formatdatetime('yyyy-MM-dd',enddate.Time+1)+''' ');
|
||||
if Trim(DParameters1)<>'高权限' then
|
||||
begin
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
sql.Add('and PFStatus=''待提交'' ');
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
sql.Add('and pfstatus<>''待提交'' ');
|
||||
sql.Add('and GRName='''+trim(DName)+'''');
|
||||
end
|
||||
else
|
||||
begin
|
||||
sql.Add('and PFStatus=''评分完成'' ');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-15;
|
||||
ReadCxGrid('个人年度考核评分',Tv1,'薪酬管理');
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('个人年度评分',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.ToolButton1Click(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 TfrmGRYearPFList.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBAddClick(Sender: TObject);
|
||||
var FYear,FMonth:string;
|
||||
begin
|
||||
frmGRYearPFList_Sub:=TfrmGRYearPFList_Sub.Create(self);
|
||||
with frmGRYearPFList_Sub do
|
||||
begin
|
||||
PFSubID:='';
|
||||
Formid:='0';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBUpdateClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
frmGRYearPFList_Sub:=TfrmGRYearPFList_Sub.Create(self);
|
||||
with frmGRYearPFList_Sub do
|
||||
begin
|
||||
PFSubID:=Trim(Order_Main.fieldbyname('PFSubID').AsString);
|
||||
Formid:='1';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Application.MessageBox('确定要删除吗','提示',1)=2 then exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from GRYearPF_Sub where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+''' ');
|
||||
SQL.Add('delete from GRYearPF_SubMX where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+'''');
|
||||
sql.add('delete from GRYearPFWB_SubMX where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+'''');
|
||||
sql.add('delete from GRYearPFWB_Sub where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.GRNameChange(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 TfrmGRYearPFList.TBTJClick(Sender: TObject);
|
||||
var maxno: string;
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
||||
with frmZDYHelpSel do
|
||||
begin
|
||||
flag:='KHPFR';
|
||||
flagname:='考核评分人';
|
||||
MainType:=Trim(DName);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where UserName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('评分人定义错误!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
sql.Add(' and isnull(Chker,'''')='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'PF','OA_Chk',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where 1=2 ');
|
||||
Open;
|
||||
append;
|
||||
FieldByName('CKID').Value:=Trim(maxno);
|
||||
FieldByName('Mainid').Value:=Trim(Order_Main.fieldbyname('PFSubID').AsString);
|
||||
FieldByName('OAType').value:='考核评分';
|
||||
FieldByName('Chker').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPF_Sub set PFStatus=''已提交'' ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList.TBCXTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Application.MessageBox('确定要撤销吗','提示',1)=2 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPF_Sub set PFStatus=''待提交'' ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from OA_Chk where MainId='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
end.
|
||||
447
云翔OA(WTOA.dll)/U_GRYearPFList_FHDQDJ.dfm
Normal file
447
云翔OA(WTOA.dll)/U_GRYearPFList_FHDQDJ.dfm
Normal file
|
|
@ -0,0 +1,447 @@
|
|||
object frmGRYearPFList_FHDQDJ: TfrmGRYearPFList_FHDQDJ
|
||||
Left = 189
|
||||
Top = 128
|
||||
Width = 1161
|
||||
Height = 602
|
||||
Caption = #20998#32418#26723#26399#30331#35760
|
||||
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 = 1145
|
||||
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_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TSel: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = TSelClick
|
||||
end
|
||||
object TBRafresh: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 0
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBSave: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 441
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1145
|
||||
Height = 47
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 177
|
||||
Top = 18
|
||||
Width = 18
|
||||
Height = 12
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #26597#35810#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 92
|
||||
Top = 14
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 195
|
||||
Top = 14
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 79
|
||||
Width = 1145
|
||||
Height = 485
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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 = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Ssel: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 50
|
||||
end
|
||||
object v1QSDate: TcxGridDBColumn
|
||||
Caption = #36215#22987#26085#26399
|
||||
DataBinding.FieldName = 'QSDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 100
|
||||
end
|
||||
object v1JSDate: TcxGridDBColumn
|
||||
Caption = #32467#26463#26085#26399
|
||||
DataBinding.FieldName = 'JSDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 82
|
||||
end
|
||||
object v1FHYear: TcxGridDBColumn
|
||||
Caption = #24180#20221
|
||||
DataBinding.FieldName = 'FHYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 73
|
||||
end
|
||||
object v1XSMBMoney: TcxGridDBColumn
|
||||
Caption = #38144#21806#30446#26631#37329#39069
|
||||
DataBinding.FieldName = 'XSMBMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = cxStyle1
|
||||
Width = 102
|
||||
end
|
||||
object v1PriceUnit: TcxGridDBColumn
|
||||
Caption = #24065#31181
|
||||
DataBinding.FieldName = 'PriceUnit'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1PriceUnitPropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Focusing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1HuiLV: TcxGridDBColumn
|
||||
Caption = #27719#29575
|
||||
DataBinding.FieldName = 'HuiLV'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object TVYXSMoney: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #24050#23436#25104#37329#39069
|
||||
DataBinding.FieldName = 'YXSMoney'
|
||||
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||
Properties.DisplayFormat = '0.00'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = cxStyle2
|
||||
Width = 94
|
||||
end
|
||||
object v1WCLv: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #23436#25104#24230#65288'%'#65289
|
||||
DataBinding.FieldName = 'WCLv'
|
||||
PropertiesClassName = 'TcxCurrencyEditProperties'
|
||||
Properties.DisplayFormat = '0.000'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 88
|
||||
end
|
||||
object v1FHZMoney: TcxGridDBColumn
|
||||
Tag = 1
|
||||
Caption = #20998#32418#24635#37329#39069
|
||||
DataBinding.FieldName = 'FHZMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 83
|
||||
end
|
||||
object TVFHStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'FHStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 97
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 380
|
||||
Top = 240
|
||||
Width = 213
|
||||
Height = 45
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = #27491#22312#32479#35745#25968#25454','#35831#31245#31561#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 = 3
|
||||
Visible = False
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 512
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 944
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 544
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1023
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1061
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
Left = 65532
|
||||
Top = 4
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clRed
|
||||
end
|
||||
end
|
||||
end
|
||||
327
云翔OA(WTOA.dll)/U_GRYearPFList_FHDQDJ.pas
Normal file
327
云翔OA(WTOA.dll)/U_GRYearPFList_FHDQDJ.pas
Normal file
|
|
@ -0,0 +1,327 @@
|
|||
unit U_GRYearPFList_FHDQDJ;
|
||||
|
||||
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, cxCheckBox, Menus, cxCurrencyEdit;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_FHDQDJ = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1QSDate: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
TBAdd: TToolButton;
|
||||
TVYXSMoney: TcxGridDBColumn;
|
||||
TVFHStatus: TcxGridDBColumn;
|
||||
TBDel: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
v1XSMBMoney: TcxGridDBColumn;
|
||||
v1JSDate: TcxGridDBColumn;
|
||||
v1WCLv: TcxGridDBColumn;
|
||||
v1PriceUnit: TcxGridDBColumn;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
v1Ssel: TcxGridDBColumn;
|
||||
TSel: TToolButton;
|
||||
v1FHZMoney: TcxGridDBColumn;
|
||||
v1HuiLV: TcxGridDBColumn;
|
||||
Panel2: TPanel;
|
||||
v1FHYear: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure v1PriceUnitPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure TSelClick(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
{ Private declarations }
|
||||
public
|
||||
Formid: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_FHDQDJ: TfrmGRYearPFList_FHDQDJ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_FHDQDJ:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('分红档期登记',Tv1,'分红管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.InitGrid();
|
||||
begin
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_FH_WCMoney '''+trim(formatdatetime('yyyy-MM-dd',begdate.DateTime))+'''');
|
||||
sql.Add(','''+trim(formatdatetime('yyyy-MM-dd',enddate.DateTime+1))+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.fieldbyname('WCLv').AsFloat>=100 then
|
||||
begin
|
||||
with order_Main do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('FHStatus').AsString:='已完成';
|
||||
fieldbyname('FHZMoney').AsFloat:=1000000;
|
||||
post;
|
||||
end;
|
||||
end;
|
||||
if (Order_Main.fieldbyname('WCLv').AsFloat>=50) and (Order_Main.fieldbyname('WCLv').AsFloat<100) then
|
||||
begin
|
||||
with order_Main do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('FHStatus').AsString:='未完成';
|
||||
fieldbyname('FHZMoney').AsFloat:=fieldbyname('WCLv').AsFloat*10000;
|
||||
post;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.InitForm();
|
||||
begin
|
||||
begdate.Date:=strtodate(formatdateTime('yyyy',SGetServerDate(ADOQueryTemp))+'-01-01');
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
ReadCxGrid('分红档期登记',Tv1,'分红管理');
|
||||
TBAdd.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBSave.Visible:=False;
|
||||
TBExport.Visible:=False;
|
||||
Tsel.Visible:=False;
|
||||
if Formid<>'99' then
|
||||
begin
|
||||
TBAdd.Visible:=True;
|
||||
TBDel.Visible:=True;
|
||||
TBSave.Visible:=True;
|
||||
TBExport.Visible:=True;
|
||||
end
|
||||
else
|
||||
begin
|
||||
TSel.Visible:=True;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('分红档期',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
Panel2.Visible:=True;
|
||||
Panel2.Refresh;
|
||||
InitGrid();
|
||||
Panel2.Visible:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if application.MessageBox('确定要删除吗','提示',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from GRYearFH_Main ');
|
||||
sql.add('where FHID='''+trim(Order_Main.fieldbyname('FHID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TBSaveClick(Sender: TObject);
|
||||
var maxno: string;
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('HuiLV').AsFloat=0 then
|
||||
begin
|
||||
application.MessageBox('汇率不能为空','提示');
|
||||
exit;
|
||||
end;
|
||||
if fieldbyname('FHYear').asstring='' then
|
||||
begin
|
||||
application.MessageBox('年份不能为空','提示');
|
||||
exit;
|
||||
end;
|
||||
if fieldbyname('FHID').AsString='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'FH','GRYearFH_Main',3,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取主流水号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
maxno:=fieldbyname('FHID').AsString;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearFH_Main ');
|
||||
sql.add('where FHID='''+trim(maxno)+'''');
|
||||
open;
|
||||
if isempty then append
|
||||
else edit;
|
||||
fieldbyname('FHID').AsString:=trim(maxno);
|
||||
fieldbyname('HuiLV').Value:=fieldbyname('HuiLV').AsFloat;
|
||||
RTSetSaveDataCDS(ADOQueryCmd,Tv1,Order_Main,'GRYearFH_Main',0);
|
||||
post;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
application.MessageBox('保存成功','提示');
|
||||
initGrid();
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
with Order_Main do
|
||||
begin
|
||||
append;
|
||||
fieldbyname('FHStatus').AsString:='未完成';
|
||||
fieldbyname('PriceUnit').AsString:='$';
|
||||
fieldbyname('HuiLV').Value:=6.3;
|
||||
post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.v1PriceUnitPropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='PriceUnit';
|
||||
flagname:='币种';
|
||||
if showModal=1 then
|
||||
begin
|
||||
with Order_Main do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('PriceUnit').asstring:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.TSelClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_FHDQDJ.Tv1CellDblClick(
|
||||
Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
TSel.Click;
|
||||
end;
|
||||
|
||||
end.
|
||||
704
云翔OA(WTOA.dll)/U_GRYearPFList_NB.dfm
Normal file
704
云翔OA(WTOA.dll)/U_GRYearPFList_NB.dfm
Normal file
|
|
@ -0,0 +1,704 @@
|
|||
object frmGRYearPFList_NB: TfrmGRYearPFList_NB
|
||||
Left = 190
|
||||
Top = 89
|
||||
Width = 1165
|
||||
Height = 635
|
||||
Caption = #20010#20154#24180#24230#35780#20998#20869#37096
|
||||
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 = 1149
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBTJ: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #35780#20998#23436#25104
|
||||
ImageIndex = 31
|
||||
OnClick = TBTJClick
|
||||
end
|
||||
object TBCXTJ: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144
|
||||
ImageIndex = 52
|
||||
OnClick = TBCXTJClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 402
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1149
|
||||
Height = 47
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 177
|
||||
Top = 18
|
||||
Width = 18
|
||||
Height = 12
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 18
|
||||
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 lbl1: TLabel
|
||||
Left = 310
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #34987#32771#26680#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 492
|
||||
Top = 18
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 680
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#24180#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 863
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#26376#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 92
|
||||
Top = 14
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 195
|
||||
Top = 14
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object GRName: TEdit
|
||||
Tag = 2
|
||||
Left = 362
|
||||
Top = 14
|
||||
Width = 96
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object Dept: TEdit
|
||||
Tag = 2
|
||||
Left = 548
|
||||
Top = 14
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFYear: TEdit
|
||||
Tag = 2
|
||||
Left = 733
|
||||
Top = 14
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFMonth: TEdit
|
||||
Tag = 2
|
||||
Left = 916
|
||||
Top = 14
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 79
|
||||
Width = 1149
|
||||
Height = 21
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#35780#20998
|
||||
#24050#35780#20998
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 23
|
||||
ClientRectRight = 1149
|
||||
ClientRectTop = 23
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 100
|
||||
Width = 1149
|
||||
Height = 241
|
||||
Align = alTop
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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 = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1PFDate: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'Filltime'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GRName: TcxGridDBColumn
|
||||
Caption = #34987#32771#26680#20154
|
||||
DataBinding.FieldName = 'GRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1PFNum: TcxGridDBColumn
|
||||
Caption = #33258#35780#24635#20998
|
||||
DataBinding.FieldName = 'PFNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1PFSJNum: TcxGridDBColumn
|
||||
Caption = #19978#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFSJNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1PFXJNum: TcxGridDBColumn
|
||||
Caption = #19979#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFXJNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object TVPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#24179#22343#20998
|
||||
DataBinding.FieldName = 'PFSumNum'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Dept: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'Dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object TVPFStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'PFStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GangWei: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'GangWei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #20837#32844#26085#26399
|
||||
DataBinding.FieldName = 'RZDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1PFYear: TcxGridDBColumn
|
||||
Caption = #35780#20998#24180#20221
|
||||
DataBinding.FieldName = 'PFYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #35780#20998#26376#20221
|
||||
DataBinding.FieldName = 'PFMonth'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object TVv1PFNote: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'PFNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid3: TcxGrid
|
||||
Left = 0
|
||||
Top = 349
|
||||
Width = 949
|
||||
Height = 248
|
||||
Align = alLeft
|
||||
TabOrder = 4
|
||||
object TV2: TcxGridDBTableView
|
||||
OnKeyUp = TV2KeyUp
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = Source1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFZPNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFSJNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFXJNum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object TPFYDian: TcxGridDBColumn
|
||||
Caption = #35780#20215#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 596
|
||||
end
|
||||
object TPFMNum: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 74
|
||||
end
|
||||
object TPFZPNum: TcxGridDBColumn
|
||||
Caption = #33258#35780
|
||||
DataBinding.FieldName = 'PFZPNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 53
|
||||
end
|
||||
object TPFSJNum: TcxGridDBColumn
|
||||
Caption = #19978#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFSJNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = TPFSJNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 75
|
||||
end
|
||||
object TPFXJNum: TcxGridDBColumn
|
||||
Caption = #19979#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFXJNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = TPFXJNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object TPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#20998
|
||||
DataBinding.FieldName = 'PFSumNum'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 87
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 0
|
||||
Top = 341
|
||||
Width = 1149
|
||||
Height = 8
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
AlignSplitter = salTop
|
||||
Control = cxGrid3
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 949
|
||||
Top = 349
|
||||
Width = 200
|
||||
Height = 248
|
||||
Align = alClient
|
||||
TabOrder = 6
|
||||
object TV3: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object V2Chker: TcxGridDBColumn
|
||||
Caption = #35780#20998#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object V2ChkStatus: TcxGridDBColumn
|
||||
Caption = #35780#20998#29366#24577
|
||||
DataBinding.FieldName = 'ChkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV3
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 516
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 968
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
Top = 4
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1031
|
||||
Top = 3
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 905
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 208
|
||||
Top = 344
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 264
|
||||
Top = 352
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = PF_Sub
|
||||
Left = 304
|
||||
Top = 376
|
||||
end
|
||||
object PF_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 344
|
||||
Top = 372
|
||||
end
|
||||
end
|
||||
490
云翔OA(WTOA.dll)/U_GRYearPFList_NB.pas
Normal file
490
云翔OA(WTOA.dll)/U_GRYearPFList_NB.pas
Normal file
|
|
@ -0,0 +1,490 @@
|
|||
unit U_GRYearPFList_NB;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_NB = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1PFDate: TcxGridDBColumn;
|
||||
v1GRName: TcxGridDBColumn;
|
||||
v1PFSJNum: TcxGridDBColumn;
|
||||
TVv1PFNote: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
lbl1: TLabel;
|
||||
lbl3: TLabel;
|
||||
GRName: TEdit;
|
||||
Dept: TEdit;
|
||||
TVPFSumNum: TcxGridDBColumn;
|
||||
TVPFStatus: TcxGridDBColumn;
|
||||
TBTJ: TToolButton;
|
||||
TBCXTJ: TToolButton;
|
||||
cxGrid3: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
TPFYDian: TcxGridDBColumn;
|
||||
TPFMNum: TcxGridDBColumn;
|
||||
TPFZPNum: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
cxSplitter1: TcxSplitter;
|
||||
TPFSJNum: TcxGridDBColumn;
|
||||
TPFXJNum: TcxGridDBColumn;
|
||||
TPFSumNum: TcxGridDBColumn;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
v1PFXJNum: TcxGridDBColumn;
|
||||
v1GangWei: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1PFNum: TcxGridDBColumn;
|
||||
v1Dept: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
PFYear: TEdit;
|
||||
Label4: TLabel;
|
||||
PFMonth: TEdit;
|
||||
v1PFYear: TcxGridDBColumn;
|
||||
cxGrid2: TcxGrid;
|
||||
TV3: TcxGridDBTableView;
|
||||
V2Chker: TcxGridDBColumn;
|
||||
V2ChkStatus: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource2: TDataSource;
|
||||
PF_Sub: TClientDataSet;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure GRNameChange(Sender: TObject);
|
||||
procedure TBTJClick(Sender: TObject);
|
||||
procedure TBCXTJClick(Sender: TObject);
|
||||
procedure TPFSJNumPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure TPFXJNumPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure TV2KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure Setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_NB: TfrmGRYearPFList_NB;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFlist_NB.setstatus();
|
||||
begin
|
||||
TBTJ.Visible:=False;
|
||||
TBCXTJ.Visible:=False;
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TBTJ.Visible:=true;
|
||||
end;
|
||||
1:begin
|
||||
TBCXTJ.Visible:=true;
|
||||
end;
|
||||
2:begin
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_NB:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('个人年度考核评分',Tv1,'薪酬管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.InitGrid();
|
||||
begin
|
||||
with ADOQueryMain DO
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from GRYearPF_Sub A ');
|
||||
sql.Add('inner join OA_Chk B on B.Mainid=A.PFSubid and isnull(OAType,'''')=''考核评分'' ');
|
||||
if cxTabControl1.TabIndex<>0 then
|
||||
begin
|
||||
sql.Add('where A.Filltime>='''+formatdatetime('yyyy-MM-dd',BegDate.Time)+''' ');
|
||||
sql.Add('and A.Filltime<'''+formatdatetime('yyyy-MM-dd',enddate.Time+1)+''' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.Add('where isnull(B.ChkStatus,'''')='''' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add('and isnull(B.ChkStatus,'''')=''已评分'' ');
|
||||
end;
|
||||
sql.Add('and B.Chker='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-7;
|
||||
ReadCxGrid('个人年度考核评分',Tv1,'薪酬管理');
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('个人年度评分',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.ToolButton1Click(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 TfrmGRYearPFList_NB.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.GRNameChange(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 TfrmGRYearPFList_NB.TBTJClick(Sender: TObject);
|
||||
var maxno: string;
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
with Order_Sub do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPF_SubMX set PFZPNum='''+trim(Order_Sub.FieldByName('PFZPNum').AsString)+'''');
|
||||
if Order_Sub.FieldByName('PFSJNum').AsString<>'' then
|
||||
begin
|
||||
sql.Add(',PFSJNum='''+trim(Order_Sub.FieldByName('PFSJNum').AsString)+''' ');
|
||||
end;
|
||||
if Order_Sub.FieldByName('PFXJNum').AsString<>'' then
|
||||
begin
|
||||
sql.Add(',PFXJNum='''+trim(Order_Sub.FieldByName('PFXJNum').AsString)+''' ');
|
||||
end;
|
||||
SQL.Add(',PFSumNum=PFZPNum+isnull(PFSJNum,0)+isnull(PFXJNum,0) ');
|
||||
sql.Add('where PFSubMXID='''+trim(Order_Sub.FieldByName('PFSubMXID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPF_Sub set ');
|
||||
sql.Add('PFSJNum=(select isnull(sum(PFSJNum),0) from GRYearPF_SubMX where PFSubid=GRYearPF_Sub.PFsubid)');
|
||||
sql.Add(',PFXJNum=(select isnull(sum(PFXJNum),0) from GRYearPF_SubMX where PFSubid=GRYearPF_Sub.PFsubid) ');
|
||||
sql.add('where PFSubID='''+trim(Order_Main.FieldByName('PFSubID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_Chk set ChkStatus=''已评分'' ');
|
||||
sql.Add('where CKID='''+trim(Order_Main.fieldbyname('CKID').asstring)+''' ');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk ');
|
||||
sql.Add('where Mainid='''+trim(Order_Main.fieldbyname('PFSubid').asstring)+''' ');
|
||||
sql.Add('and isnull(OAType,'''')=''考核评分'' ');
|
||||
sql.Add('and isnull(Chkstatus,'''')<>''已评分''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPF_Sub set PFStatus=''评分完成'', ');
|
||||
sql.Add('PFSumNum=(case when isnull(PFSJNum,0)<>0 and isnull(PFXJNum,0)<>0 then ');
|
||||
sql.Add('(PFNum+isnull(PFXJNum,0)+isnull(PFSJNum,0))/3 ');
|
||||
sql.Add('else (PFNum+isnull(PFXJNum,0)+isnull(PFSJNum,0))/2 end) ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TBCXTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Application.MessageBox('确定要撤销吗','提示',1)=2 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_Chk set Chkstatus='''' where CKID='''+trim(Order_Main.fieldbyname('CKID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核评分'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPF_Sub set PFStatus=''已提交'' ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TPFSJNumPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var mvalue: string;
|
||||
begin
|
||||
{mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if strtofloat(mvalue)>Order_Sub.fieldbyname('PFMNum').asfloat then
|
||||
begin
|
||||
application.messagebox('评分不能超过满分','提示');
|
||||
mvalue:='';
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('PFSJNum').Value:=Trim(mvalue);
|
||||
FieldByName('PFSumNum').Value:=fieldbyname('PFZPNum').AsFloat+fieldbyname('PFSJNum').AsFloat+fieldbyname('PFXJNum').AsFloat;
|
||||
Post;
|
||||
end;}
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TPFXJNumPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var mvalue: string;
|
||||
begin
|
||||
{mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if strtofloat(mvalue)>Order_Sub.fieldbyname('PFMNum').asfloat then
|
||||
begin
|
||||
application.messagebox('评分不能超过满分','提示');
|
||||
mvalue:='';
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('PFXJNum').Value:=Trim(mvalue);
|
||||
FieldByName('PFSumNum').Value:=fieldbyname('PFZPNum').AsFloat+fieldbyname('PFSJNum').AsFloat+fieldbyname('PFXJNum').AsFloat;
|
||||
Post;
|
||||
end;}
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_NB.TV2KeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
TV2.DataController.GotoNext;
|
||||
end;
|
||||
|
||||
end.
|
||||
424
云翔OA(WTOA.dll)/U_GRYearPFList_Sub.dfm
Normal file
424
云翔OA(WTOA.dll)/U_GRYearPFList_Sub.dfm
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
object frmGRYearPFList_Sub: TfrmGRYearPFList_Sub
|
||||
Left = 225
|
||||
Top = 129
|
||||
Width = 951
|
||||
Height = 583
|
||||
Caption = #32771#26680#35780#20998#30331#35760
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
WindowState = wsMaximized
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 935
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 935
|
||||
Height = 104
|
||||
Align = alTop
|
||||
BevelInner = bvNone
|
||||
BevelOuter = bvNone
|
||||
Ctl3D = False
|
||||
ParentCtl3D = False
|
||||
TabOrder = 1
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 933
|
||||
Height = 102
|
||||
Align = alClient
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
Left = 32
|
||||
Top = 19
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #34987#32771#26680#20154#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 218
|
||||
Top = 48
|
||||
Width = 66
|
||||
Height = 12
|
||||
Caption = #24635' '#37096' '#38376#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 218
|
||||
Top = 19
|
||||
Width = 66
|
||||
Height = 12
|
||||
Caption = #23376' '#37096' '#38376#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label6: TLabel
|
||||
Left = 407
|
||||
Top = 19
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20837#32844#26085#26399#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 596
|
||||
Top = 19
|
||||
Width = 67
|
||||
Height = 12
|
||||
Caption = #23703' '#20301#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 407
|
||||
Top = 48
|
||||
Width = 67
|
||||
Height = 12
|
||||
Caption = #22791' '#27880#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 32
|
||||
Top = 48
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #35780#20998#26376#20221#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 32
|
||||
Top = 79
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #35780#20998#24180#20221#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object PFDate: TDateTimePicker
|
||||
Left = 357
|
||||
Top = 108
|
||||
Width = 102
|
||||
Height = 20
|
||||
BevelInner = bvNone
|
||||
Date = 40916.000000000000000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40916.000000000000000000
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
end
|
||||
object Dept: TBtnEditA
|
||||
Left = 279
|
||||
Top = 15
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnBtnClick = DeptBtnClick
|
||||
end
|
||||
object GRName: TEdit
|
||||
Left = 93
|
||||
Top = 16
|
||||
Width = 100
|
||||
Height = 18
|
||||
TabOrder = 2
|
||||
end
|
||||
object RZDate: TDateTimePicker
|
||||
Left = 466
|
||||
Top = 15
|
||||
Width = 102
|
||||
Height = 20
|
||||
BevelInner = bvNone
|
||||
Date = 40916.000000000000000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40916.000000000000000000
|
||||
TabOrder = 3
|
||||
end
|
||||
object PFNote: TEdit
|
||||
Left = 466
|
||||
Top = 45
|
||||
Width = 293
|
||||
Height = 18
|
||||
TabOrder = 4
|
||||
end
|
||||
object ZDept: TBtnEditA
|
||||
Left = 279
|
||||
Top = 44
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnBtnClick = ZDeptBtnClick
|
||||
end
|
||||
object GangWei: TBtnEditA
|
||||
Left = 659
|
||||
Top = 15
|
||||
Width = 100
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnBtnClick = GangWeiBtnClick
|
||||
end
|
||||
object PFMonth: TComboBox
|
||||
Left = 92
|
||||
Top = 44
|
||||
Width = 103
|
||||
Height = 20
|
||||
ItemHeight = 12
|
||||
TabOrder = 7
|
||||
Items.Strings = (
|
||||
'1'
|
||||
'2'
|
||||
'3'
|
||||
'4'
|
||||
'5'
|
||||
'6'
|
||||
'7'
|
||||
'8'
|
||||
'9'
|
||||
'10'
|
||||
'11'
|
||||
'12')
|
||||
end
|
||||
object PFYear: TEdit
|
||||
Left = 93
|
||||
Top = 76
|
||||
Width = 100
|
||||
Height = 18
|
||||
TabOrder = 8
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 162
|
||||
Width = 935
|
||||
Height = 383
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnKeyUp = Tv1KeyUp
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = 'C_Code'
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1PFZPNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.GroupByBox = DataLink_WTOA.Default
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1PFYDian: TcxGridDBColumn
|
||||
Caption = #35780#35770#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 610
|
||||
end
|
||||
object v1PFMNum: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 71
|
||||
end
|
||||
object v1PFZPNum: TcxGridDBColumn
|
||||
Caption = #33258#35780
|
||||
DataBinding.FieldName = 'PFZPNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = v1PFZPNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 78
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 133
|
||||
Width = 935
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar2'
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 3
|
||||
object ToolButton2: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
end
|
||||
object ADOTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 634
|
||||
Top = 2
|
||||
end
|
||||
object ADOCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 565
|
||||
Top = 3
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 375
|
||||
Top = 440
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 405
|
||||
Top = 442
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 599
|
||||
Top = 4
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 348
|
||||
Top = 443
|
||||
end
|
||||
end
|
||||
664
云翔OA(WTOA.dll)/U_GRYearPFList_Sub.pas
Normal file
664
云翔OA(WTOA.dll)/U_GRYearPFList_Sub.pas
Normal file
|
|
@ -0,0 +1,664 @@
|
|||
unit U_GRYearPFList_Sub;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
||||
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
||||
ExtCtrls, BtnEdit, cxDropDownEdit, cxCalendar, cxGridCustomPopupMenu,
|
||||
cxGridPopupMenu;
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_Sub = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ScrollBox1: TScrollBox;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
ADOTemp: TADOQuery;
|
||||
ADOCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
ADOQuery1: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
PFDate: TDateTimePicker;
|
||||
Dept: TBtnEditA;
|
||||
GRName: TEdit;
|
||||
Label6: TLabel;
|
||||
RZDate: TDateTimePicker;
|
||||
lbl1: TLabel;
|
||||
v1PFYDian: TcxGridDBColumn;
|
||||
v1PFMNum: TcxGridDBColumn;
|
||||
v1PFZPNum: TcxGridDBColumn;
|
||||
Label5: TLabel;
|
||||
PFNote: TEdit;
|
||||
ZDept: TBtnEditA;
|
||||
GangWei: TBtnEditA;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton2: TToolButton;
|
||||
PFMonth: TComboBox;
|
||||
Label7: TLabel;
|
||||
Label2: TLabel;
|
||||
PFYear: TEdit;
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure WorkerBtnClick(Sender: TObject);
|
||||
procedure v1Column3PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column3PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1Column9PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column1PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1priceUnitPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure DeptBtnClick(Sender: TObject);
|
||||
procedure v1ZhaiYaoPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1PFZPNumPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure ZDeptBtnClick(Sender: TObject);
|
||||
procedure GangWeiBtnClick(Sender: TObject);
|
||||
procedure Tv1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
private
|
||||
FXS:Integer;
|
||||
procedure InitData();
|
||||
function SaveData():Boolean;
|
||||
procedure InitDataXG();
|
||||
{ Private declarations }
|
||||
public
|
||||
PState:Integer;
|
||||
FormId,PFSubID:String;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_Sub: TfrmGRYearPFList_Sub;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_ZDYHelp,U_RTFun,U_GYSList,U_ZDYHelpSel,U_YGCXList,
|
||||
U_SYDeptUserView, U_SYDeptView;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('考核评分登记',Tv1,'薪酬管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.InitData();
|
||||
var FDPID,FDEPT: string;
|
||||
Fint: integer;
|
||||
begin
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select dateadd(month,-1,getdate()) PFfilltime,A.*,B.* ');
|
||||
sql.add('from OA_YG_DangAn A ');
|
||||
sql.Add('inner join SY_Dept B on A.DPID=B.DPID');
|
||||
SQL.Add('where isnull(A.YGEName,YGName)='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
Dept.Text:=Trim(ADOQuery1.fieldbyname('Dept').AsString);
|
||||
RZDate.DateTime:=ADOQuery1.fieldbyname('ZhuanZhengDate').AsDateTime;
|
||||
GangWei.text:=ADOQuery1.fieldbyname('GangWei').AsString;
|
||||
PFDate.DateTime:=ADOQuery1.fieldbyname('PFfilltime').AsDateTime;
|
||||
PFMonth.Text:=uppercase(formatdatetime('MM',ADOQuery1.fieldbyname('PFfilltime').AsDateTime));
|
||||
PFYear.Text:=uppercase(formatdatetime('yyyy',ADOQuery1.fieldbyname('PFfilltime').AsDateTime));
|
||||
GRName.Text:=Trim(DName);
|
||||
FDPID:=Trim(ADOQuery1.fieldbyname('DPID').AsString);
|
||||
FDEPT:=Trim(ADOQuery1.fieldbyname('DPParent').AsString);
|
||||
for Fint:=2 to ADOQuery1.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDEPT)+'''');
|
||||
open;
|
||||
end;
|
||||
FDEPT:=Trim(ADOCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
if ADOCmd.IsEmpty=False then
|
||||
ZDept.Text:=trim(ADOCmd.fieldbyname('DPName').asstring);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add(' where PFSubID='''+Trim(PFSubID)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQuery1,Order_Sub);
|
||||
SInitCDSData20(ADOQuery1,Order_Sub);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from PF_User where DPID='''+trim(FDPID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('PFYDian').Value:=ADOQuery1.fieldbyname('PFYDian').AsString;
|
||||
FieldByName('PFMNum').Value:=ADOQuery1.fieldbyname('PFMNum').AsFloat;
|
||||
post;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.InitDataXG();
|
||||
begin
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select A.* from GRYearPF_Sub A ');
|
||||
sql.Add(' where A.PFSubID='''+Trim(PFSubID)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCSHDataNew(ADOQuery1,Panel1,0);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add(' where PFSubID='''+Trim(PFSubID)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQuery1,Order_Sub);
|
||||
SInitCDSData20(ADOQuery1,Order_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid('考核评分登记',Tv1,'薪酬管理');
|
||||
if Trim(FormId)='0' then
|
||||
begin
|
||||
InitData();
|
||||
end
|
||||
else
|
||||
begin
|
||||
InitDataXG();
|
||||
end;
|
||||
end;
|
||||
|
||||
function TfrmGRYearPFList_Sub.SaveData():Boolean;
|
||||
var
|
||||
maxno,maxSubNo:String;
|
||||
begin
|
||||
try
|
||||
Result:=False;
|
||||
ADOCmd.Connection.BeginTrans;
|
||||
//保存主表
|
||||
if Trim(PFSubID)='' then
|
||||
begin
|
||||
if GetLSNo(ADOCmd,maxno,'PF','GRYearPF_Sub',3,1)=False then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取主流水号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(PFSubID);
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from GRYearPF_Sub where PFSubID='''+Trim(PFSubID)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
if Trim(PFSubID)='' then
|
||||
begin
|
||||
Append;
|
||||
end
|
||||
else begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('PFSubID').Value:=Trim(maxno);
|
||||
RTSetsavedata(ADOCmd,'GRYearPF_Sub',Panel1,0);
|
||||
fieldbyname('filltime').Value:=SGetServerDate(ADOQuery1);
|
||||
fieldbyname('PFType').Value:='内部';
|
||||
FieldByName('PFStatus').Value:='待提交';
|
||||
Post;
|
||||
end;
|
||||
with ADOCmd DO
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_Sub ');
|
||||
sql.add('where PFYear='''+trim(PFYear.Text)+''' ');
|
||||
sql.add('and PFMonth='''+trim(PFMonth.Text)+''' ');
|
||||
sql.add('and GRName='''+trim(DName)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOCmd.RecordCount>1 then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
application.MessageBox('当月已存在评分不能新增','提示');
|
||||
exit;
|
||||
end;
|
||||
//外部
|
||||
with ADOCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_Sub ');
|
||||
sql.Add('where PFSubID='''+Trim(PFSubID)+'''');
|
||||
open;
|
||||
if isempty then
|
||||
begin
|
||||
append;
|
||||
end
|
||||
else
|
||||
edit;
|
||||
fieldbyname('PFSubID').AsString:=trim(maxno);
|
||||
RTSetsavedata(ADOCmd,'GRYearPFWB_Sub',Panel1,0);
|
||||
fieldbyname('filltime').Value:=SGetServerDate(ADOQuery1);
|
||||
fieldbyname('PFType').value:='外部';
|
||||
FieldByName('PFStatus').Value:='待提交';
|
||||
post;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from PF_User A ');
|
||||
SQL.Add('Inner join SY_Dept B on A.DPID=B.DPID ');
|
||||
sql.add('where B.DPName=''生产部''');
|
||||
open;
|
||||
end;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.add('where PFSubID='''+trim(PFSubID)+'''');
|
||||
open;
|
||||
if isempty then
|
||||
begin
|
||||
with ADOCmd do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if GetLSNo(ADOTemp,maxSubno,'WPF','GRYearPFWB_SubMX',4,1)=False then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取流水号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
append;
|
||||
fieldbyname('PFSubMXID').asstring:=trim(MaxSubno);
|
||||
fieldbyname('PFSubid').AsString:=trim(maxNo);
|
||||
fieldbyname('PFYDian').AsString:=trim(ADOCmd.fieldbyname('PFYDian').AsString);
|
||||
fieldbyname('PFMNum').asfloat:=ADOCmd.fieldbyname('PFMNum').AsFloat;
|
||||
post;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
///保存子表
|
||||
with Order_Sub do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if Trim(Order_Sub.fieldbyname('PFSubMXID').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOCmd,maxSubNo,'PX','GRYearPF_SubMX',4,1)=False then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('生成子表流水号异常!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxSubNo:=Trim(Order_Sub.fieldbyname('PFSubMXID').AsString);
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX where ');
|
||||
sql.Add(' PFSubMXID='''+Trim(maxSubNo)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
if isempty then
|
||||
Append
|
||||
else
|
||||
Edit;
|
||||
FieldByName('PFSubID').Value:=Trim(maxno);
|
||||
FieldByName('PFSubMXID').Value:=Trim(maxSubNo);
|
||||
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'GRYearPF_SubMX',0);
|
||||
fieldbyname('PFZPNum').asfloat:=Order_Sub.fieldbyname('PFZPNum').AsFloat;
|
||||
Post;
|
||||
end;
|
||||
Order_Sub.Edit;
|
||||
Order_Sub.FieldByName('PFSubMXID').Value:=Trim(maxSubNo);
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update GRYearPF_Sub Set PFNum=');
|
||||
sql.Add('(select isnull(Sum(PFZPNum),0) from GRYearPF_SubMX A where A.PFSubID=GRYearPF_Sub.PFSubID)');
|
||||
sql.Add(' where PFSubID='''+Trim(maxno)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
ADOCmd.Connection.CommitTrans;
|
||||
PFSubID:=Trim(maxno);
|
||||
Result:=True;
|
||||
except
|
||||
Result:=False;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
FReal:Double;
|
||||
FInt:Integer;
|
||||
FPPrice,PRTPrice,BCMoney,FPQty,ChaMoney,FYear,FMonth:string;
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if trystrtoInt(PFYear.Text,Fint)=False then
|
||||
begin
|
||||
application.MessageBox('年份非法数字','提示');
|
||||
exit;
|
||||
end;
|
||||
if trystrtoInt(PFMonth.Text,Fint)=False then
|
||||
begin
|
||||
application.MessageBox('月份非法数字','提示');
|
||||
exit;
|
||||
end;
|
||||
if SaveData() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.WorkerBtnClick(Sender: TObject);
|
||||
begin
|
||||
frmYGCXList:=TfrmYGCXList.Create(self);
|
||||
with frmYGCXList do
|
||||
begin
|
||||
FFInt:=100;
|
||||
TSel.Visible:=True;
|
||||
if showModal=1 then
|
||||
begin
|
||||
Dept.Text:=trim(CDS_Tree.fieldbyname('DPName').AsString);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1Column3PropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='KeMu';
|
||||
flagname:='科目';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('KeMu').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
// Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1Column3PropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var
|
||||
FName,FQty,FPrice,mvalue:string;
|
||||
begin
|
||||
FName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
if Trim(mvalue)='' then
|
||||
FieldByName(FName).Value:=null
|
||||
else
|
||||
FieldByName(FName).Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
FQty:=Trim(Order_Sub.fieldbyname('YCLQty').AsString);
|
||||
FPrice:=Trim(Order_Sub.fieldbyname('YCLPrice').AsString);
|
||||
if Trim(FQty)='' then FQty:='0';
|
||||
if Trim(FPrice)='' then FPrice:='0';
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Money').Value:=StrToFloat(FQty)*StrToFloat(FPrice);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1Column9PropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='YCLUnit';
|
||||
flagname:='数量单位';
|
||||
if showModal=1 then
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('YCLUnit').asstring:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1Column1PropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='ZhaiYao';
|
||||
flagname:='付款单位';
|
||||
if showModal=1 then
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('ZhaiYao').asstring:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1priceUnitPropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='priceUnit';
|
||||
flagname:='币种';
|
||||
if showModal=1 then
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('priceUnit').asstring:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.DeptBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmSYDeptView:=TfrmSYDeptView.Create(Application);
|
||||
with frmSYDeptView do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.Dept.Text:=Trim(frmSYDeptView.CDS_Tree.fieldbyname('DPName').AsString);
|
||||
Self.Dept.TxtCode:=Trim(frmSYDeptView.CDS_Tree.fieldbyname('DPID').AsString);
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from PF_User where DPID='''+trim(Self.Dept.TxtCode)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('PFYDian').Value:=ADOQuery1.fieldbyname('PFYDian').AsString;
|
||||
FieldByName('PFMNum').Value:=ADOQuery1.fieldbyname('PFMNum').AsFloat;
|
||||
post;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmSYDeptView.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1ZhaiYaoPropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='ZhaiYao';
|
||||
flagname:='付款单位';
|
||||
if showModal=1 then
|
||||
begin
|
||||
Order_Sub.Edit;
|
||||
Order_Sub.FieldByName('ZhaiYao').AsString:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.v1PFZPNumPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var mavlue: string;
|
||||
begin
|
||||
mavlue:=TcxTextEdit(Sender).EditingText;
|
||||
if strtofloat(mavlue)>Order_Sub.fieldbyname('PFMNum').asfloat then
|
||||
begin
|
||||
application.messagebox('评分不能超过满分','提示');
|
||||
mavlue:='';
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('PFZPNum').AsString:=trim(mavlue);
|
||||
post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.ZDeptBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmSYDeptView:=TfrmSYDeptView.Create(Application);
|
||||
with frmSYDeptView do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.ZDept.Text:=Trim(frmSYDeptView.CDS_Tree.fieldbyname('DPName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally;
|
||||
frmSYDeptView.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.GangWeiBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmSYDeptView:=TfrmSYDeptView.Create(Application);
|
||||
with frmSYDeptView do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.GangWei.Text:=Trim(frmSYDeptView.CDS_Tree.fieldbyname('DPName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally;
|
||||
frmSYDeptView.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.Tv1KeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
TV1.DataController.GotoNext;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_Sub.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
Order_Sub.Delete;
|
||||
end;
|
||||
|
||||
end.
|
||||
788
云翔OA(WTOA.dll)/U_GRYearPFList_WB.dfm
Normal file
788
云翔OA(WTOA.dll)/U_GRYearPFList_WB.dfm
Normal file
|
|
@ -0,0 +1,788 @@
|
|||
object frmGRYearPFList_WB: TfrmGRYearPFList_WB
|
||||
Left = 197
|
||||
Top = 138
|
||||
Width = 1174
|
||||
Height = 604
|
||||
Caption = #20010#20154#24180#24230#22806#37096#35780#20998
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1158
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBTJ: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25552#20132
|
||||
ImageIndex = 31
|
||||
OnClick = TBTJClick
|
||||
end
|
||||
object TBCXTJ: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#25552#20132
|
||||
ImageIndex = 52
|
||||
OnClick = TBCXTJClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 402
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 465
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 1
|
||||
Visible = False
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBUpdate: TToolButton
|
||||
Left = 528
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
Visible = False
|
||||
OnClick = TBUpdateClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 591
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1158
|
||||
Height = 74
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 41
|
||||
Top = 17
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 225
|
||||
Top = 17
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #34987#32771#26680#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 423
|
||||
Top = 17
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 223
|
||||
Top = 44
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #35780#20998#24180#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 423
|
||||
Top = 44
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #35780#20998#26376#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 626
|
||||
Top = 17
|
||||
Width = 58
|
||||
Height = 13
|
||||
Caption = #24635' '#37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 100
|
||||
Top = 13
|
||||
Width = 92
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 99
|
||||
Top = 40
|
||||
Width = 93
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object GRName: TEdit
|
||||
Tag = 2
|
||||
Left = 282
|
||||
Top = 13
|
||||
Width = 104
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object Dept: TEdit
|
||||
Tag = 2
|
||||
Left = 483
|
||||
Top = 13
|
||||
Width = 106
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFYear: TEdit
|
||||
Tag = 2
|
||||
Left = 282
|
||||
Top = 40
|
||||
Width = 105
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFMonth: TEdit
|
||||
Tag = 2
|
||||
Left = 483
|
||||
Top = 40
|
||||
Width = 106
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object ZDept: TEdit
|
||||
Tag = 2
|
||||
Left = 687
|
||||
Top = 13
|
||||
Width = 106
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 106
|
||||
Width = 1158
|
||||
Height = 23
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#25552#20132
|
||||
#24050#25552#20132
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1158
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 129
|
||||
Width = 1158
|
||||
Height = 263
|
||||
Align = alTop
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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 = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 48
|
||||
end
|
||||
object v1Filltime: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'Filltime'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GRName: TcxGridDBColumn
|
||||
Caption = #34987#32771#26680#20154
|
||||
DataBinding.FieldName = 'GRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1YWNum: TcxGridDBColumn
|
||||
Caption = #19994#21153#35780#20998
|
||||
DataBinding.FieldName = 'YWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 74
|
||||
end
|
||||
object v1XZNum: TcxGridDBColumn
|
||||
Caption = #34892#25919#35780#20998
|
||||
DataBinding.FieldName = 'XZNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 83
|
||||
end
|
||||
object v1SCNum: TcxGridDBColumn
|
||||
Caption = #29983#20135#35780#20998
|
||||
DataBinding.FieldName = 'SCNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1CWNum: TcxGridDBColumn
|
||||
Caption = #36130#21153#35780#20998
|
||||
DataBinding.FieldName = 'CWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object TVWPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#24179#22343#20998
|
||||
DataBinding.FieldName = 'WPFSumNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 94
|
||||
end
|
||||
object v1Dept: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'Dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1ZDept: TcxGridDBColumn
|
||||
Caption = #24635#37096#38376
|
||||
DataBinding.FieldName = 'ZDept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object TVPFStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'PFStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1GangWei: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'GangWei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 87
|
||||
end
|
||||
object v1RZDate: TcxGridDBColumn
|
||||
Caption = #20837#32844#26085#26399
|
||||
DataBinding.FieldName = 'RZDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 93
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #35780#20998#26376#20221
|
||||
DataBinding.FieldName = 'PFMonth'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1PFYear: TcxGridDBColumn
|
||||
Caption = #35780#20998#24180#20221
|
||||
DataBinding.FieldName = 'PFYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid3: TcxGrid
|
||||
Left = 0
|
||||
Top = 400
|
||||
Width = 1071
|
||||
Height = 164
|
||||
Align = alLeft
|
||||
TabOrder = 4
|
||||
object TV2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = Source1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFYWNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = V2FPCWNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFXZNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFSCNum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object TPFYDian: TcxGridDBColumn
|
||||
Caption = #35780#20215#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 596
|
||||
end
|
||||
object TPFMNum: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 47
|
||||
end
|
||||
object TPFYWNum: TcxGridDBColumn
|
||||
Caption = #19994#21153#35780#20998
|
||||
DataBinding.FieldName = 'PFYWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object TPFXZNum: TcxGridDBColumn
|
||||
Caption = #34892#25919#35780#20998
|
||||
DataBinding.FieldName = 'PFXZNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 58
|
||||
end
|
||||
object TPFSCNum: TcxGridDBColumn
|
||||
Caption = #29983#20135#35780#20998
|
||||
DataBinding.FieldName = 'PFSCNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 58
|
||||
end
|
||||
object V2FPCWNum: TcxGridDBColumn
|
||||
Caption = #36130#21153#35780#20998
|
||||
DataBinding.FieldName = 'FPCWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 58
|
||||
end
|
||||
object TWPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#20998
|
||||
DataBinding.FieldName = 'WPFSumNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 51
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 0
|
||||
Top = 392
|
||||
Width = 1158
|
||||
Height = 8
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
AlignSplitter = salTop
|
||||
Control = cxGrid3
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 1071
|
||||
Top = 400
|
||||
Width = 87
|
||||
Height = 164
|
||||
Align = alClient
|
||||
TabOrder = 6
|
||||
object TV3: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object V2Chker: TcxGridDBColumn
|
||||
Caption = #35780#20998#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object V2ChkStatus: TcxGridDBColumn
|
||||
Caption = #35780#20998#29366#24577
|
||||
DataBinding.FieldName = 'ChkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV3
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 552
|
||||
Top = 192
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1028
|
||||
Top = 4
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1063
|
||||
Top = 3
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1097
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 208
|
||||
Top = 344
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 264
|
||||
Top = 352
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 360
|
||||
Top = 192
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = PF_Sub
|
||||
Left = 368
|
||||
Top = 344
|
||||
end
|
||||
object PF_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 420
|
||||
Top = 352
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 868
|
||||
Top = 36
|
||||
end
|
||||
end
|
||||
638
云翔OA(WTOA.dll)/U_GRYearPFList_WB.pas
Normal file
638
云翔OA(WTOA.dll)/U_GRYearPFList_WB.pas
Normal file
|
|
@ -0,0 +1,638 @@
|
|||
unit U_GRYearPFList_WB;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_WB = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Filltime: TcxGridDBColumn;
|
||||
v1GRName: TcxGridDBColumn;
|
||||
v1XZNum: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
lbl1: TLabel;
|
||||
lbl3: TLabel;
|
||||
GRName: TEdit;
|
||||
Dept: TEdit;
|
||||
TBAdd: TToolButton;
|
||||
TVWPFSumNum: TcxGridDBColumn;
|
||||
TVPFStatus: TcxGridDBColumn;
|
||||
TBTJ: TToolButton;
|
||||
TBCXTJ: TToolButton;
|
||||
TBUpdate: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
cxGrid3: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
TPFYDian: TcxGridDBColumn;
|
||||
TPFMNum: TcxGridDBColumn;
|
||||
TPFYWNum: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
cxSplitter1: TcxSplitter;
|
||||
TPFXZNum: TcxGridDBColumn;
|
||||
TPFSCNum: TcxGridDBColumn;
|
||||
TWPFSumNum: TcxGridDBColumn;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
v1SCNum: TcxGridDBColumn;
|
||||
v1GangWei: TcxGridDBColumn;
|
||||
v1RZDate: TcxGridDBColumn;
|
||||
v1YWNum: TcxGridDBColumn;
|
||||
v1Dept: TcxGridDBColumn;
|
||||
v1CWNum: TcxGridDBColumn;
|
||||
V2FPCWNum: TcxGridDBColumn;
|
||||
v1Ssel: TcxGridDBColumn;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
PFYear: TEdit;
|
||||
Label4: TLabel;
|
||||
PFMonth: TEdit;
|
||||
v1PFYear: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
ZDept: TEdit;
|
||||
v1ZDept: TcxGridDBColumn;
|
||||
cxGrid2: TcxGrid;
|
||||
TV3: TcxGridDBTableView;
|
||||
V2Chker: TcxGridDBColumn;
|
||||
V2ChkStatus: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource2: TDataSource;
|
||||
PF_Sub: TClientDataSet;
|
||||
ADOQuery1: TADOQuery;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBUpdateClick(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure GRNameChange(Sender: TObject);
|
||||
procedure TBTJClick(Sender: TObject);
|
||||
procedure TBCXTJClick(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_WB: TfrmGRYearPFList_WB;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFList_WB.setstatus();
|
||||
var FDPParent: string;
|
||||
Fint: integer;
|
||||
begin
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.DPlevel,B.DPParent from SY_User A ');
|
||||
sql.add('inner join SY_Dept B on B.DPID=A.DPID ');
|
||||
sql.add('where A.UserName='''+trim(DName)+''' ');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryMain.IsEmpty=False then
|
||||
begin
|
||||
FDPParent:=ADOQueryMain.fieldbyname('DPParent').AsString;
|
||||
for Fint:=2 to ADOQueryMain.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDPParent)+'''');
|
||||
open;
|
||||
end;
|
||||
FDPParent:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
TBTJ.Visible:=False;
|
||||
TBCXTJ.Visible:=False;
|
||||
v1XZNum.Visible:=True;
|
||||
v1YWNum.Visible:=True;
|
||||
v1SCNum.Visible:=true;
|
||||
v1CWNum.Visible:=true;
|
||||
TPFYWNum.Visible:=true;
|
||||
TPFXZNum.Visible:=true;
|
||||
TPFSCNum.Visible:=true;
|
||||
V2FPCWNum.Visible:=true;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='业务部' then
|
||||
begin
|
||||
v1YWNum.Visible:=False;
|
||||
TPFYWNum.Visible:=false;
|
||||
end;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='总经办' then
|
||||
begin
|
||||
v1XZNum.Visible:=false;
|
||||
TPFXZNum.Visible:=false;
|
||||
end;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='生产部' then
|
||||
begin
|
||||
v1SCNum.Visible:=false;
|
||||
TPFSCNum.Visible:=false;
|
||||
end;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='财务部' then
|
||||
begin
|
||||
V2FPCWNum.Visible:=false;
|
||||
v1CWNum.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TBTJ.Visible:=true;
|
||||
end;
|
||||
1:begin
|
||||
TBCXTJ.Visible:=true;
|
||||
end;
|
||||
2:begin
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_WB:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('个人年度考核外部1',Tv1,'薪酬管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.InitGrid();
|
||||
begin
|
||||
with ADOQueryMain DO
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_Sub ');
|
||||
sql.Add('where Filltime>='''+formatdatetime('yyyy-MM-dd',BegDate.Time)+''' ');
|
||||
sql.Add('and Filltime<'''+formatdatetime('yyyy-MM-dd',enddate.Time+1)+''' ');
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
sql.Add('and PFStatus=''待提交'' ');
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
sql.Add('and pfstatus<>''待提交'' ');
|
||||
//if Trim(DParameters1)<>'高权限' then
|
||||
//begin
|
||||
//sql.Add('and GRName='''+trim(DName)+'''');
|
||||
//end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-7;
|
||||
ReadCxGrid('个人年度考核外部1',Tv1,'薪酬管理');
|
||||
cxtabcontrol1.TabIndex:=0;
|
||||
SetStatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('个人年度评分',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
SetStatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.ToolButton1Click(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 TfrmGRYearPFList_WB.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
if application.MessageBox('确定要新增外部评分吗','提示',1)=2 then exit;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBUpdateClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
frmGRYearPFList_Sub:=TfrmGRYearPFList_Sub.Create(self);
|
||||
with frmGRYearPFList_Sub do
|
||||
begin
|
||||
PFSubID:=Trim(Order_Main.fieldbyname('PFSubID').AsString);
|
||||
Formid:='1';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Application.MessageBox('确定要删除吗','提示',1)=2 then exit;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from GRYearPF_Sub where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+''' ');
|
||||
SQL.Add('delete from GRYearPF_SubMX where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.GRNameChange(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 TfrmGRYearPFList_WB.TBTJClick(Sender: TObject);
|
||||
var maxno,FDEPT,ZDept: string;
|
||||
i,Fint:integer;
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
||||
with frmZDYHelpSel do
|
||||
begin
|
||||
flag:='KHPFR';
|
||||
flagname:='考核评分人';
|
||||
MainType:=Trim(DName);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=true then
|
||||
begin
|
||||
with CLientDataSet1 do
|
||||
begin
|
||||
first;
|
||||
i:=0;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=true then
|
||||
begin
|
||||
i:=i+1;
|
||||
if i>3 then
|
||||
begin
|
||||
application.MessageBox('评分人不能超过3个','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where UserName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('评分人定义错误!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_DangAn A ');
|
||||
sql.Add('inner join SY_Dept B on A.DPID=B.DPID');
|
||||
SQL.Add('where isnull(A.YGEName,YGName)='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
FDEPT:=ADOQuery1.fieldbyname('DPParent').AsString;
|
||||
for Fint:=2 to ADOQuery1.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDEPT)+'''');
|
||||
open;
|
||||
end;
|
||||
FDEPT:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty=False then
|
||||
ZDept:=trim(ADOQueryCmd.fieldbyname('DPName').asstring);
|
||||
if Order_Main.FieldByName('ZDept').AsString=trim(ZDept) then
|
||||
begin
|
||||
application.MessageBox('不能提交给被考核人自己部门','提示');
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=true then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
sql.Add(' and isnull(Chker,'''')='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd,maxno,'PF','OA_Chk',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where 1=2');
|
||||
Open;
|
||||
append;
|
||||
FieldByName('CKID').Value:=Trim(maxno);
|
||||
FieldByName('Mainid').Value:=Trim(Order_Main.fieldbyname('PFSubID').AsString);
|
||||
FieldByName('OAType').value:='考核外部评分';
|
||||
FieldByName('Chker').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPFWB_Sub set PFStatus=''已提交'' ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Free;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.TBCXTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要撤销吗','提示',1)=2 then Exit;
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPFWB_Sub set PFStatus=''待提交'' ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from OA_Chk where MainId='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WB.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
end.
|
||||
732
云翔OA(WTOA.dll)/U_GRYearPFList_WBPF.dfm
Normal file
732
云翔OA(WTOA.dll)/U_GRYearPFList_WBPF.dfm
Normal file
|
|
@ -0,0 +1,732 @@
|
|||
object frmGRYearPFList_WBPF: TfrmGRYearPFList_WBPF
|
||||
Left = 190
|
||||
Top = 89
|
||||
Width = 1176
|
||||
Height = 635
|
||||
Caption = #20010#20154#24180#24230#35780#20998#22806#37096
|
||||
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 = 1160
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBTJ: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #35780#20998#23436#25104
|
||||
ImageIndex = 31
|
||||
OnClick = TBTJClick
|
||||
end
|
||||
object TBCXTJ: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144
|
||||
ImageIndex = 52
|
||||
OnClick = TBCXTJClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 402
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1160
|
||||
Height = 64
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #30331#35760#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 218
|
||||
Top = 15
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #34987#32771#26680#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 400
|
||||
Top = 15
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 218
|
||||
Top = 39
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#24180#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 400
|
||||
Top = 39
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#26376#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 592
|
||||
Top = 15
|
||||
Width = 53
|
||||
Height = 12
|
||||
Caption = #24635' '#37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 92
|
||||
Top = 11
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 91
|
||||
Top = 35
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object GRName: TEdit
|
||||
Tag = 2
|
||||
Left = 270
|
||||
Top = 11
|
||||
Width = 96
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object Dept: TEdit
|
||||
Tag = 2
|
||||
Left = 456
|
||||
Top = 11
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFYear: TEdit
|
||||
Tag = 2
|
||||
Left = 270
|
||||
Top = 35
|
||||
Width = 96
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFMonth: TEdit
|
||||
Tag = 2
|
||||
Left = 456
|
||||
Top = 35
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object ZDept: TEdit
|
||||
Tag = 2
|
||||
Left = 648
|
||||
Top = 11
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 96
|
||||
Width = 1160
|
||||
Height = 21
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#35780#20998
|
||||
#24050#35780#20998
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 23
|
||||
ClientRectRight = 1160
|
||||
ClientRectTop = 23
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 0
|
||||
Top = 280
|
||||
Width = 1160
|
||||
Height = 8
|
||||
HotZoneClassName = 'TcxMediaPlayer9Style'
|
||||
AlignSplitter = salTop
|
||||
Control = cxGrid3
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 117
|
||||
Width = 1160
|
||||
Height = 163
|
||||
Align = alTop
|
||||
TabOrder = 4
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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 = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1PFDate: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'Filltime'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GRName: TcxGridDBColumn
|
||||
Caption = #34987#32771#26680#20154
|
||||
DataBinding.FieldName = 'GRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1YWNum: TcxGridDBColumn
|
||||
Caption = #19994#21153#35780#20998
|
||||
DataBinding.FieldName = 'YWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 74
|
||||
end
|
||||
object v1XZNum: TcxGridDBColumn
|
||||
Caption = #34892#25919#35780#20998
|
||||
DataBinding.FieldName = 'XZNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 83
|
||||
end
|
||||
object v1SCNum: TcxGridDBColumn
|
||||
Caption = #29983#20135#35780#20998
|
||||
DataBinding.FieldName = 'SCNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1CWNum: TcxGridDBColumn
|
||||
Caption = #36130#21153#35780#20998
|
||||
DataBinding.FieldName = 'CWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object TVWPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#35780#20998
|
||||
DataBinding.FieldName = 'WPFSumNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 94
|
||||
end
|
||||
object v1Dept: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'Dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1ZDept: TcxGridDBColumn
|
||||
Caption = #24635#37096#38376
|
||||
DataBinding.FieldName = 'ZDept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object TVPFStatus: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'PFStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1GangWei: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'GangWei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 87
|
||||
end
|
||||
object v1RZDate: TcxGridDBColumn
|
||||
Caption = #20837#32844#26085#26399
|
||||
DataBinding.FieldName = 'RZDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #35780#20998#26376#20221
|
||||
DataBinding.FieldName = 'PFMonth'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1PFYear: TcxGridDBColumn
|
||||
Caption = #35780#20998#24180#20221
|
||||
DataBinding.FieldName = 'PFYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid3: TcxGrid
|
||||
Left = 0
|
||||
Top = 288
|
||||
Width = 993
|
||||
Height = 309
|
||||
Align = alLeft
|
||||
TabOrder = 5
|
||||
object TV2: TcxGridDBTableView
|
||||
OnKeyUp = TV2KeyUp
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = Source1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFYWNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = V2FPCWNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFXZNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFSCNum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object TPFYDian: TcxGridDBColumn
|
||||
Caption = #35780#20215#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 596
|
||||
end
|
||||
object TPFMNum: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 45
|
||||
end
|
||||
object TPFYWNum: TcxGridDBColumn
|
||||
Caption = #19994#21153#35780#20998
|
||||
DataBinding.FieldName = 'PFYWNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V2FPCWNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object TPFXZNum: TcxGridDBColumn
|
||||
Caption = #34892#25919#35780#20998
|
||||
DataBinding.FieldName = 'PFXZNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V2FPCWNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 58
|
||||
end
|
||||
object TPFSCNum: TcxGridDBColumn
|
||||
Caption = #29983#20135#35780#20998
|
||||
DataBinding.FieldName = 'PFSCNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V2FPCWNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 58
|
||||
end
|
||||
object V2FPCWNum: TcxGridDBColumn
|
||||
Caption = #36130#21153#35780#20998
|
||||
DataBinding.FieldName = 'FPCWNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V2FPCWNumPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object TWPFSumNum: TcxGridDBColumn
|
||||
Caption = #24635#20998
|
||||
DataBinding.FieldName = 'WPFSumNum'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 73
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 993
|
||||
Top = 288
|
||||
Width = 167
|
||||
Height = 309
|
||||
Align = alClient
|
||||
TabOrder = 6
|
||||
object TV3: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object V2Chker: TcxGridDBColumn
|
||||
Caption = #35780#20998#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object V2ChkStatus: TcxGridDBColumn
|
||||
Caption = #35780#20998#29366#24577
|
||||
DataBinding.FieldName = 'ChkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV3
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 516
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 968
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
Top = 4
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1031
|
||||
Top = 3
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 905
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 208
|
||||
Top = 344
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 264
|
||||
Top = 352
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = PF_Sub
|
||||
Left = 344
|
||||
Top = 368
|
||||
end
|
||||
object PF_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 400
|
||||
Top = 376
|
||||
end
|
||||
end
|
||||
598
云翔OA(WTOA.dll)/U_GRYearPFList_WBPF.pas
Normal file
598
云翔OA(WTOA.dll)/U_GRYearPFList_WBPF.pas
Normal file
|
|
@ -0,0 +1,598 @@
|
|||
unit U_GRYearPFList_WBPF;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_WBPF = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
lbl1: TLabel;
|
||||
lbl3: TLabel;
|
||||
GRName: TEdit;
|
||||
Dept: TEdit;
|
||||
TBTJ: TToolButton;
|
||||
TBCXTJ: TToolButton;
|
||||
cxSplitter1: TcxSplitter;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1PFDate: TcxGridDBColumn;
|
||||
v1GRName: TcxGridDBColumn;
|
||||
v1YWNum: TcxGridDBColumn;
|
||||
v1XZNum: TcxGridDBColumn;
|
||||
v1SCNum: TcxGridDBColumn;
|
||||
v1CWNum: TcxGridDBColumn;
|
||||
TVWPFSumNum: TcxGridDBColumn;
|
||||
v1Dept: TcxGridDBColumn;
|
||||
TVPFStatus: TcxGridDBColumn;
|
||||
v1GangWei: TcxGridDBColumn;
|
||||
v1RZDate: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid3: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
TPFYDian: TcxGridDBColumn;
|
||||
TPFMNum: TcxGridDBColumn;
|
||||
TPFYWNum: TcxGridDBColumn;
|
||||
TPFXZNum: TcxGridDBColumn;
|
||||
TPFSCNum: TcxGridDBColumn;
|
||||
V2FPCWNum: TcxGridDBColumn;
|
||||
TWPFSumNum: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
PFYear: TEdit;
|
||||
Label4: TLabel;
|
||||
PFMonth: TEdit;
|
||||
v1PFYear: TcxGridDBColumn;
|
||||
v1ZDept: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
ZDept: TEdit;
|
||||
cxGrid2: TcxGrid;
|
||||
TV3: TcxGridDBTableView;
|
||||
V2Chker: TcxGridDBColumn;
|
||||
V2ChkStatus: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource2: TDataSource;
|
||||
PF_Sub: TClientDataSet;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure GRNameChange(Sender: TObject);
|
||||
procedure TBTJClick(Sender: TObject);
|
||||
procedure TBCXTJClick(Sender: TObject);
|
||||
procedure TPFSJNumPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure TPFXJNumPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure TV2KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure V2FPCWNumPropertiesEditValueChanged(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure setstatus();
|
||||
procedure GRYearPF();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_WBPF: TfrmGRYearPFList_WBPF;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmGRYearPFList_WBPF.GRYearPF();
|
||||
begin
|
||||
if strtofloat(trim(Order_Main.fieldbyname('PFMonth').asstring))=12 then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select ');
|
||||
sql.add('ZYearNum=Avg(isnull(A.PFSumNum*0.6,0)+isnull(B.WPFSumNum*0.4,0)) ');
|
||||
sql.add('from GRYearPF_Sub A ');
|
||||
sql.Add('inner join GRYearPFWB_Sub B on B.PFSubid=A.PFSubid ');
|
||||
sql.Add('where A.PFYear='''+trim(Order_Main.fieldbyname('PFYear').AsString)+''' ');
|
||||
sql.Add('and isnull(A.PFStatus,'''')=''评分完成'' ');
|
||||
sql.Add('and isnull(B.PFStatus,'''')=''评分完成'' ');
|
||||
sql.Add('and A.GRName='''+trim(Order_Main.fieldbyname('GRName').AsString)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty=False then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.add('update OA_YG_DangAn set SYearPF=GRYearPF,GRYearPF='''+trim(ADOQueryCmd.fieldbyname('ZYearNum').AsString)+'''');
|
||||
sql.add('where isnull(YGEName,YGName)='''+trim(Order_Main.fieldbyname('GRName').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.setstatus();
|
||||
var FDPParent: string;
|
||||
Fint: integer;
|
||||
begin
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.DPlevel,B.DPParent from SY_User A ');
|
||||
sql.add('inner join SY_Dept B on B.DPID=A.DPID ');
|
||||
sql.add('where A.UserName='''+trim(Dname)+''' ');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryMain.IsEmpty=False then
|
||||
begin
|
||||
FDPParent:=ADOQueryMain.fieldbyname('DPParent').AsString;
|
||||
for Fint:=2 to ADOQueryMain.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDPParent)+'''');
|
||||
open;
|
||||
end;
|
||||
FDPParent:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
TBTJ.Visible:=False;
|
||||
TBCXTJ.Visible:=False;
|
||||
TPFYWNum.Visible:=False;
|
||||
TPFXZNum.Visible:=False;
|
||||
TPFSCNum.Visible:=False;
|
||||
V2FPCWNum.Visible:=False;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='业务部' then
|
||||
begin
|
||||
TPFYWNum.Visible:=true;
|
||||
end;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='总经办' then
|
||||
begin
|
||||
TPFXZNum.Visible:=true;
|
||||
end;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='生产部' then
|
||||
begin
|
||||
TPFSCNum.Visible:=true;
|
||||
end;
|
||||
if ADOQueryCmd.FieldByName('DPName').AsString='财务部' then
|
||||
begin
|
||||
V2FPCWNum.Visible:=true;
|
||||
end;
|
||||
end;
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TBTJ.Visible:=true;
|
||||
end;
|
||||
1:begin
|
||||
TBCXTJ.Visible:=true;
|
||||
end;
|
||||
2:begin
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_WBPF:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('个人年度考核外部评分',Tv1,'薪酬管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.InitGrid();
|
||||
begin
|
||||
with ADOQueryMain DO
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from GRYearPFWB_Sub A ');
|
||||
sql.Add('inner join OA_Chk B on B.Mainid=A.PFSubid and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
if cxTabControl1.TabIndex<>0 then
|
||||
begin
|
||||
sql.Add('where A.Filltime>='''+formatdatetime('yyyy-MM-dd',BegDate.Time)+''' ');
|
||||
sql.Add('and A.Filltime<'''+formatdatetime('yyyy-MM-dd',enddate.Time+1)+''' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
sql.Add('where isnull(B.ChkStatus,'''')='''' ');
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add('and isnull(B.ChkStatus,'''')=''已评分'' ');
|
||||
end;
|
||||
sql.Add('and B.Chker='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-7;
|
||||
ReadCxGrid('个人年度考核外部评分',Tv1,'薪酬管理');
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('个人年度外部评分',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.ToolButton1Click(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 TfrmGRYearPFList_WBPF.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,PF_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,PF_Sub);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.GRNameChange(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 TfrmGRYearPFList_WBPF.TBTJClick(Sender: TObject);
|
||||
var maxno: string;
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
with Order_Sub do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPFWB_SubMX set PFMNum='''+trim(Order_Sub.FieldByName('PFMNum').AsString)+'''');
|
||||
if Order_Sub.FieldByName('PFYWNum').AsString<>'' then
|
||||
begin
|
||||
sql.Add(',PFYWNum='''+trim(Order_Sub.FieldByName('PFYWNum').AsString)+''' ');
|
||||
end;
|
||||
if Order_Sub.FieldByName('PFXZNum').AsString<>'' then
|
||||
begin
|
||||
sql.Add(',PFXZNum='''+trim(Order_Sub.FieldByName('PFXZNum').AsString)+''' ');
|
||||
end;
|
||||
if Order_Sub.FieldByName('PFSCNum').AsString<>'' then
|
||||
begin
|
||||
sql.Add(',PFSCNum='''+trim(Order_Sub.FieldByName('PFSCNum').AsString)+''' ');
|
||||
end;
|
||||
if Order_Sub.FieldByName('FPCWNum').AsString<>'' then
|
||||
begin
|
||||
sql.Add(',FPCWNum='''+trim(Order_Sub.FieldByName('FPCWNum').AsString)+''' ');
|
||||
end;
|
||||
SQL.Add(',WPFSumNum=isnull(PFYWNum,0)+isnull(PFXZNum,0)+isnull(PFSCNum,0)+isnull(FPCWNum,0) ');
|
||||
sql.Add('where PFSubMXID='''+trim(Order_Sub.FieldByName('PFSubMXID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPFWB_Sub set ');
|
||||
sql.Add('YWNum=(select sum(PFYWNum) from GRYearPFWB_SubMX where PFSubid=GRYearPFWB_Sub.PFsubid)');
|
||||
sql.Add(',XZNum=(select sum(PFXZNum) from GRYearPFWB_SubMX where PFSubid=GRYearPFWB_Sub.PFsubid) ');
|
||||
sql.Add(',SCNum=(select sum(PFSCNum) from GRYearPFWB_SubMX where PFSubid=GRYearPFWB_Sub.PFsubid) ');
|
||||
sql.Add(',CWNum=(select sum(FPCWNum) from GRYearPFWB_SubMX where PFSubid=GRYearPFWB_Sub.PFsubid) ');
|
||||
sql.add(' where PFSubid='''+trim(Order_Main.fieldbyname('PFSubid').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_Chk set ChkStatus=''已评分'' ');
|
||||
sql.Add('where CKID='''+trim(Order_Main.fieldbyname('CKID').asstring)+''' ');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk ');
|
||||
sql.Add('where Mainid='''+trim(Order_Main.fieldbyname('PFSubid').asstring)+''' ');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
sql.Add('and Chkstatus<>''已评分''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPFWB_Sub set PFStatus=''评分完成'', ');
|
||||
sql.Add('WPFSumNum=(isnull(YWNum,0)+isnull(XZNum,0)+isnull(SCNum,0)+isnull(CWNum,0))/3 ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
GRYearPF();
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TBCXTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Application.MessageBox('确定要撤销吗','提示',1)=2 then Exit;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_Chk set Chkstatus='''' where CKID='''+trim(Order_Main.fieldbyname('CKID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''考核外部评分'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('update GRYearPFWB_Sub set PFStatus=''已提交'' ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').asstring)+''' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TPFSJNumPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var mvalue: string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if strtofloat(mvalue)>Order_Sub.fieldbyname('PFMNum').asfloat then
|
||||
begin
|
||||
application.messagebox('评分不能超过满分','提示');
|
||||
mvalue:='';
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('PFSJNum').Value:=Trim(mvalue);
|
||||
FieldByName('PFSumNum').Value:=fieldbyname('PFZPNum').AsFloat+fieldbyname('PFSJNum').AsFloat+fieldbyname('PFXJNum').AsFloat;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TPFXJNumPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var mvalue: string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if strtofloat(mvalue)>Order_Sub.fieldbyname('PFMNum').asfloat then
|
||||
begin
|
||||
application.messagebox('评分不能超过满分','提示');
|
||||
mvalue:='';
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('PFXJNum').Value:=Trim(mvalue);
|
||||
FieldByName('PFSumNum').Value:=fieldbyname('PFZPNum').AsFloat+fieldbyname('PFSJNum').AsFloat+fieldbyname('PFXJNum').AsFloat;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.TV2KeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
TV2.DataController.GotoNext;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_WBPF.V2FPCWNumPropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var mvalue,Ffieldbyname: string;
|
||||
begin
|
||||
mvalue:=TcxtextEdit(Sender).EditingText;
|
||||
Ffieldbyname:=Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
if strtofloat(mvalue)>Order_Sub.FieldByName('PFMNum').AsFloat then
|
||||
begin
|
||||
application.MessageBox('不能超过满分','提示');
|
||||
mvalue:='';
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname(Ffieldbyname).AsString:=trim(mvalue);
|
||||
fieldbyname('WPFSumNum').asfloat:=fieldbyname('PFXZNum').asfloat+fieldbyname('PFYWNum').asfloat+fieldbyname('PFSCNum').asfloat+fieldbyname('FPCWNum').asfloat;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
400
云翔OA(WTOA.dll)/U_GRYearPFList_YGFHDJ.dfm
Normal file
400
云翔OA(WTOA.dll)/U_GRYearPFList_YGFHDJ.dfm
Normal file
|
|
@ -0,0 +1,400 @@
|
|||
object frmGRYearPFList_YGFHDJ: TfrmGRYearPFList_YGFHDJ
|
||||
Left = 189
|
||||
Top = 128
|
||||
Width = 1136
|
||||
Height = 602
|
||||
Caption = #21592#24037#20998#32418#30331#35760
|
||||
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 = 1120
|
||||
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_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20998#32418
|
||||
ImageIndex = 75
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144
|
||||
ImageIndex = 52
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TSsel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#30475
|
||||
ImageIndex = 22
|
||||
Visible = False
|
||||
OnClick = TSselClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
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 = 1120
|
||||
Height = 47
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 177
|
||||
Top = 18
|
||||
Width = 18
|
||||
Height = 12
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #26597#35810#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 92
|
||||
Top = 14
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 195
|
||||
Top = 14
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 79
|
||||
Width = 1120
|
||||
Height = 485
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
Column = v1Column7
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1Column7
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1YMBMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1FHMoney
|
||||
end
|
||||
item
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Header = cxStyle3
|
||||
object v1NFYear: TcxGridDBColumn
|
||||
Caption = #24180#20221
|
||||
DataBinding.FieldName = 'NFYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #22995#21517
|
||||
DataBinding.FieldName = 'YGName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 92
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'Dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 87
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #23703#20301
|
||||
DataBinding.FieldName = 'GangWei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 76
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #36716#27491#26085#26399
|
||||
DataBinding.FieldName = 'RuZhiDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 88
|
||||
end
|
||||
object v1YGGL: TcxGridDBColumn
|
||||
Caption = #24037#40836
|
||||
DataBinding.FieldName = 'YGGL'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 51
|
||||
end
|
||||
object v1FHType: TcxGridDBColumn
|
||||
Caption = #34218#37228#31867#22411
|
||||
DataBinding.FieldName = 'FHType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 92
|
||||
end
|
||||
object v1GRNXMoney: TcxGridDBColumn
|
||||
Caption = #20010#20154#24180#34218
|
||||
DataBinding.FieldName = 'GRNXMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1MBMoney: TcxGridDBColumn
|
||||
Caption = #20010#20154#38144#21806#30446#26631
|
||||
DataBinding.FieldName = 'MBMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 107
|
||||
end
|
||||
object v1GRYearPF: TcxGridDBColumn
|
||||
Caption = #24180#24230#35780#20998
|
||||
DataBinding.FieldName = 'GRYearPF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 74
|
||||
end
|
||||
object v1PriceUnit: TcxGridDBColumn
|
||||
Caption = #24065#31181
|
||||
DataBinding.FieldName = 'PriceUnit'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object v1YMBMoney: TcxGridDBColumn
|
||||
Caption = #24050#23436#25104#38144#21806
|
||||
DataBinding.FieldName = 'YMBMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
object v1FHMoney: TcxGridDBColumn
|
||||
Caption = #20998#32418#37329#39069
|
||||
DataBinding.FieldName = 'FHMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 78
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 516
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 944
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 548
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1023
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1061
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 208
|
||||
Top = 344
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 264
|
||||
Top = 352
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clRed
|
||||
end
|
||||
object cxStyle3: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
end
|
||||
end
|
||||
229
云翔OA(WTOA.dll)/U_GRYearPFList_YGFHDJ.pas
Normal file
229
云翔OA(WTOA.dll)/U_GRYearPFList_YGFHDJ.pas
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
unit U_GRYearPFList_YGFHDJ;
|
||||
|
||||
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, cxCheckBox, Menus, cxCurrencyEdit;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_YGFHDJ = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1YGGL: TcxGridDBColumn;
|
||||
v1FHType: TcxGridDBColumn;
|
||||
v1MBMoney: TcxGridDBColumn;
|
||||
v1PriceUnit: TcxGridDBColumn;
|
||||
v1YMBMoney: TcxGridDBColumn;
|
||||
v1FHMoney: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxStyle3: TcxStyle;
|
||||
TSsel: TToolButton;
|
||||
v1GRNXMoney: TcxGridDBColumn;
|
||||
v1NFYear: TcxGridDBColumn;
|
||||
v1GRYearPF: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure v1PriceUnitPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure TSselClick(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_YGFHDJ: TfrmGRYearPFList_YGFHDJ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel,U_YGYPInPut_YGFHDJ;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_YGFHDJ:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('分红档期登记',Tv1,'分红管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.InitGrid();
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from GRYearFH_Sub ');
|
||||
sql.Add('where filltime>='''+formatdatetime('yyyy-MM-dd',BegDate.Time)+''' ');
|
||||
sql.Add('and filltime<'''+formatdatetime('yyyy-MM-dd',enddate.Time+1)+''' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-365;
|
||||
ReadCxGrid('分红档期登记',Tv1,'分红管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('分红档期',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.ToolButton1Click(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 TfrmGRYearPFList_YGFHDJ.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if application.MessageBox('确定要撤销吗','提示',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
//sql.Add('delete from GRYearFH_Main ');
|
||||
//sql.add('where FHID='''+trim(Order_Main.fieldbyname('FHID').AsString)+'''');
|
||||
sql.add('delete from GRYearFH_Sub where FHID='''+trim(Order_Main.fieldbyname('FHID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
frmYGYPInPut_YGFHDJ:=TfrmYGYPInPut_YGFHDJ.create(self);
|
||||
with frmYGYPInPut_YGFHDJ do
|
||||
begin
|
||||
FFHID:='';
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.v1PriceUnitPropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='PriceUnit';
|
||||
flagname:='币种';
|
||||
if showModal=1 then
|
||||
begin
|
||||
with Order_Main do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('PriceUnit').asstring:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGFHDJ.TSselClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.isempty then exit;
|
||||
frmYGYPInPut_YGFHDJ:=TfrmYGYPInPut_YGFHDJ.create(self);
|
||||
with frmYGYPInPut_YGFHDJ do
|
||||
begin
|
||||
FFHID:=Order_Main.fieldbyname('FHID').asstring;
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
689
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFF.dfm
Normal file
689
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFF.dfm
Normal file
|
|
@ -0,0 +1,689 @@
|
|||
object frmGRYearPFList_YGXZFF: TfrmGRYearPFList_YGXZFF
|
||||
Left = 191
|
||||
Top = 120
|
||||
Width = 1212
|
||||
Height = 643
|
||||
Caption = #21592#24037#34218#36164#21457#25918#30331#35760
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object Label6: TLabel
|
||||
Left = 342
|
||||
Top = 20
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #22995' '#21517
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1196
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 1
|
||||
Visible = False
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TUpdate: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
Visible = False
|
||||
OnClick = TUpdateClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TCHk: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20184#27454
|
||||
ImageIndex = 75
|
||||
OnClick = TCHkClick
|
||||
end
|
||||
object TCXChk: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#20184#27454
|
||||
ImageIndex = 52
|
||||
OnClick = TCXChkClick
|
||||
end
|
||||
object TSsel: TToolButton
|
||||
Left = 465
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#30475
|
||||
ImageIndex = 22
|
||||
OnClick = TSselClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 528
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 591
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
object TTJ: TToolButton
|
||||
Left = 654
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25552#20132
|
||||
ImageIndex = 31
|
||||
Visible = False
|
||||
OnClick = TTJClick
|
||||
end
|
||||
object TCXTJ: TToolButton
|
||||
Left = 717
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#25552#20132
|
||||
ImageIndex = 52
|
||||
Visible = False
|
||||
OnClick = TCXTJClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1196
|
||||
Height = 51
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 192
|
||||
Top = 20
|
||||
Width = 21
|
||||
Height = 13
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 41
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #26597#35810#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 342
|
||||
Top = 20
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #22995' '#21517
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 553
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20184#27454#26041#24335
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 100
|
||||
Top = 15
|
||||
Width = 92
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 211
|
||||
Top = 15
|
||||
Width = 93
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object YGName: TEdit
|
||||
Tag = 2
|
||||
Left = 404
|
||||
Top = 15
|
||||
Width = 110
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
OnChange = YGNameChange
|
||||
end
|
||||
object FKType: TComboBox
|
||||
Tag = 2
|
||||
Left = 611
|
||||
Top = 15
|
||||
Width = 109
|
||||
Height = 21
|
||||
ItemHeight = 13
|
||||
TabOrder = 3
|
||||
OnChange = YGNameChange
|
||||
Items.Strings = (
|
||||
#29616#37329
|
||||
#25171#21345)
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 83
|
||||
Width = 1196
|
||||
Height = 25
|
||||
Align = alTop
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#20184#27454
|
||||
#24050#20184#27454
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 25
|
||||
ClientRectRight = 1196
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxTabControl2: TcxTabControl
|
||||
Left = 0
|
||||
Top = 108
|
||||
Width = 1196
|
||||
Height = 24
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 3
|
||||
Tabs.Strings = (
|
||||
#20113#32724
|
||||
#23431#26122
|
||||
#33509#20961
|
||||
#26133#32453
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl2Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1196
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 132
|
||||
Width = 1196
|
||||
Height = 471
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 4
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.First.Visible = True
|
||||
NavigatorButtons.PriorPage.Visible = True
|
||||
NavigatorButtons.Prior.Visible = True
|
||||
NavigatorButtons.Next.Visible = True
|
||||
NavigatorButtons.NextPage.Visible = True
|
||||
NavigatorButtons.Last.Visible = True
|
||||
NavigatorButtons.Insert.Visible = True
|
||||
NavigatorButtons.Delete.Visible = True
|
||||
NavigatorButtons.Edit.Visible = True
|
||||
NavigatorButtons.Post.Visible = True
|
||||
NavigatorButtons.Cancel.Visible = True
|
||||
NavigatorButtons.Refresh.Visible = True
|
||||
NavigatorButtons.SaveBookmark.Visible = True
|
||||
NavigatorButtons.GotoBookmark.Visible = True
|
||||
NavigatorButtons.Filter.Visible = True
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
Column = v1YGName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1YGName
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1FFMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1GZMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1JLMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KCDMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KFKMeny
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KGSMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KOtherMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KQJMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KSBMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1DXGZMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1JKMoney
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle3
|
||||
object v1Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 41
|
||||
end
|
||||
object v1FFDate: TcxGridDBColumn
|
||||
Caption = #21457#25918#26085#26399
|
||||
DataBinding.FieldName = 'FFDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1XHNo: TcxGridDBColumn
|
||||
Caption = #24207#21495
|
||||
DataBinding.FieldName = 'XHNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 38
|
||||
end
|
||||
object v1YGName: TcxGridDBColumn
|
||||
Caption = #22995#21517
|
||||
DataBinding.FieldName = 'YGName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 76
|
||||
end
|
||||
object v1GZMoney: TcxGridDBColumn
|
||||
Caption = #26376#24037#36164
|
||||
DataBinding.FieldName = 'GZMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 82
|
||||
end
|
||||
object v1KQJMoney: TcxGridDBColumn
|
||||
Caption = #35831#20551#22825#25968
|
||||
DataBinding.FieldName = 'KQJMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KSBMoney: TcxGridDBColumn
|
||||
Caption = #20241#24687#22825#25968
|
||||
DataBinding.FieldName = 'KSBMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KOtherMoney: TcxGridDBColumn
|
||||
Caption = #19978#29677#22825#25968
|
||||
DataBinding.FieldName = 'KOtherMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 88
|
||||
end
|
||||
object v1DXGZMoney: TcxGridDBColumn
|
||||
Caption = #22522#26412#24037#36164
|
||||
DataBinding.FieldName = 'DXGZMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1GLFLMoney: TcxGridDBColumn
|
||||
Caption = #24037#40836'/'#31119#21033
|
||||
DataBinding.FieldName = 'GLFLMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KGSMoney: TcxGridDBColumn
|
||||
Caption = #23703#20301#34917#36148
|
||||
DataBinding.FieldName = 'KGSMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 72
|
||||
end
|
||||
object v1KFKMeny: TcxGridDBColumn
|
||||
Caption = #20445#38505#34917#36148
|
||||
DataBinding.FieldName = 'KFKMeny'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1CJBGZMoney: TcxGridDBColumn
|
||||
Caption = #24037#36164
|
||||
DataBinding.FieldName = 'JBGZMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KCDMoney: TcxGridDBColumn
|
||||
Caption = #32771#21220#32602#27454
|
||||
DataBinding.FieldName = 'KCDMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1JKMoney: TcxGridDBColumn
|
||||
Caption = #25187#27454
|
||||
DataBinding.FieldName = 'JKMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FFMoney: TcxGridDBColumn
|
||||
Caption = #24212#21457#24037#36164
|
||||
DataBinding.FieldName = 'FFMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1JLMoney: TcxGridDBColumn
|
||||
Caption = #22870#37329
|
||||
DataBinding.FieldName = 'JLMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKSYSTEM: TcxGridDBColumn
|
||||
Caption = #20184#27454#25260#22836
|
||||
DataBinding.FieldName = 'FKSYSTEM'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKType: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1XZNote: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'XZNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 86
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 516
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 944
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 548
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1023
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1061
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 332
|
||||
Top = 192
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 360
|
||||
Top = 192
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clRed
|
||||
end
|
||||
object cxStyle3: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 304
|
||||
Top = 192
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
501
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFF.pas
Normal file
501
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFF.pas
Normal file
|
|
@ -0,0 +1,501 @@
|
|||
unit U_GRYearPFList_YGXZFF;
|
||||
|
||||
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, cxCheckBox, Menus, cxCurrencyEdit, cxDropDownEdit;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_YGXZFF = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
cxStyle3: TcxStyle;
|
||||
TSsel: TToolButton;
|
||||
TUpdate: TToolButton;
|
||||
TCHk: TToolButton;
|
||||
TCXChk: TToolButton;
|
||||
cxTabControl1: TcxTabControl;
|
||||
Label3: TLabel;
|
||||
YGName: TEdit;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
TTJ: TToolButton;
|
||||
TCXTJ: TToolButton;
|
||||
FKType: TComboBox;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
cxTabControl2: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Ssel: TcxGridDBColumn;
|
||||
v1FFDate: TcxGridDBColumn;
|
||||
v1XHNo: TcxGridDBColumn;
|
||||
v1YGName: TcxGridDBColumn;
|
||||
v1GZMoney: TcxGridDBColumn;
|
||||
v1KQJMoney: TcxGridDBColumn;
|
||||
v1KSBMoney: TcxGridDBColumn;
|
||||
v1KOtherMoney: TcxGridDBColumn;
|
||||
v1DXGZMoney: TcxGridDBColumn;
|
||||
v1GLFLMoney: TcxGridDBColumn;
|
||||
v1KGSMoney: TcxGridDBColumn;
|
||||
v1KFKMeny: TcxGridDBColumn;
|
||||
v1CJBGZMoney: TcxGridDBColumn;
|
||||
v1KCDMoney: TcxGridDBColumn;
|
||||
v1JKMoney: TcxGridDBColumn;
|
||||
v1FFMoney: TcxGridDBColumn;
|
||||
v1JLMoney: TcxGridDBColumn;
|
||||
v1FKSYSTEM: TcxGridDBColumn;
|
||||
v1FKType: TcxGridDBColumn;
|
||||
v1XZNote: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TSselClick(Sender: TObject);
|
||||
procedure TUpdateClick(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure TCHkClick(Sender: TObject);
|
||||
procedure TCXChkClick(Sender: TObject);
|
||||
procedure YGNameChange(Sender: TObject);
|
||||
procedure TTJClick(Sender: TObject);
|
||||
procedure cxTabControl2Change(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure TCXTJClick(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
Ftype:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_YGXZFF: TfrmGRYearPFList_YGXZFF;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel,U_YGYPInPut_YGXZDJ;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmGRYearPFList_YGXZFF.setstatus();
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TUpdate.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TChk.Visible:=False;
|
||||
TCXChk.Visible:=False;
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TChk.Visible:=True;
|
||||
end;
|
||||
1:begin
|
||||
TCXChk.Visible:=True;
|
||||
end;
|
||||
2:begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_YGXZFF:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('员工工资登记32',Tv1,'分红管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.InitGrid();
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_XZFF_Main A ');
|
||||
sql.add('inner join OA_YG_XZFF B on B.XZMain=A.XZMain ');
|
||||
sql.add('where A.filltime>='''+trim(formatdatetime('yyyy-MM-dd',begdate.DateTime))+''' ');
|
||||
sql.add('and A.filltime<'''+trim(formatdatetime('yyyy-MM-dd',Enddate.dateTime+1))+''' ');
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.add('and isnull(B.ChkStatus,'''')=''待审核'' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.add('and isnull(B.ChkStatus,'''')=''已审核'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=0 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''云翔'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=1 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''宇昊'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=2 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''若凡'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=3 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''昕绅'' ');
|
||||
end;
|
||||
sql.add('Order By A.SSYear,A.SSMonth,B.XHNo');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-30;
|
||||
ReadCxGrid('员工工资登记32',Tv1,'分红管理');
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('员工工资',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTemp.Active=False then Exit;
|
||||
SDofilter(ADOQueryTemp,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
if application.MessageBox('确定要删除吗','提示',1)=2 then exit;
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from OA_YG_XZFF ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
frmYGYPInPut_YGXZDJ:=TfrmYGYPInPut_YGXZDJ.create(self);
|
||||
with frmYGYPInPut_YGXZDJ do
|
||||
begin
|
||||
FXZMain:='';
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TSselClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.isempty then exit;
|
||||
frmYGYPInPut_YGXZDJ:=TfrmYGYPInPut_YGXZDJ.create(self);
|
||||
with frmYGYPInPut_YGXZDJ do
|
||||
begin
|
||||
ToolBar1.Enabled:=False;
|
||||
Panel3.Enabled:=False;
|
||||
toolbar2.Enabled:=False;
|
||||
FXZMain:=trim(Order_Main.fieldbyname('XZMain').AsString);
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TUpdateClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
frmYGYPInPut_YGXZDJ:=TfrmYGYPInPut_YGXZDJ.create(self);
|
||||
with frmYGYPInPut_YGXZDJ do
|
||||
begin
|
||||
FXZMain:=trim(Order_Main.fieldbyname('XZMain').AsString);
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
setstatus();
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TCHkClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''已审核'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('付款成功','提示');
|
||||
except;
|
||||
application.MessageBox('付款失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TCXChkClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
if order_Main.fieldbyname('FKStatus').asstring='已付款' then
|
||||
begin
|
||||
application.MessageBox('有已付款不能撤销','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''待审核'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('付款成功','提示');
|
||||
except;
|
||||
application.MessageBox('付款失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.YGNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton1.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''未审核'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('提交成功','提示');
|
||||
except;
|
||||
application.MessageBox('提交失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.cxTabControl2Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.Tv1CellDblClick(
|
||||
Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
TSsel.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFF.TCXTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''待提交'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('审核成功','提示');
|
||||
except;
|
||||
application.MessageBox('审核失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
633
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFFCX.dfm
Normal file
633
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFFCX.dfm
Normal file
|
|
@ -0,0 +1,633 @@
|
|||
object frmGRYearPFList_YGXZFFCX: TfrmGRYearPFList_YGXZFFCX
|
||||
Left = 190
|
||||
Top = 127
|
||||
Width = 1174
|
||||
Height = 595
|
||||
Caption = #21592#24037#34218#36164#21457#25918#20184#27454
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1158
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20184#27454
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TCXFK: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#20184#27454
|
||||
ImageIndex = 22
|
||||
OnClick = TCXFKClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20316#24223
|
||||
ImageIndex = 52
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 402
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1158
|
||||
Height = 51
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 192
|
||||
Top = 20
|
||||
Width = 21
|
||||
Height = 13
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 41
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #26597#35810#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 342
|
||||
Top = 20
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #22995' '#21517
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 544
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20184#27454#26041#24335
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 100
|
||||
Top = 15
|
||||
Width = 92
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 211
|
||||
Top = 15
|
||||
Width = 93
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object YGName: TEdit
|
||||
Tag = 2
|
||||
Left = 404
|
||||
Top = 15
|
||||
Width = 110
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
OnChange = YGNameChange
|
||||
end
|
||||
object FKType: TEdit
|
||||
Tag = 2
|
||||
Left = 602
|
||||
Top = 15
|
||||
Width = 110
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
OnChange = YGNameChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 83
|
||||
Width = 1158
|
||||
Height = 25
|
||||
Align = alTop
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#20184#27454
|
||||
#24050#20184#27454
|
||||
#20316#24223
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 25
|
||||
ClientRectRight = 1158
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxTabControl2: TcxTabControl
|
||||
Left = 0
|
||||
Top = 108
|
||||
Width = 1158
|
||||
Height = 24
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 3
|
||||
Tabs.Strings = (
|
||||
#20113#32724
|
||||
#23431#26122
|
||||
#33509#20961
|
||||
#26133#32453
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl2Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1158
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 132
|
||||
Width = 1158
|
||||
Height = 423
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 4
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.First.Visible = True
|
||||
NavigatorButtons.PriorPage.Visible = True
|
||||
NavigatorButtons.Prior.Visible = True
|
||||
NavigatorButtons.Next.Visible = True
|
||||
NavigatorButtons.NextPage.Visible = True
|
||||
NavigatorButtons.Last.Visible = True
|
||||
NavigatorButtons.Insert.Visible = True
|
||||
NavigatorButtons.Delete.Visible = True
|
||||
NavigatorButtons.Edit.Visible = True
|
||||
NavigatorButtons.Post.Visible = True
|
||||
NavigatorButtons.Cancel.Visible = True
|
||||
NavigatorButtons.Refresh.Visible = True
|
||||
NavigatorButtons.SaveBookmark.Visible = True
|
||||
NavigatorButtons.GotoBookmark.Visible = True
|
||||
NavigatorButtons.Filter.Visible = True
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
Column = v1YGName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1YGName
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1FFMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1GZMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1JLMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KCDMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KFKMeny
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KGSMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KOtherMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KQJMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KSBMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1DXGZMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1JKMoney
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle3
|
||||
object v1Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 41
|
||||
end
|
||||
object v1FFDate: TcxGridDBColumn
|
||||
Caption = #21457#25918#26085#26399
|
||||
DataBinding.FieldName = 'FFDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1XHNo: TcxGridDBColumn
|
||||
Caption = #24207#21495
|
||||
DataBinding.FieldName = 'XHNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 38
|
||||
end
|
||||
object v1YGName: TcxGridDBColumn
|
||||
Caption = #22995#21517
|
||||
DataBinding.FieldName = 'YGName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 76
|
||||
end
|
||||
object v1GZMoney: TcxGridDBColumn
|
||||
Caption = #26376#24037#36164
|
||||
DataBinding.FieldName = 'GZMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 82
|
||||
end
|
||||
object v1KQJMoney: TcxGridDBColumn
|
||||
Caption = #35831#20551#22825#25968
|
||||
DataBinding.FieldName = 'KQJMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KSBMoney: TcxGridDBColumn
|
||||
Caption = #20241#24687#22825#25968
|
||||
DataBinding.FieldName = 'KSBMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KOtherMoney: TcxGridDBColumn
|
||||
Caption = #19978#29677#22825#25968
|
||||
DataBinding.FieldName = 'KOtherMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 88
|
||||
end
|
||||
object v1DXGZMoney: TcxGridDBColumn
|
||||
Caption = #22522#26412#24037#36164
|
||||
DataBinding.FieldName = 'DXGZMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1GLFLMoney: TcxGridDBColumn
|
||||
Caption = #24037#40836'/'#31119#21033
|
||||
DataBinding.FieldName = 'GLFLMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KGSMoney: TcxGridDBColumn
|
||||
Caption = #23703#20301#34917#36148
|
||||
DataBinding.FieldName = 'KGSMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 72
|
||||
end
|
||||
object v1KFKMeny: TcxGridDBColumn
|
||||
Caption = #20445#38505#34917#36148
|
||||
DataBinding.FieldName = 'KFKMeny'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1CJBGZMoney: TcxGridDBColumn
|
||||
Caption = #24037#36164
|
||||
DataBinding.FieldName = 'JBGZMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KCDMoney: TcxGridDBColumn
|
||||
Caption = #32771#21220#32602#27454
|
||||
DataBinding.FieldName = 'KCDMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1JKMoney: TcxGridDBColumn
|
||||
Caption = #25187#27454
|
||||
DataBinding.FieldName = 'JKMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FFMoney: TcxGridDBColumn
|
||||
Caption = #24212#21457#24037#36164
|
||||
DataBinding.FieldName = 'FFMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1JLMoney: TcxGridDBColumn
|
||||
Caption = #22870#37329
|
||||
DataBinding.FieldName = 'JLMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKSYSTEM: TcxGridDBColumn
|
||||
Caption = #20184#27454#25260#22836
|
||||
DataBinding.FieldName = 'FKSYSTEM'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKType: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1XZNote: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'XZNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 86
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 509
|
||||
Top = 194
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 944
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 537
|
||||
Top = 194
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1023
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1061
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 482
|
||||
Top = 193
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 336
|
||||
Top = 192
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 568
|
||||
Top = 196
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clRed
|
||||
end
|
||||
object cxStyle3: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 364
|
||||
Top = 192
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
393
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFFCX.pas
Normal file
393
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZFFCX.pas
Normal file
|
|
@ -0,0 +1,393 @@
|
|||
unit U_GRYearPFList_YGXZFFCX;
|
||||
|
||||
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, cxCheckBox, Menus, cxCurrencyEdit, cxDropDownEdit;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_YGXZFFCX = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
TBAdd: TToolButton;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
cxStyle3: TcxStyle;
|
||||
TCXFK: TToolButton;
|
||||
Label3: TLabel;
|
||||
YGName: TEdit;
|
||||
cxTabControl1: TcxTabControl;
|
||||
Label5: TLabel;
|
||||
FKType: TEdit;
|
||||
ToolButton2: TToolButton;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
cxTabControl2: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Ssel: TcxGridDBColumn;
|
||||
v1FFDate: TcxGridDBColumn;
|
||||
v1XHNo: TcxGridDBColumn;
|
||||
v1YGName: TcxGridDBColumn;
|
||||
v1GZMoney: TcxGridDBColumn;
|
||||
v1KQJMoney: TcxGridDBColumn;
|
||||
v1KSBMoney: TcxGridDBColumn;
|
||||
v1KOtherMoney: TcxGridDBColumn;
|
||||
v1DXGZMoney: TcxGridDBColumn;
|
||||
v1GLFLMoney: TcxGridDBColumn;
|
||||
v1KGSMoney: TcxGridDBColumn;
|
||||
v1KFKMeny: TcxGridDBColumn;
|
||||
v1CJBGZMoney: TcxGridDBColumn;
|
||||
v1KCDMoney: TcxGridDBColumn;
|
||||
v1JKMoney: TcxGridDBColumn;
|
||||
v1FFMoney: TcxGridDBColumn;
|
||||
v1JLMoney: TcxGridDBColumn;
|
||||
v1FKSYSTEM: TcxGridDBColumn;
|
||||
v1FKType: TcxGridDBColumn;
|
||||
v1XZNote: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure v1PriceUnitPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure YGNameChange(Sender: TObject);
|
||||
procedure TCXFKClick(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure cxTabControl2Change(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_YGXZFFCX: TfrmGRYearPFList_YGXZFFCX;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel,U_YGYPInPut_YGXZDJ;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.setstatus();
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TCXFK.Visible:=False;
|
||||
Toolbutton2.Visible:=False;
|
||||
if trim(DParameters1)<>'查询' then
|
||||
begin
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TBAdd.Visible:=True;
|
||||
Toolbutton2.Visible:=True;
|
||||
end;
|
||||
1:begin
|
||||
TCXFK.Visible:=true;
|
||||
end;
|
||||
2:begin
|
||||
TCXFK.Visible:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_YGXZFFCX:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('工资付款登记22',Tv1,'分红管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.InitGrid();
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_XZFF_Main A ');
|
||||
sql.add('inner join OA_YG_XZFF B on B.XZMain=A.XZMain ');
|
||||
sql.add('where A.filltime>='''+trim(formatdatetime('yyyy-MM-dd',begdate.DateTime))+''' ');
|
||||
sql.add('and A.filltime<'''+trim(formatdatetime('yyyy-MM-dd',Enddate.dateTime+1))+''' ');
|
||||
sql.add('and B.ChkStatus=''已审核'' ');
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.add('and isnull(B.FKStatus,'''')='''' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.add('and isnull(B.FKStatus,'''')=''已付款'' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
sql.add('and isnull(B.FKStatus,'''')=''作废'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=0 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''云翔'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=1 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''宇昊'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=2 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''若凡'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=3 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''昕绅'' ');
|
||||
end;
|
||||
sql.add('Order By A.SSYear,A.SSMonth,B.XHNo');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-30;
|
||||
ReadCxGrid('工资付款登记22',Tv1,'分红管理');
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('工资付款',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryTemp.Active=False then Exit;
|
||||
SDofilter(ADOQueryTemp,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
toolbar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=true then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set FKStatus=''已付款'',FKDate=getdate(),FKNote='''+trim(Order_Main.fieldbyname('FKNote').AsString)+''' ');
|
||||
sql.add('where XZId='''+trim(Order_Main.fieldbyname('XZId').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('付款成功','提示');
|
||||
except;
|
||||
application.MessageBox('付款失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.v1PriceUnitPropertiesButtonClick(
|
||||
Sender: TObject; AButtonIndex: Integer);
|
||||
begin
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='PriceUnit';
|
||||
flagname:='币种';
|
||||
if showModal=1 then
|
||||
begin
|
||||
with Order_Main do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('PriceUnit').asstring:=trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.YGNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton1.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.TCXFKClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=true then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set FKstatus='''',FKDate=NULL,FKNote='''' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('撤销成功','提示');
|
||||
except;
|
||||
application.MessageBox('撤销失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
setstatus();
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.cxTabControl2Change(Sender: TObject);
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
toolbar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if cxTabControl1.TabIndex<>0 then exit;
|
||||
if order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=true then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set FKStatus=''作废'',FKNote='''+trim(Order_Main.fieldbyname('FKNote').AsString)+''' ');
|
||||
sql.add('where XZId='''+trim(Order_Main.fieldbyname('XZId').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('作废成功','提示');
|
||||
except;
|
||||
application.MessageBox('作废失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZFFCX.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
end.
|
||||
686
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZTJ.dfm
Normal file
686
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZTJ.dfm
Normal file
|
|
@ -0,0 +1,686 @@
|
|||
object frmGRYearPFList_YGXZTJ: TfrmGRYearPFList_YGXZTJ
|
||||
Left = 189
|
||||
Top = 135
|
||||
Width = 1260
|
||||
Height = 675
|
||||
Caption = #21592#24037#34218#36164#21457#25918#30331#35760
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object Label6: TLabel
|
||||
Left = 342
|
||||
Top = 20
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #22995' '#21517
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1244
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TUpdate: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TUpdateClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TTJ: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25552#20132
|
||||
ImageIndex = 31
|
||||
OnClick = TTJClick
|
||||
end
|
||||
object TCXTJ: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#25552#20132
|
||||
ImageIndex = 52
|
||||
OnClick = TCXTJClick
|
||||
end
|
||||
object TSsel: TToolButton
|
||||
Left = 465
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#30475
|
||||
ImageIndex = 22
|
||||
OnClick = TSselClick
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 528
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 591
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
object TCHk: TToolButton
|
||||
Left = 654
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23457#26680
|
||||
ImageIndex = 75
|
||||
Visible = False
|
||||
OnClick = TCHkClick
|
||||
end
|
||||
object TCXChk: TToolButton
|
||||
Left = 717
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#23457#26680
|
||||
ImageIndex = 52
|
||||
Visible = False
|
||||
OnClick = TCXChkClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1244
|
||||
Height = 51
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label2: TLabel
|
||||
Left = 192
|
||||
Top = 20
|
||||
Width = 21
|
||||
Height = 13
|
||||
Caption = '---'
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 41
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #26597#35810#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 342
|
||||
Top = 20
|
||||
Width = 60
|
||||
Height = 13
|
||||
Caption = #22995' '#21517
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
Left = 553
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20184#27454#26041#24335
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 100
|
||||
Top = 15
|
||||
Width = 94
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 211
|
||||
Top = 15
|
||||
Width = 95
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object YGName: TEdit
|
||||
Tag = 2
|
||||
Left = 404
|
||||
Top = 15
|
||||
Width = 110
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
OnChange = YGNameChange
|
||||
end
|
||||
object FKType: TComboBox
|
||||
Tag = 2
|
||||
Left = 611
|
||||
Top = 15
|
||||
Width = 109
|
||||
Height = 21
|
||||
ItemHeight = 13
|
||||
TabOrder = 3
|
||||
OnChange = YGNameChange
|
||||
Items.Strings = (
|
||||
#29616#37329
|
||||
#25171#21345)
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 83
|
||||
Width = 1244
|
||||
Height = 25
|
||||
Align = alTop
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#25552#20132
|
||||
#24050#25552#20132
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 25
|
||||
ClientRectRight = 1244
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxTabControl2: TcxTabControl
|
||||
Left = 0
|
||||
Top = 108
|
||||
Width = 1244
|
||||
Height = 24
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 3
|
||||
Tabs.Strings = (
|
||||
#20113#32724
|
||||
#23431#26122
|
||||
#33509#20961
|
||||
#26133#32453
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl2Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1244
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 132
|
||||
Width = 1244
|
||||
Height = 503
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 4
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
NavigatorButtons.First.Visible = True
|
||||
NavigatorButtons.PriorPage.Visible = True
|
||||
NavigatorButtons.Prior.Visible = True
|
||||
NavigatorButtons.Next.Visible = True
|
||||
NavigatorButtons.NextPage.Visible = True
|
||||
NavigatorButtons.Last.Visible = True
|
||||
NavigatorButtons.Insert.Visible = True
|
||||
NavigatorButtons.Delete.Visible = True
|
||||
NavigatorButtons.Edit.Visible = True
|
||||
NavigatorButtons.Post.Visible = True
|
||||
NavigatorButtons.Cancel.Visible = True
|
||||
NavigatorButtons.Refresh.Visible = True
|
||||
NavigatorButtons.SaveBookmark.Visible = True
|
||||
NavigatorButtons.GotoBookmark.Visible = True
|
||||
NavigatorButtons.Filter.Visible = True
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Position = spFooter
|
||||
Column = v1YGName
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skCount
|
||||
Column = v1YGName
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1FFMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1GZMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1JLMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KCDMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KFKMeny
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KGSMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KOtherMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KQJMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1KSBMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1DXGZMoney
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1JKMoney
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = cxStyle3
|
||||
object v1Ssel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'Ssel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 41
|
||||
end
|
||||
object v1FFDate: TcxGridDBColumn
|
||||
Caption = #21457#25918#26085#26399
|
||||
DataBinding.FieldName = 'FFDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1XHNo: TcxGridDBColumn
|
||||
Caption = #24207#21495
|
||||
DataBinding.FieldName = 'XHNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 38
|
||||
end
|
||||
object v1YGName: TcxGridDBColumn
|
||||
Caption = #22995#21517
|
||||
DataBinding.FieldName = 'YGName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 76
|
||||
end
|
||||
object v1GZMoney: TcxGridDBColumn
|
||||
Caption = #26376#24037#36164
|
||||
DataBinding.FieldName = 'GZMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 82
|
||||
end
|
||||
object v1KQJMoney: TcxGridDBColumn
|
||||
Caption = #35831#20551#22825#25968
|
||||
DataBinding.FieldName = 'KQJMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KSBMoney: TcxGridDBColumn
|
||||
Caption = #20241#24687#22825#25968
|
||||
DataBinding.FieldName = 'KSBMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KOtherMoney: TcxGridDBColumn
|
||||
Caption = #19978#29677#22825#25968
|
||||
DataBinding.FieldName = 'KOtherMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 88
|
||||
end
|
||||
object v1DXGZMoney: TcxGridDBColumn
|
||||
Caption = #22522#26412#24037#36164
|
||||
DataBinding.FieldName = 'DXGZMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1GLFLMoney: TcxGridDBColumn
|
||||
Caption = #24037#40836'/'#31119#21033
|
||||
DataBinding.FieldName = 'GLFLMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KGSMoney: TcxGridDBColumn
|
||||
Caption = #23703#20301#34917#36148
|
||||
DataBinding.FieldName = 'KGSMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 72
|
||||
end
|
||||
object v1KFKMeny: TcxGridDBColumn
|
||||
Caption = #20445#38505#34917#36148
|
||||
DataBinding.FieldName = 'KFKMeny'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1CJBGZMoney: TcxGridDBColumn
|
||||
Caption = #24037#36164
|
||||
DataBinding.FieldName = 'JBGZMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1KCDMoney: TcxGridDBColumn
|
||||
Caption = #32771#21220#32602#27454
|
||||
DataBinding.FieldName = 'KCDMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1JKMoney: TcxGridDBColumn
|
||||
Caption = #25187#27454
|
||||
DataBinding.FieldName = 'JKMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FFMoney: TcxGridDBColumn
|
||||
Caption = #24212#21457#24037#36164
|
||||
DataBinding.FieldName = 'FFMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1JLMoney: TcxGridDBColumn
|
||||
Caption = #22870#37329
|
||||
DataBinding.FieldName = 'JLMoney'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKSYSTEM: TcxGridDBColumn
|
||||
Caption = #20184#27454#25260#22836
|
||||
DataBinding.FieldName = 'FKSYSTEM'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKType: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 70
|
||||
end
|
||||
object v1XZNote: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'XZNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Sorting = False
|
||||
Width = 86
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 512
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 944
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 988
|
||||
Top = 4
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 540
|
||||
Top = 196
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1023
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1061
|
||||
Top = 5
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 332
|
||||
Top = 192
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 360
|
||||
Top = 192
|
||||
end
|
||||
object cxStyleRepository1: TcxStyleRepository
|
||||
object cxStyle1: TcxStyle
|
||||
AssignedValues = [svTextColor]
|
||||
TextColor = clBlue
|
||||
end
|
||||
object cxStyle2: TcxStyle
|
||||
AssignedValues = [svFont, svTextColor]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
TextColor = clRed
|
||||
end
|
||||
object cxStyle3: TcxStyle
|
||||
AssignedValues = [svFont]
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = [fsBold]
|
||||
end
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 304
|
||||
Top = 192
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
514
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZTJ.pas
Normal file
514
云翔OA(WTOA.dll)/U_GRYearPFList_YGXZTJ.pas
Normal file
|
|
@ -0,0 +1,514 @@
|
|||
unit U_GRYearPFList_YGXZTJ;
|
||||
|
||||
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, cxCheckBox, Menus, cxCurrencyEdit, cxDropDownEdit;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_YGXZTJ = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
cxStyle3: TcxStyle;
|
||||
TSsel: TToolButton;
|
||||
TUpdate: TToolButton;
|
||||
TCHk: TToolButton;
|
||||
TCXChk: TToolButton;
|
||||
cxTabControl1: TcxTabControl;
|
||||
Label3: TLabel;
|
||||
YGName: TEdit;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
TTJ: TToolButton;
|
||||
TCXTJ: TToolButton;
|
||||
cxTabControl2: TcxTabControl;
|
||||
FKType: TComboBox;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1XHNo: TcxGridDBColumn;
|
||||
v1YGName: TcxGridDBColumn;
|
||||
v1GZMoney: TcxGridDBColumn;
|
||||
v1KQJMoney: TcxGridDBColumn;
|
||||
v1KSBMoney: TcxGridDBColumn;
|
||||
v1KOtherMoney: TcxGridDBColumn;
|
||||
v1DXGZMoney: TcxGridDBColumn;
|
||||
v1GLFLMoney: TcxGridDBColumn;
|
||||
v1KGSMoney: TcxGridDBColumn;
|
||||
v1KFKMeny: TcxGridDBColumn;
|
||||
v1CJBGZMoney: TcxGridDBColumn;
|
||||
v1KCDMoney: TcxGridDBColumn;
|
||||
v1JKMoney: TcxGridDBColumn;
|
||||
v1FFMoney: TcxGridDBColumn;
|
||||
v1JLMoney: TcxGridDBColumn;
|
||||
v1FKSYSTEM: TcxGridDBColumn;
|
||||
v1FKType: TcxGridDBColumn;
|
||||
v1XZNote: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1Ssel: TcxGridDBColumn;
|
||||
v1FFDate: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TSselClick(Sender: TObject);
|
||||
procedure TUpdateClick(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure TCHkClick(Sender: TObject);
|
||||
procedure TCXChkClick(Sender: TObject);
|
||||
procedure YGNameChange(Sender: TObject);
|
||||
procedure TTJClick(Sender: TObject);
|
||||
procedure cxTabControl2Change(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure TCXTJClick(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure setstatus();
|
||||
{ Private declarations }
|
||||
public
|
||||
Ftype:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_YGXZTJ: TfrmGRYearPFList_YGXZTJ;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel,U_YGYPInPut_YGXZDJ;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmGRYearPFList_YGXZTJ.setstatus();
|
||||
begin
|
||||
TTJ.Visible:=False;
|
||||
TCXTJ.Visible:=False;
|
||||
Tupdate.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
case cxTabControl1.TabIndex of
|
||||
0:begin
|
||||
TTJ.Visible:=True;
|
||||
Tupdate.Visible:=True;
|
||||
TBDel.Visible:=True;
|
||||
end;
|
||||
1:begin
|
||||
TCXTJ.Visible:=True;
|
||||
end;
|
||||
2:begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_YGXZTJ:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('员工工资登记12',Tv1,'分红管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.InitGrid();
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_XZFF_Main A ');
|
||||
sql.add('inner join OA_YG_XZFF B on B.XZMain=A.XZMain ');
|
||||
sql.add('where A.filltime>='''+trim(formatdatetime('yyyy-MM-dd',begdate.DateTime))+''' ');
|
||||
sql.add('and A.filltime<'''+trim(formatdatetime('yyyy-MM-dd',Enddate.dateTime+1))+''' ');
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.add('and isnull(B.ChkStatus,'''')=''待提交'' ');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.add('and B.ChkStatus<>''待提交'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=0 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''云翔'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=1 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''宇昊'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=2 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''若凡'' ');
|
||||
end;
|
||||
if cxtabControl2.TabIndex=3 then
|
||||
begin
|
||||
sql.add('and B.FKSYSTEM=''昕绅'' ');
|
||||
end;
|
||||
sql.add('Order By A.SSYear,A.SSMonth,B.XHNo');
|
||||
open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-30;
|
||||
ReadCxGrid('员工工资登记12',Tv1,'分红管理');
|
||||
setstatus();
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('员工工资',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if ADOQueryTemp.Active=False then Exit;
|
||||
SDofilter(ADOQueryTemp,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryTemp,Order_Main);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
if application.MessageBox('确定要删除吗','提示',1)=2 then exit;
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from OA_YG_XZFF ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
frmYGYPInPut_YGXZDJ:=TfrmYGYPInPut_YGXZDJ.create(self);
|
||||
with frmYGYPInPut_YGXZDJ do
|
||||
begin
|
||||
FXZMain:='';
|
||||
FXZSubid:='';
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TSselClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.isempty then exit;
|
||||
frmYGYPInPut_YGXZDJ:=TfrmYGYPInPut_YGXZDJ.create(self);
|
||||
with frmYGYPInPut_YGXZDJ do
|
||||
begin
|
||||
ToolBar1.Enabled:=False;
|
||||
Panel3.Enabled:=False;
|
||||
toolbar2.Enabled:=False;
|
||||
FXZMain:=trim(Order_Main.fieldbyname('XZMain').AsString);
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TUpdateClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Order_Main.IsEmpty then exit;
|
||||
frmYGYPInPut_YGXZDJ:=TfrmYGYPInPut_YGXZDJ.create(self);
|
||||
with frmYGYPInPut_YGXZDJ do
|
||||
begin
|
||||
FXZMain:=trim(Order_Main.fieldbyname('XZMain').AsString);
|
||||
FXZSubid:=trim(Order_Main.fieldbyname('XZID').AsString);
|
||||
if showmodal=1 then
|
||||
begin
|
||||
initGrid();
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
setstatus();
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TCHkClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''已审核'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('审核成功','提示');
|
||||
except;
|
||||
application.MessageBox('审核失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TCXChkClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
if order_Main.fieldbyname('Chkstatus').asstring<>'已审核' then
|
||||
begin
|
||||
application.MessageBox('有已付款数据不能撤销','提示');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''待审核'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('审核成功','提示');
|
||||
except;
|
||||
application.MessageBox('审核失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.YGNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton1.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
{if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;}
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''待审核'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('提交成功','提示');
|
||||
except;
|
||||
application.MessageBox('提交失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.cxTabControl2Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.Tv1CellDblClick(
|
||||
Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
TSsel.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_YGXZTJ.TCXTJClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then exit;
|
||||
if Order_Main.Locate('Ssel',true,[])=False then
|
||||
begin
|
||||
application.MessageBox('没有选择数据','提示');
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
with Order_Main do
|
||||
begin
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean=True then
|
||||
begin
|
||||
if fieldbyname('Chkstatus').AsString<>'待审核' then
|
||||
begin
|
||||
application.MessageBox('已审核不能撤销','提交');
|
||||
exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update OA_YG_XZFF set Chkstatus=''待提交'' ');
|
||||
sql.add('where XZID='''+trim(Order_Main.fieldbyname('XZID').AsString)+'''');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
initGrid();
|
||||
application.MessageBox('撤销成功','提示');
|
||||
except;
|
||||
application.MessageBox('撤销失败','提示');
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
716
云翔OA(WTOA.dll)/U_GRYearPFList_ZPF.dfm
Normal file
716
云翔OA(WTOA.dll)/U_GRYearPFList_ZPF.dfm
Normal file
|
|
@ -0,0 +1,716 @@
|
|||
object frmGRYearPFList_ZPF: TfrmGRYearPFList_ZPF
|
||||
Left = 190
|
||||
Top = 89
|
||||
Width = 1170
|
||||
Height = 635
|
||||
Caption = #20010#20154#24180#24230#24635#35780#20998
|
||||
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 = 1154
|
||||
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_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1154
|
||||
Height = 69
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 38
|
||||
Top = 18
|
||||
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 lbl1: TLabel
|
||||
Left = 210
|
||||
Top = 18
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #34987#32771#26680#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 392
|
||||
Top = 18
|
||||
Width = 54
|
||||
Height = 12
|
||||
Caption = #37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 210
|
||||
Top = 42
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#24180#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 392
|
||||
Top = 42
|
||||
Width = 52
|
||||
Height = 12
|
||||
Caption = #35780#20998#26376#20221
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 580
|
||||
Top = 18
|
||||
Width = 53
|
||||
Height = 12
|
||||
Caption = #24635' '#37096' '#38376
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 92
|
||||
Top = 14
|
||||
Width = 85
|
||||
Height = 20
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 91
|
||||
Top = 38
|
||||
Width = 86
|
||||
Height = 20
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object GRName: TEdit
|
||||
Tag = 2
|
||||
Left = 262
|
||||
Top = 14
|
||||
Width = 96
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object Dept: TEdit
|
||||
Tag = 2
|
||||
Left = 448
|
||||
Top = 14
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFYear: TEdit
|
||||
Tag = 2
|
||||
Left = 262
|
||||
Top = 38
|
||||
Width = 96
|
||||
Height = 20
|
||||
TabOrder = 4
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object PFMonth: TEdit
|
||||
Tag = 2
|
||||
Left = 448
|
||||
Top = 38
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 5
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
object ZDept: TEdit
|
||||
Tag = 2
|
||||
Left = 636
|
||||
Top = 14
|
||||
Width = 98
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnChange = GRNameChange
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 101
|
||||
Width = 1154
|
||||
Height = 250
|
||||
Align = alTop
|
||||
TabOrder = 2
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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 = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Filltime: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26085#26399
|
||||
DataBinding.FieldName = 'Filltime'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1GRName: TcxGridDBColumn
|
||||
Caption = #34987#32771#26680#20154
|
||||
DataBinding.FieldName = 'GRName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1YWNum: TcxGridDBColumn
|
||||
Caption = #19994#21153#35780#20998
|
||||
DataBinding.FieldName = 'YWNum'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 74
|
||||
end
|
||||
object v1XZNum: TcxGridDBColumn
|
||||
Caption = #34892#25919#35780#20998
|
||||
DataBinding.FieldName = 'XZNum'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 83
|
||||
end
|
||||
object v1SCNum: TcxGridDBColumn
|
||||
Caption = #29983#20135#35780#20998
|
||||
DataBinding.FieldName = 'SCNum'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1CWNum: TcxGridDBColumn
|
||||
Caption = #36130#21153#35780#20998
|
||||
DataBinding.FieldName = 'CWNum'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1PFSumNum: TcxGridDBColumn
|
||||
Caption = #20869#37096#35780#20998
|
||||
DataBinding.FieldName = 'PFSumNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 90
|
||||
end
|
||||
object v1WPFSumNum: TcxGridDBColumn
|
||||
Caption = #22806#37096#35780#20998
|
||||
DataBinding.FieldName = 'WPFSumNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object TVZPFNum: TcxGridDBColumn
|
||||
Caption = #24635#35780#20998
|
||||
DataBinding.FieldName = 'ZPFNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 94
|
||||
end
|
||||
object v1Dept: TcxGridDBColumn
|
||||
Caption = #37096#38376
|
||||
DataBinding.FieldName = 'Dept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object v1ZDept: TcxGridDBColumn
|
||||
Caption = #24635#37096#38376
|
||||
DataBinding.FieldName = 'ZDept'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1GangWei: TcxGridDBColumn
|
||||
Caption = #32844#20301
|
||||
DataBinding.FieldName = 'GangWei'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 87
|
||||
end
|
||||
object v1RZDate: TcxGridDBColumn
|
||||
Caption = #20837#32844#26085#26399
|
||||
DataBinding.FieldName = 'RZDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
Properties.SaveTime = False
|
||||
Properties.ShowTime = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 93
|
||||
end
|
||||
object v1PFMonth: TcxGridDBColumn
|
||||
Caption = #35780#20998#26376#20221
|
||||
DataBinding.FieldName = 'PFMonth'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1PFYear: TcxGridDBColumn
|
||||
Caption = #35780#20998#24180#20221
|
||||
DataBinding.FieldName = 'PFYear'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid3: TcxGrid
|
||||
Left = 541
|
||||
Top = 351
|
||||
Width = 613
|
||||
Height = 246
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object TV2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = Source1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFYWNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = V2FPCWNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFXZNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFSCNum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object TPFYDian: TcxGridDBColumn
|
||||
Caption = #35780#20215#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 318
|
||||
end
|
||||
object TPFMNum: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 46
|
||||
end
|
||||
object TPFYWNum: TcxGridDBColumn
|
||||
Caption = #19994#21153#35780#20998
|
||||
DataBinding.FieldName = 'PFYWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 58
|
||||
end
|
||||
object TPFXZNum: TcxGridDBColumn
|
||||
Caption = #34892#25919#35780#20998
|
||||
DataBinding.FieldName = 'PFXZNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 58
|
||||
end
|
||||
object TPFSCNum: TcxGridDBColumn
|
||||
Caption = #29983#20135#35780#20998
|
||||
DataBinding.FieldName = 'PFSCNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Options.Sorting = False
|
||||
Width = 58
|
||||
end
|
||||
object V2FPCWNum: TcxGridDBColumn
|
||||
Caption = #36130#21153#35780#20998
|
||||
DataBinding.FieldName = 'FPCWNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Options.Sorting = False
|
||||
Width = 58
|
||||
end
|
||||
end
|
||||
object cxGridLevel2: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 351
|
||||
Width = 541
|
||||
Height = 246
|
||||
Align = alLeft
|
||||
TabOrder = 4
|
||||
object Tv3: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource3
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFZPNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFSJNum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = TPFXJNum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #35780#20215#35201#28857
|
||||
DataBinding.FieldName = 'PFYDian'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 324
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #28385#20998
|
||||
DataBinding.FieldName = 'PFMNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 46
|
||||
end
|
||||
object TPFZPNum: TcxGridDBColumn
|
||||
Caption = #33258#35780
|
||||
DataBinding.FieldName = 'PFZPNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 39
|
||||
end
|
||||
object TPFSJNum: TcxGridDBColumn
|
||||
Caption = #19978#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFSJNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 58
|
||||
end
|
||||
object TPFXJNum: TcxGridDBColumn
|
||||
Caption = #19979#32423#35780#20998
|
||||
DataBinding.FieldName = 'PFXJNum'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 58
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv3
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 516
|
||||
Top = 196
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 584
|
||||
Top = 176
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 636
|
||||
Top = 176
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 696
|
||||
Top = 180
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 872
|
||||
Top = 188
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 771
|
||||
Top = 179
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 729
|
||||
Top = 161
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object Source1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 244
|
||||
Top = 256
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 264
|
||||
Top = 352
|
||||
end
|
||||
object DataSource3: TDataSource
|
||||
DataSet = CDS_PRT
|
||||
Left = 464
|
||||
Top = 408
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 636
|
||||
Top = 176
|
||||
end
|
||||
end
|
||||
346
云翔OA(WTOA.dll)/U_GRYearPFList_ZPF.pas
Normal file
346
云翔OA(WTOA.dll)/U_GRYearPFList_ZPF.pas
Normal file
|
|
@ -0,0 +1,346 @@
|
|||
unit U_GRYearPFList_ZPF;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmGRYearPFList_ZPF = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
Panel1: TPanel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
lbl1: TLabel;
|
||||
lbl3: TLabel;
|
||||
GRName: TEdit;
|
||||
Dept: TEdit;
|
||||
Source1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Filltime: TcxGridDBColumn;
|
||||
v1GRName: TcxGridDBColumn;
|
||||
v1YWNum: TcxGridDBColumn;
|
||||
v1XZNum: TcxGridDBColumn;
|
||||
v1SCNum: TcxGridDBColumn;
|
||||
v1CWNum: TcxGridDBColumn;
|
||||
TVZPFNum: TcxGridDBColumn;
|
||||
v1Dept: TcxGridDBColumn;
|
||||
v1GangWei: TcxGridDBColumn;
|
||||
v1RZDate: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1PFSumNum: TcxGridDBColumn;
|
||||
v1WPFSumNum: TcxGridDBColumn;
|
||||
cxGrid3: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
TPFYDian: TcxGridDBColumn;
|
||||
TPFMNum: TcxGridDBColumn;
|
||||
TPFYWNum: TcxGridDBColumn;
|
||||
TPFXZNum: TcxGridDBColumn;
|
||||
TPFSCNum: TcxGridDBColumn;
|
||||
V2FPCWNum: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv3: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
TPFZPNum: TcxGridDBColumn;
|
||||
TPFSJNum: TcxGridDBColumn;
|
||||
TPFXJNum: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource3: TDataSource;
|
||||
ADOQuery1: TADOQuery;
|
||||
v1PFMonth: TcxGridDBColumn;
|
||||
Label3: TLabel;
|
||||
PFYear: TEdit;
|
||||
Label4: TLabel;
|
||||
PFMonth: TEdit;
|
||||
v1PFYear: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
ZDept: TEdit;
|
||||
v1ZDept: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure GRNameChange(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGRYearPFList_ZPF: TfrmGRYearPFList_ZPF;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp,U_GRYearPFList_Sub,
|
||||
U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGRYearPFList_ZPF:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('个人年度考核总评分',Tv1,'薪酬管理');
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.InitGrid();
|
||||
var Fint: integer;
|
||||
FDEPT,ZDept: string;
|
||||
begin
|
||||
if trim(DParameters1)='部门' then
|
||||
begin
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.* from OA_YG_DangAn A ');
|
||||
sql.Add('inner join SY_Dept B on A.DPID=B.DPID');
|
||||
SQL.Add('where isnull(A.YGEName,YGName)='''+trim(DName)+'''');
|
||||
Open;
|
||||
end;
|
||||
FDEPT:=ADOQuery1.fieldbyname('DPParent').AsString;
|
||||
for Fint:=2 to ADOQuery1.fieldbyname('DPlevel').AsInteger-1 do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_Dept where DPID='''+trim(FDEPT)+'''');
|
||||
open;
|
||||
end;
|
||||
FDEPT:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
||||
end;
|
||||
if ADOQueryCmd.IsEmpty=False then
|
||||
ZDept:=trim(ADOQueryCmd.fieldbyname('DPName').asstring);
|
||||
end;
|
||||
with ADOQueryMain DO
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,B.*, ');
|
||||
sql.add('ZPFNum=isnull(A.PFSumNum*0.6+B.WPFSumNum*0.4,0) ');
|
||||
sql.add('from GRYearPF_Sub A ');
|
||||
sql.Add('inner join GRYearPFWB_Sub B on B.PFSubid=A.PFSubid ');
|
||||
sql.Add('where A.Filltime>='''+formatdatetime('yyyy-MM-dd',BegDate.Time)+''' ');
|
||||
sql.Add('and A.Filltime<'''+formatdatetime('yyyy-MM-dd',enddate.Time+1)+''' ');
|
||||
sql.Add('and (isnull(A.PFStatus,'''')=''评分完成'' ');
|
||||
sql.Add('or isnull(B.PFStatus,'''')=''评分完成'') ');
|
||||
if trim(DParameters1)='' then
|
||||
begin
|
||||
sql.Add('and B.GRName='''+trim(DName)+''' ');
|
||||
end;
|
||||
if trim(DParameters1)='部门' then
|
||||
begin
|
||||
sql.Add('and A.ZDept='''+trim(ZDept)+''' ');
|
||||
//sql.Add('and B.ZDept='''+trim(ZDept)+'''')
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,CDS_PRT);
|
||||
SInitCDSData20(ADOQueryCmd,CDS_PRT);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.InitForm();
|
||||
begin
|
||||
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDate(ADOQueryTemp)-7;
|
||||
ReadCxGrid('个人年度考核总评分',Tv1,'薪酬管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('个人年度总评分',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPFWB_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,Order_Sub);
|
||||
SInitCDSData20(ADOQueryCmd,Order_Sub);
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from GRYearPF_SubMX ');
|
||||
sql.Add('where PFSubID='''+trim(Order_Main.fieldbyname('PFSubID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryCmd,CDS_PRT);
|
||||
SInitCDSData20(ADOQueryCmd,CDS_PRT);
|
||||
end;
|
||||
|
||||
procedure TfrmGRYearPFList_ZPF.GRNameChange(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.
|
||||
302
云翔OA(WTOA.dll)/U_GYSInPutTab.dfm
Normal file
302
云翔OA(WTOA.dll)/U_GYSInPutTab.dfm
Normal file
|
|
@ -0,0 +1,302 @@
|
|||
object frmGYSInPutTab: TfrmGYSInPutTab
|
||||
Left = 448
|
||||
Top = 1
|
||||
Width = 1048
|
||||
Height = 728
|
||||
Align = alClient
|
||||
Caption = #20379#24212#21830#20449#24687#24405#20837
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1032
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clBtnFace
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_DDMD.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 59
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 1032
|
||||
Height = 660
|
||||
Align = alClient
|
||||
BevelInner = bvNone
|
||||
BevelOuter = bvNone
|
||||
Color = clBtnFace
|
||||
Ctl3D = False
|
||||
ParentColor = False
|
||||
ParentCtl3D = False
|
||||
TabOrder = 1
|
||||
object Panel3: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1030
|
||||
Height = 658
|
||||
Align = alClient
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
Left = 26
|
||||
Top = 89
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#21517#31216#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label7: TLabel
|
||||
Left = 26
|
||||
Top = 191
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #32852#31995#22320#22336#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 26
|
||||
Top = 140
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #30005#35805#21495#30721#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label11: TLabel
|
||||
Left = 306
|
||||
Top = 140
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20256#30495#21495#30721#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label13: TLabel
|
||||
Left = 306
|
||||
Top = 89
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#31616#31216#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label33: TLabel
|
||||
Left = 26
|
||||
Top = 37
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#32534#21495#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label34: TLabel
|
||||
Left = 306
|
||||
Top = 37
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#31867#22411#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 26
|
||||
Top = 287
|
||||
Width = 91
|
||||
Height = 12
|
||||
Caption = #32479#35745#21333#20301#21517#31216#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 26
|
||||
Top = 239
|
||||
Width = 66
|
||||
Height = 12
|
||||
Caption = #32852' '#31995' '#20154#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 306
|
||||
Top = 239
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #32852#31995#20154#30005#35805#65306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object KHName: TEdit
|
||||
Left = 101
|
||||
Top = 86
|
||||
Width = 160
|
||||
Height = 18
|
||||
TabOrder = 0
|
||||
end
|
||||
object ZKAddress: TEdit
|
||||
Left = 101
|
||||
Top = 188
|
||||
Width = 439
|
||||
Height = 18
|
||||
TabOrder = 1
|
||||
end
|
||||
object ZKTelNo: TEdit
|
||||
Left = 101
|
||||
Top = 137
|
||||
Width = 160
|
||||
Height = 18
|
||||
TabOrder = 2
|
||||
end
|
||||
object ZKFax: TEdit
|
||||
Left = 384
|
||||
Top = 137
|
||||
Width = 153
|
||||
Height = 18
|
||||
TabOrder = 3
|
||||
end
|
||||
object KHNameJC: TEdit
|
||||
Left = 384
|
||||
Top = 86
|
||||
Width = 153
|
||||
Height = 18
|
||||
TabOrder = 4
|
||||
end
|
||||
object KHCode: TEdit
|
||||
Left = 101
|
||||
Top = 34
|
||||
Width = 160
|
||||
Height = 18
|
||||
TabOrder = 5
|
||||
end
|
||||
object KHType: TBtnEditA
|
||||
Left = 384
|
||||
Top = 32
|
||||
Width = 153
|
||||
Height = 20
|
||||
TabOrder = 6
|
||||
OnBtnClick = KHTypeBtnClick
|
||||
end
|
||||
object TJKHName: TEdit
|
||||
Left = 112
|
||||
Top = 284
|
||||
Width = 273
|
||||
Height = 18
|
||||
TabOrder = 7
|
||||
end
|
||||
object LXR: TEdit
|
||||
Left = 101
|
||||
Top = 236
|
||||
Width = 160
|
||||
Height = 18
|
||||
TabOrder = 8
|
||||
end
|
||||
object LXRTel: TEdit
|
||||
Left = 384
|
||||
Top = 236
|
||||
Width = 153
|
||||
Height = 18
|
||||
TabOrder = 9
|
||||
end
|
||||
end
|
||||
end
|
||||
object ADOTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 536
|
||||
Top = 65533
|
||||
end
|
||||
object ADOCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 480
|
||||
Top = 65533
|
||||
end
|
||||
object ADOQuery1: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 504
|
||||
Top = 65533
|
||||
end
|
||||
end
|
||||
286
云翔OA(WTOA.dll)/U_GYSInPutTab.pas
Normal file
286
云翔OA(WTOA.dll)/U_GYSInPutTab.pas
Normal file
|
|
@ -0,0 +1,286 @@
|
|||
unit U_GYSInPutTab;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
||||
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
||||
ExtCtrls, BtnEdit, cxCalendar,StrUtils, cxDropDownEdit,jpeg,
|
||||
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, cxPC,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu;
|
||||
|
||||
type
|
||||
TfrmGYSInPutTab = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBClose: TToolButton;
|
||||
ScrollBox1: TScrollBox;
|
||||
ADOTemp: TADOQuery;
|
||||
ADOCmd: TADOQuery;
|
||||
ADOQuery1: TADOQuery;
|
||||
TBSave: TToolButton;
|
||||
Panel3: TPanel;
|
||||
Label1: TLabel;
|
||||
Label7: TLabel;
|
||||
Label10: TLabel;
|
||||
Label11: TLabel;
|
||||
Label13: TLabel;
|
||||
Label33: TLabel;
|
||||
Label34: TLabel;
|
||||
KHName: TEdit;
|
||||
ZKAddress: TEdit;
|
||||
ZKTelNo: TEdit;
|
||||
ZKFax: TEdit;
|
||||
KHNameJC: TEdit;
|
||||
KHCode: TEdit;
|
||||
KHType: TBtnEditA;
|
||||
Label2: TLabel;
|
||||
TJKHName: TEdit;
|
||||
Label3: TLabel;
|
||||
LXR: TEdit;
|
||||
Label4: TLabel;
|
||||
LXRTel: TEdit;
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure SYRNameBtnUpClick(Sender: TObject);
|
||||
procedure SKBankBtnDnClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure KHTypeBtnClick(Sender: TObject);
|
||||
private
|
||||
procedure InitData();
|
||||
function SaveData():Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
canshu1:String;
|
||||
PState,CopyInt:Integer;
|
||||
FMainId:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGYSInPutTab: TfrmGYSInPutTab;
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGYSInPutTab.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSInPutTab.InitData();
|
||||
begin
|
||||
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from ZH_KH_Info where ZKId='''+Trim(FMainId)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCSHDataNew(ADOQuery1,Panel3,0);
|
||||
KHCode.SetFocus;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmGYSInPutTab.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitData();
|
||||
end;
|
||||
|
||||
function TfrmGYSInPutTab.SaveData():Boolean;
|
||||
var
|
||||
maxno:String;
|
||||
begin
|
||||
Result:=False;
|
||||
try
|
||||
ADOCmd.Connection.BeginTrans;
|
||||
///保存主表
|
||||
if Trim(FMainId)='' then
|
||||
begin
|
||||
if GetLSNo(ADOCmd,maxno,'GS','ZH_KH_Info',3,1)=False then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(FMainId);
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from ZH_KH_Info where ZKId='''+Trim(FMainId)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
if Trim(FMainId)='' then
|
||||
begin
|
||||
Append;
|
||||
end
|
||||
else begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('ZKId').Value:=Trim(maxno);
|
||||
if Trim(FMainId)='' then
|
||||
begin
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
end else
|
||||
begin
|
||||
FieldByName('Editer').Value:=Trim(DName);
|
||||
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
||||
end;
|
||||
RTSetsavedata(ADOCmd,'ZH_KH_Info',Panel3,0);
|
||||
FieldByName('Valid').Value:='Y';
|
||||
FieldByName('Type').Value:='GYS';
|
||||
Post;
|
||||
end;
|
||||
if Trim(KHName.Text)<>'' then
|
||||
begin
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from ZH_KH_Info where KHName='''+Trim(KHName.Text)+'''');
|
||||
SQL.Add(' and Type=''GYS'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('供应商名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
if Trim(KHCode.Text)<>'' then
|
||||
begin
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from ZH_KH_Info where KHCode='''+Trim(KHCode.Text)+'''');
|
||||
SQL.Add(' and Type=''GYS'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('供应商编号重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Trim(KHNameJC.Text)<>'' then
|
||||
begin
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from ZH_KH_Info where KHNameJC='''+Trim(KHNameJC.Text)+'''');
|
||||
SQL.Add(' and Type=''GYS'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('供应商简称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
ADOCmd.Connection.CommitTrans;
|
||||
FMainId:=Trim(maxno);
|
||||
Result:=True;
|
||||
except
|
||||
Result:=False;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSInPutTab.SYRNameBtnUpClick(Sender: TObject);
|
||||
var
|
||||
fsj:string;
|
||||
FWZ:Integer;
|
||||
begin
|
||||
fsj:=Trim(TEdit(Sender).Hint);
|
||||
FWZ:=Pos('/',fsj);
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:=Copy(fsj,1,FWZ-1);
|
||||
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSInPutTab.SKBankBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text:='';
|
||||
TBtnEditC(Sender).TxtCode:='';
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TfrmGYSInPutTab.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
if Trim(KHName.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('供应商名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(KHType.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('供应商类型不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(KHCode.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('供应商编号不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(KHNameJC.Text)='' then
|
||||
begin
|
||||
Application.MessageBox('供应商简称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if SaveData() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSInPutTab.KHTypeBtnClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='KHType';
|
||||
flagname:='供应商类型';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
Self.KHType.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
396
云翔OA(WTOA.dll)/U_GYSList.dfm
Normal file
396
云翔OA(WTOA.dll)/U_GYSList.dfm
Normal file
|
|
@ -0,0 +1,396 @@
|
|||
object frmGYSList: TfrmGYSList
|
||||
Left = 47
|
||||
Top = 37
|
||||
Width = 1182
|
||||
Height = 606
|
||||
Caption = #20379#24212#21830#30331#35760
|
||||
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 = 1166
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 95
|
||||
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 TBFind: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = TBFindClick
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 1
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 11
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 252
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#30475
|
||||
ImageIndex = 55
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 315
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 3
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 378
|
||||
Top = 0
|
||||
Caption = #20379#24212#21830#38145#23450
|
||||
ImageIndex = 35
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 473
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #35299#38145
|
||||
ImageIndex = 41
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 536
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 97
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 599
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 99
|
||||
Width = 1166
|
||||
Height = 468
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 46
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
DataBinding.FieldName = 'KHCode'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 117
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#20840#31216
|
||||
DataBinding.FieldName = 'KHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 88
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#31616#31216
|
||||
DataBinding.FieldName = 'KHNameJC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 139
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#31867#22411
|
||||
DataBinding.FieldName = 'KHType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 81
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #32479#35745#21333#20301#21517#31216
|
||||
DataBinding.FieldName = 'TJKHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 102
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'ZKTelNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 96
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'ZKFax'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22320#22336
|
||||
DataBinding.FieldName = 'ZKAddress'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 112
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'LXR'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 82
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154#30005#35805
|
||||
DataBinding.FieldName = 'LXRTel'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 78
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #26159#21542#26377#25928
|
||||
DataBinding.FieldName = 'Valid'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #24050#38145#23450
|
||||
DataBinding.FieldName = 'LockFlag'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 64
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1166
|
||||
Height = 67
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label9: TLabel
|
||||
Left = 27
|
||||
Top = 15
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#31616#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 27
|
||||
Top = 39
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label34: TLabel
|
||||
Left = 261
|
||||
Top = 15
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 253
|
||||
Top = 39
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #32479#35745#21333#20301#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object KHNameJC: TEdit
|
||||
Tag = 2
|
||||
Left = 94
|
||||
Top = 11
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object KHCode: TEdit
|
||||
Tag = 2
|
||||
Left = 94
|
||||
Top = 35
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object KHType: TEdit
|
||||
Tag = 2
|
||||
Left = 332
|
||||
Top = 11
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object TJKHName: TEdit
|
||||
Tag = 2
|
||||
Left = 332
|
||||
Top = 35
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 480
|
||||
Top = 37
|
||||
Width = 97
|
||||
Height = 17
|
||||
Caption = #26174#31034#26080#25928#25968#25454
|
||||
TabOrder = 4
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 464
|
||||
Top = 160
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 432
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 392
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 304
|
||||
Top = 152
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 352
|
||||
Top = 160
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 416
|
||||
Top = 160
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 304
|
||||
Top = 192
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
389
云翔OA(WTOA.dll)/U_GYSList.pas
Normal file
389
云翔OA(WTOA.dll)/U_GYSList.pas
Normal file
|
|
@ -0,0 +1,389 @@
|
|||
unit U_GYSList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
|
||||
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,
|
||||
Menus, cxButtonEdit, cxDropDownEdit;
|
||||
|
||||
type
|
||||
TfrmGYSList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBFind: TToolButton;
|
||||
TBAdd: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
ToolButton1: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label9: TLabel;
|
||||
KHNameJC: TEdit;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
KHCode: TEdit;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label34: TLabel;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
KHType: TEdit;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
TJKHName: TEdit;
|
||||
CheckBox1: TCheckBox;
|
||||
ToolButton2: TToolButton;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
ToolButton3: TToolButton;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure CheckBox2Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure CustomerNoNameChange(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
private
|
||||
canshu1:string;
|
||||
DQdate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
function DelData():Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
FFInt,FCloth:Integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGYSList: TfrmGYSList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_ZDYHelp, U_GYSInPutTab, U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGYSList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGYSList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxgrid1.Align:=alClient;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('供应商登记',Tv1,'供应商管理');
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add(' from ZH_KH_Info A ');
|
||||
sql.Add(' where Type=''GYS'' ');
|
||||
if CheckBox1.Checked=false then
|
||||
begin
|
||||
sql.Add(' and Valid=''Y'' ');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmGYSList.InitForm();
|
||||
begin
|
||||
ReadCxGrid('供应商登记',Tv1,'供应商管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.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 TfrmGYSList.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
try
|
||||
frmGYSInPutTab:=TfrmGYSInPutTab.Create(Application);
|
||||
with frmGYSInPutTab do
|
||||
begin
|
||||
PState:=1;
|
||||
FMainId:=Trim(Self.Order_Main.fieldbyname('ZKId').AsString);
|
||||
frmGYSInPutTab.canshu1:=Trim(Self.canshu1);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmGYSInPutTab.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if DelData() then
|
||||
begin
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TfrmGYSList.DelData():Boolean;
|
||||
begin
|
||||
try
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update ZH_KH_Info Set Valid=''N'' where ZKId='''+Trim(Order_Main.fieldbyname('ZKId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('数据删除异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.IsEmpty then Exit;
|
||||
TcxGridToExcel('供应商列表',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.TBAddClick(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
try
|
||||
frmGYSInPutTab:=TfrmGYSInPutTab.Create(Application);
|
||||
with frmGYSInPutTab do
|
||||
begin
|
||||
PState:=0;
|
||||
FMainId:='';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmGYSInPutTab.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.CheckBox1Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.CheckBox2Click(Sender: TObject);
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
try
|
||||
frmGYSInPutTab:=TfrmGYSInPutTab.Create(Application);
|
||||
with frmGYSInPutTab do
|
||||
begin
|
||||
PState:=1;
|
||||
FMainId:=Trim(Self.Order_Main.fieldbyname('ZKId').AsString);
|
||||
TBSave.Visible:=False;
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmGYSInPutTab.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.CustomerNoNameChange(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 TfrmGYSList.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要锁定数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while Order_Main.Locate('SSel',True,[]) do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update ZH_KH_Info Set ');
|
||||
sql.Add(' LockFlag=1');
|
||||
sql.Add(' where ZKID='''+Order_Main.fieldbyname('ZKID').AsString+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Edit;
|
||||
FieldByName('SSel').Value:=False;
|
||||
FieldByName('LockFlag').Value:=True;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('锁定成功!','提示',0);
|
||||
Exit;
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('锁定异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
procedure TfrmGYSList.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要解锁数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while Order_Main.Locate('SSel',True,[]) do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update ZH_KH_Info Set ');
|
||||
sql.Add(' LockFlag=0');
|
||||
sql.Add(' where ZKID='''+Order_Main.fieldbyname('ZKID').AsString+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Edit;
|
||||
FieldByName('SSel').Value:=False;
|
||||
FieldByName('LockFlag').Value:=False;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('解锁成功!','提示',0);
|
||||
Exit;
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('解锁异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
304
云翔OA(WTOA.dll)/U_GYSSelList.dfm
Normal file
304
云翔OA(WTOA.dll)/U_GYSSelList.dfm
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
object frmGYSSelList: TfrmGYSSelList
|
||||
Left = 206
|
||||
Top = 98
|
||||
Width = 906
|
||||
Height = 606
|
||||
Caption = #20379#24212#21830#36873#25321
|
||||
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 = 890
|
||||
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 TBFind: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = TBFindClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 10
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 99
|
||||
Width = 890
|
||||
Height = 468
|
||||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 1
|
||||
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 = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Header = DataLink_DDMD.Default
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
DataBinding.FieldName = 'KHCode'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 117
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#20840#31216
|
||||
DataBinding.FieldName = 'KHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 88
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#31616#31216
|
||||
DataBinding.FieldName = 'KHNameJC'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 139
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#31867#22411
|
||||
DataBinding.FieldName = 'KHType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 81
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #32479#35745#21333#20301#21517#31216
|
||||
DataBinding.FieldName = 'TJKHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 102
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'ZKTelNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 96
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'ZKFax'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #22320#22336
|
||||
DataBinding.FieldName = 'ZKAddress'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 112
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 890
|
||||
Height = 67
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 2
|
||||
object Label9: TLabel
|
||||
Left = 27
|
||||
Top = 15
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#31616#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 27
|
||||
Top = 39
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label34: TLabel
|
||||
Left = 261
|
||||
Top = 15
|
||||
Width = 65
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 253
|
||||
Top = 39
|
||||
Width = 78
|
||||
Height = 12
|
||||
Caption = #32479#35745#21333#20301#21517#31216
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object KHNameJC: TEdit
|
||||
Tag = 2
|
||||
Left = 94
|
||||
Top = 11
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object KHCode: TEdit
|
||||
Tag = 2
|
||||
Left = 94
|
||||
Top = 35
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object KHType: TEdit
|
||||
Tag = 2
|
||||
Left = 332
|
||||
Top = 11
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
object TJKHName: TEdit
|
||||
Tag = 2
|
||||
Left = 332
|
||||
Top = 35
|
||||
Width = 125
|
||||
Height = 20
|
||||
TabOrder = 3
|
||||
OnChange = CustomerNoNameChange
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 464
|
||||
Top = 160
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
Parameters = <>
|
||||
Left = 432
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 392
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_DDMD.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 304
|
||||
Top = 152
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 352
|
||||
Top = 160
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 416
|
||||
Top = 160
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 304
|
||||
Top = 192
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N2Click
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
221
云翔OA(WTOA.dll)/U_GYSSelList.pas
Normal file
221
云翔OA(WTOA.dll)/U_GYSSelList.pas
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
unit U_GYSSelList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
|
||||
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,
|
||||
Menus, cxButtonEdit, cxDropDownEdit;
|
||||
|
||||
type
|
||||
TfrmGYSSelList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
Order_Main: TClientDataSet;
|
||||
ToolButton1: TToolButton;
|
||||
Panel1: TPanel;
|
||||
Label9: TLabel;
|
||||
KHNameJC: TEdit;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
KHCode: TEdit;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Label34: TLabel;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
KHType: TEdit;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
TJKHName: TEdit;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
N1: TMenuItem;
|
||||
TBFind: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBFindClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure CheckBox2Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure CustomerNoNameChange(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
private
|
||||
canshu1:string;
|
||||
DQdate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
function DelData():Boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
FFInt,FCloth:Integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmGYSSelList: TfrmGYSSelList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_ZDYHelp, U_GYSInPutTab, U_ZDYHelpSel;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmGYSSelList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmGYSSelList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxgrid1.Align:=alClient;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('供应商登记',Tv1,'供应商管理');
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add(' from ZH_KH_Info A ');
|
||||
sql.Add(' where Type=''GYS'' ');
|
||||
sql.Add(' and Valid=''Y'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmGYSSelList.InitForm();
|
||||
begin
|
||||
ReadCxGrid('供应商登记',Tv1,'供应商管理');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.TBFindClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active=False then Exit;
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
end;
|
||||
|
||||
function TfrmGYSSelList.DelData():Boolean;
|
||||
begin
|
||||
try
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Update ZH_KH_Info Set Valid=''N'' where ZKId='''+Trim(Order_Main.fieldbyname('ZKId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('数据删除异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.CheckBox1Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.CheckBox2Click(Sender: TObject);
|
||||
begin
|
||||
TBRafresh.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.CustomerNoNameChange(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 TfrmGYSSelList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
procedure TfrmGYSSelList.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
1708
云翔OA(WTOA.dll)/U_GetDllForm.pas
Normal file
1708
云翔OA(WTOA.dll)/U_GetDllForm.pas
Normal file
File diff suppressed because it is too large
Load Diff
865
云翔OA(WTOA.dll)/U_KDChkList.dfm
Normal file
865
云翔OA(WTOA.dll)/U_KDChkList.dfm
Normal file
|
|
@ -0,0 +1,865 @@
|
|||
object frmKDChkList: TfrmKDChkList
|
||||
Left = 190
|
||||
Top = 135
|
||||
Width = 1245
|
||||
Height = 697
|
||||
Caption = #23492#20214#20449#24687#23457#26680
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1229
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 95
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23457#26680#36890#36807
|
||||
ImageIndex = 22
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
Caption = #23457#26680#19981#36890#36807
|
||||
ImageIndex = 32
|
||||
OnClick = ToolButton6Click
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 308
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23457#26680#25764#38144
|
||||
ImageIndex = 52
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 395
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 458
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25805#20316#35828#26126
|
||||
ImageIndex = 41
|
||||
Visible = False
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 545
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 608
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1229
|
||||
Height = 91
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label1: TLabel
|
||||
Left = 29
|
||||
Top = 15
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #26597#35810#26085#26399
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 200
|
||||
Top = 15
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #38754#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl2: TLabel
|
||||
Left = 200
|
||||
Top = 41
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #25910#20214#22320#21306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 380
|
||||
Top = 15
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #25910#20214#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl4: TLabel
|
||||
Left = 519
|
||||
Top = 15
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl5: TLabel
|
||||
Left = 380
|
||||
Top = 41
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20184#27454#26041#24335
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 632
|
||||
Top = 15
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20462#25913#21407#22240
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 519
|
||||
Top = 41
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #23492#20214#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 200
|
||||
Top = 67
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #24555#36882#20844#21496
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label12: TLabel
|
||||
Left = 380
|
||||
Top = 67
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #21512#21516#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 87
|
||||
Top = 11
|
||||
Width = 92
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 86
|
||||
Top = 37
|
||||
Width = 93
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object KDNO: TEdit
|
||||
Tag = 2
|
||||
Left = 244
|
||||
Top = 11
|
||||
Width = 122
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object Country: TEdit
|
||||
Tag = 2
|
||||
Left = 259
|
||||
Top = 37
|
||||
Width = 107
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KHName: TEdit
|
||||
Tag = 2
|
||||
Left = 424
|
||||
Top = 11
|
||||
Width = 80
|
||||
Height = 21
|
||||
TabOrder = 4
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KDType: TEdit
|
||||
Tag = 2
|
||||
Left = 560
|
||||
Top = 11
|
||||
Width = 65
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object FKType: TEdit
|
||||
Tag = 2
|
||||
Left = 439
|
||||
Top = 37
|
||||
Width = 65
|
||||
Height = 21
|
||||
TabOrder = 6
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object EditNote: TMemo
|
||||
Left = 689
|
||||
Top = 3
|
||||
Width = 387
|
||||
Height = 84
|
||||
TabOrder = 7
|
||||
end
|
||||
object JYPerson: TEdit
|
||||
Tag = 2
|
||||
Left = 560
|
||||
Top = 37
|
||||
Width = 66
|
||||
Height = 21
|
||||
TabOrder = 8
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KDComName: TEdit
|
||||
Tag = 2
|
||||
Left = 259
|
||||
Top = 63
|
||||
Width = 107
|
||||
Height = 21
|
||||
TabOrder = 9
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object ConNO: TEdit
|
||||
Tag = 2
|
||||
Left = 439
|
||||
Top = 63
|
||||
Width = 65
|
||||
Height = 21
|
||||
TabOrder = 10
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 123
|
||||
Width = 1229
|
||||
Height = 23
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#23457#26680
|
||||
#23457#26680#36890#36807
|
||||
#23457#26680#19981#36890#36807
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1229
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 146
|
||||
Width = 1229
|
||||
Height = 357
|
||||
Align = alTop
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column3
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column15
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.ImmediatePost = True
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 51
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'Status'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 76
|
||||
end
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #23492#20214#26085#26399
|
||||
DataBinding.FieldName = 'KDDate'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24555#36882#20844#21496
|
||||
DataBinding.FieldName = 'KDComName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #24555#36882#21333#21495
|
||||
DataBinding.FieldName = 'KDNO'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #23492#20214#20154
|
||||
DataBinding.FieldName = 'JYPerson'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderAlignmentVert = vaCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 93
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #19994#21153#21161#29702
|
||||
DataBinding.FieldName = 'YWZhuLi'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 75
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#22336
|
||||
DataBinding.FieldName = 'ToPlace'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 97
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154
|
||||
DataBinding.FieldName = 'KHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 99
|
||||
end
|
||||
object v1Column24: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154#32852#31995#26041#24335
|
||||
DataBinding.FieldName = 'KHLXFS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 98
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#21306
|
||||
DataBinding.FieldName = 'Country'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 108
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #23492#20214#36135#29289#35814#24773
|
||||
DataBinding.FieldName = 'KDInfo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 132
|
||||
end
|
||||
object v1Column25: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1QSDate: TcxGridDBColumn
|
||||
Caption = #31614#25910#26085#26399
|
||||
DataBinding.FieldName = 'QSDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKName: TcxGridDBColumn
|
||||
Caption = #20184#27454#20154
|
||||
DataBinding.FieldName = 'FKName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1ConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #24555#36882#36153#29992
|
||||
DataBinding.FieldName = 'KDMoneyS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 80
|
||||
end
|
||||
object v1Column26: TcxGridDBColumn
|
||||
Caption = #36153#29992#25910#21462#26041#24335
|
||||
DataBinding.FieldName = 'FeeShouQuType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 94
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Caption = #23492#20214#31867#22411
|
||||
DataBinding.FieldName = 'KDType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
end
|
||||
object v1Column23: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #37325#37327'(KG)'
|
||||
DataBinding.FieldName = 'KgQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_WTOA.FoneRed
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 75
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #36865#23457#26102#38388
|
||||
DataBinding.FieldName = 'SSTime'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 71
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #36865#23457#20154
|
||||
DataBinding.FieldName = 'SSPerson'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #30331#35760#20154
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 69
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26102#38388
|
||||
DataBinding.FieldName = 'FillTime'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #23457#26680#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 61
|
||||
end
|
||||
object v1Column21: TcxGridDBColumn
|
||||
Caption = #23457#26680#26102#38388
|
||||
DataBinding.FieldName = 'ChkTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
end
|
||||
object v1Column22: TcxGridDBColumn
|
||||
Caption = #23457#26680#22791#27880
|
||||
DataBinding.FieldName = 'ChkNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 73
|
||||
end
|
||||
object v1EditNote: TcxGridDBColumn
|
||||
Caption = #20462#25913#21407#22240
|
||||
DataBinding.FieldName = 'EditNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 503
|
||||
Width = 1229
|
||||
Height = 154
|
||||
Align = alClient
|
||||
TabOrder = 4
|
||||
object Tv2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Inactive = DataLink_WTOA.SHuangSe
|
||||
Styles.IncSearch = DataLink_WTOA.SHuangSe
|
||||
Styles.Selection = DataLink_WTOA.SHuangSe
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object cxGridDBColumn1: TcxGridDBColumn
|
||||
Caption = #23457#26680#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 85
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #23457#26680#26102#38388
|
||||
DataBinding.FieldName = 'ChkTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 114
|
||||
end
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #23457#26680#29366#24577
|
||||
DataBinding.FieldName = 'ChkStatus'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 82
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #23457#26680#22791#27880
|
||||
DataBinding.FieldName = 'ChkNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 104
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 552
|
||||
Top = 192
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 877
|
||||
Top = 9
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 512
|
||||
Top = 192
|
||||
object N1: TMenuItem
|
||||
Caption = #20840#36873
|
||||
OnClick = N1Click
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = #20840#24323
|
||||
OnClick = N2Click
|
||||
end
|
||||
end
|
||||
object order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 403
|
||||
Top = 475
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = order_Sub
|
||||
Left = 456
|
||||
Top = 476
|
||||
end
|
||||
end
|
||||
786
云翔OA(WTOA.dll)/U_KDChkList.pas
Normal file
786
云翔OA(WTOA.dll)/U_KDChkList.pas
Normal file
|
|
@ -0,0 +1,786 @@
|
|||
unit U_KDChkList;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmKDChkList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
Panel1: TPanel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
ToolButton6: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
v1Column24: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column25: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
v1Column26: TcxGridDBColumn;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Column23: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
v1Column21: TcxGridDBColumn;
|
||||
v1Column22: TcxGridDBColumn;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
lbl1: TLabel;
|
||||
lbl2: TLabel;
|
||||
lbl3: TLabel;
|
||||
lbl4: TLabel;
|
||||
lbl5: TLabel;
|
||||
KDNO: TEdit;
|
||||
Country: TEdit;
|
||||
KHName: TEdit;
|
||||
KDType: TEdit;
|
||||
FKType: TEdit;
|
||||
Label2: TLabel;
|
||||
EditNote: TMemo;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
order_Sub: TClientDataSet;
|
||||
DataSource2: TDataSource;
|
||||
v1EditNote: TcxGridDBColumn;
|
||||
v1QSDate: TcxGridDBColumn;
|
||||
Label10: TLabel;
|
||||
JYPerson: TEdit;
|
||||
Label3: TLabel;
|
||||
KDComName: TEdit;
|
||||
v1ConNo: TcxGridDBColumn;
|
||||
Label12: TLabel;
|
||||
ConNO: TEdit;
|
||||
v1FKName: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxPageControl1Change(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure WorkerChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure edtKDNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure ToolButton6Click(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
function DelData():Boolean;
|
||||
procedure InitGridWsql(fsj:string);
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmKDChkList: TfrmKDChkList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmKDChkList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmKDChkList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('快递信息审核2',Tv1,'寄件管理');
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
SQL.Add(' from KuaiDi_Money A ');
|
||||
sql.Add(' inner join OA_Chk OA on A.KDID=OA.MainId and isnull(OA.OAType,'''')=''寄件'' ');
|
||||
sql.Add(' where 1=1 and OA.Chker='''+Trim(DName)+'''');
|
||||
if cxTabControl1.TabIndex<>0 then
|
||||
begin
|
||||
sql.Add(' and A.KDDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and A.KDDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')<>''审核不通过'' and isnull(A.Status,'''')<>'''' and isnull(A.Status,'''')<>''审核通过'' ');
|
||||
sql.add(' and isnull(OA.ChkStatus,'''')<>''审核通过''');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add(' and isnull(OA.ChkStatus,'''')=''审核通过'' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
sql.Add(' and isnull(OA.ChkStatus,'''')=''审核不通过'' ');
|
||||
end;
|
||||
sql.add('Order by A.Status');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.InitForm();
|
||||
begin
|
||||
FNowDate:=SGetServerDate(ADOQueryTemp);
|
||||
EndDate.Date:=SGetServerDateMEnd(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDateMBeg(ADOQueryTemp);
|
||||
ReadCxGrid('快递信息审核2',Tv1,'寄件管理');
|
||||
//InitGrid();
|
||||
end;
|
||||
|
||||
function TfrmKDChkList.DelData():Boolean;
|
||||
begin
|
||||
try
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KuaiDi_Money where KDId='''+Trim(Order_Main.fieldbyname('KDId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('数据删除异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('寄件信息',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
InitGrid();
|
||||
//SInitComBoxByTvColumns(ComboBox2,Tv1,999,True,True);
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.cxPageControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmModuleNote:=TfrmModuleNote.Create(Application);
|
||||
with frmModuleNote do
|
||||
begin
|
||||
flag:='寄件信息审核';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmModuleNote.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.InitGridWsql(fsj:string);
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
SQL.Add(' from KuaiDi_Money A');
|
||||
sql.Add(' where isnull(HZType,'''')='''' ');
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
sql.Add('and (Filler in(select UserName from SY_User where DPID in');
|
||||
sql.Add(' (select DPID from SY_User where UserName='''+Trim(DName)+'''))');
|
||||
SQL.Add(' )');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')<>'''' and isnull(A.MoneyPerson,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.MoneyPerson,'''')<>'''' ');
|
||||
end;
|
||||
sql.Add(fsj);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.WorkerChange(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 TfrmKDChkList.ToolButton1Click(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 TfrmKDChkList.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.edtKDNOKeyPress(Sender: TObject; var Key: Char);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
{if Key<>#13 then Exit;
|
||||
if Length(Trim(KDNo.Text))<3 then Exit;
|
||||
fsj:=' and A.KDNo like '''+'%'+Trim(KDNo.Text)+'%'+'''';
|
||||
InitGridWsql(fsj); }
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if cxTabControl1.TabIndex<>0 then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要执行此操作吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
while Locate('SSel',True,[])=True do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate OA_Chk Set ChkStatus=''审核通过'',ChkTIme=getdate() ');
|
||||
sql.Add(',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+'''');
|
||||
sql.Add(' where MainId='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''寄件'' and isnull(Chker,'''')='''+Trim(DName)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk ');
|
||||
sql.Add(' where MainId='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''寄件'' and isnull(ChkStatus,'''')<>''审核通过'' ');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate KuaiDi_Money Set ChkStatus=''审核中'''); //,ChkTIme=getdate(),Chker='''+Trim(DName)+'''
|
||||
sql.Add(',Status=''审核中'',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+'''');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate KuaiDi_Money Set ChkStatus=''审核通过'',ChkTIme=getdate(),Chker='''+Trim(DName)+'''');
|
||||
sql.Add(',Status=''审核通过'',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+'''');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Order_Main.EnableControls;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('操作失败!','提示',0);
|
||||
end;
|
||||
{if Order_Main.IsEmpty then Exit;
|
||||
if cxTabControl1.TabIndex<>0 then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要执行此操作吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while Locate('SSel',True,[])=True do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate KuaiDi_Money Set Status=''审核通过'',ChkTime=getdate(),Chker='''+Trim(DName)+'''');
|
||||
sql.Add(',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+''',ChkStatus=''审核通过'' ');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('操作异常!','提示',0);
|
||||
end; }
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.ToolButton5Click(Sender: TObject);
|
||||
var
|
||||
FCKID,FChkStatus,FChker,FChkTime,FChkNote:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if cxTabControl1.TabIndex=0 then Exit;
|
||||
if cxTabControl1.TabIndex=3 then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要执行此操作吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
while Locate('SSel',True,[])=True do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate OA_Chk Set ChkStatus=Null,ChkTIme=Null ');
|
||||
sql.Add(',ChkNote=Null');
|
||||
sql.Add(' where MainId='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''寄件'' and isnull(Chker,'''')='''+Trim(DName)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select Top 1 * from OA_Chk');
|
||||
sql.Add(' where MainId='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' and isnull(ChkStatus,'''')<>'''' ');
|
||||
sql.Add(' order by ChkTime desc');
|
||||
Open;
|
||||
end;
|
||||
FCKID:=Trim(ADOQueryTemp.fieldbyname('CKID').AsString);
|
||||
FChkStatus:=Trim(ADOQueryTemp.fieldbyname('ChkStatus').AsString);
|
||||
FChker:=Trim(ADOQueryTemp.fieldbyname('Chker').AsString);
|
||||
FChkNote:=Trim(ADOQueryTemp.fieldbyname('ChkNote').AsString);
|
||||
FChkTime:=Trim(ADOQueryTemp.fieldbyname('ChkTime').AsString);
|
||||
if Trim(FCKID)='' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' UPdate KuaiDi_Money Set ChkStatus=Null,ChkTIme=Null,Chker=Null,Status=''已送审'' ');
|
||||
sql.Add(',ChkNote=Null ');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' UPdate KuaiDi_Money Set ');
|
||||
sql.Add(' Chker='''+Trim(FChker)+'''');
|
||||
sql.Add(',ChkTIme='''+Trim(FChkTIme)+'''');
|
||||
//sql.Add(',HZStatusTime='''+Trim(FChkTIme)+'''');
|
||||
sql.Add(',ChkNote='''+Trim(FChkNote)+'''');
|
||||
if Trim(FChkStatus)='审核通过' then
|
||||
begin
|
||||
sql.Add(',ChkStatus=''审核中'' ' );
|
||||
sql.Add(',Status=''审核中'' ' );
|
||||
end else
|
||||
begin
|
||||
sql.Add(',ChkStatus=''审核不通过'' ' );
|
||||
sql.Add(',Status=''审核不通过'' ' );
|
||||
end;
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Order_Main.EnableControls;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('操作失败!','提示',0);
|
||||
end;
|
||||
|
||||
{if Order_Main.IsEmpty then Exit;
|
||||
if cxTabControl1.TabIndex=0 then Exit;
|
||||
if cxTabControl1.TabIndex>2 then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要执行此操作吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while Locate('SSel',True,[])=True do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate KuaiDi_Money Set Status=''已送审'',ChkTime=Null,Chker=Null,ChkStatus=Null,ChkNote=Null');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('操作异常!','提示',0);
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.ToolButton6Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if cxTabControl1.TabIndex<>0 then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Main.Locate('SSel;ChkNote',VarArrayOf([True,Null]),[loPartialKey])=True then
|
||||
begin
|
||||
Application.MessageBox('审核备注不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Main.Locate('SSel;ChkNote',VarArrayOf([True,'']),[loPartialKey])=True then
|
||||
begin
|
||||
Application.MessageBox('审核备注不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要执行此操作吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
while Locate('SSel',True,[])=True do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate OA_Chk Set ChkStatus=''审核不通过'',ChkTIme=getdate()');
|
||||
sql.Add(',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+'''');
|
||||
sql.Add(' where MainId='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''寄件'' and isnull(Chker,'''')='''+Trim(DName)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate KuaiDi_Money Set ChkStatus=''审核不通过'',ChkTIme=getdate(),Chker='''+Trim(DName)+'''');
|
||||
sql.Add(',Status=''审核不通过'',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+'''');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' delete OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
sql.Add(' and isnull(OAType,'''')=''寄件'' ');
|
||||
ExecSQL;
|
||||
end;
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Order_Main.EnableControls;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('操作失败!','提示',0);
|
||||
end;
|
||||
{ if Order_Main.IsEmpty then Exit;
|
||||
if cxTabControl1.TabIndex<>0 then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Main.Locate('SSel;ChkNote',VarArrayOf([True,null]),[loPartialKey])=True then
|
||||
begin
|
||||
Application.MessageBox('审核备注不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Application.MessageBox('确定要执行此操作吗?','提示',32+4)<>IDYES then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while Locate('SSel',True,[])=True do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate KuaiDi_Money Set Status=''审核不通过'',ChkTime=getdate(),Chker='''+Trim(DName)+'''');
|
||||
sql.Add(',ChkNote='''+Trim(Order_Main.fieldbyname('ChkNote').AsString)+''',ChkStatus=''审核不通过'' ');
|
||||
sql.Add(' where KDID='''+Trim(Order_Main.fieldbyname('KDID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
Order_Main.Delete;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('操作异常!','提示',0);
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmKDChkList.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from OA_Chk ');
|
||||
sql.Add(' where MainId='''+Trim(Order_Main.fieldbyname('KDId').AsString)+'''');
|
||||
sql.Add(' and OAType=''寄件'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryTemp,Order_Sub);
|
||||
SInitCDSData20(ADOQueryTemp,Order_Sub);
|
||||
EditNote.Text:=trim(Order_Main.fieldbyname('EditNote').AsString);
|
||||
end;
|
||||
|
||||
end.
|
||||
732
云翔OA(WTOA.dll)/U_KDDeptList.dfm
Normal file
732
云翔OA(WTOA.dll)/U_KDDeptList.dfm
Normal file
|
|
@ -0,0 +1,732 @@
|
|||
object frmKDDeptList: TfrmKDDeptList
|
||||
Left = 186
|
||||
Top = 135
|
||||
Width = 1222
|
||||
Height = 601
|
||||
Caption = #23492#20214#20449#24687#37096#38376#26597#30475
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1206
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25805#20316#35828#26126
|
||||
ImageIndex = 41
|
||||
Visible = False
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1206
|
||||
Height = 74
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 33
|
||||
Top = 20
|
||||
Width = 14
|
||||
Height = 13
|
||||
Caption = #25353
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 159
|
||||
Top = 20
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #26597#35810
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 314
|
||||
Top = 20
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #38754#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl2: TLabel
|
||||
Left = 300
|
||||
Top = 45
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #25910#20214#22320#21306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 470
|
||||
Top = 20
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #25910#20214#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl4: TLabel
|
||||
Left = 618
|
||||
Top = 20
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl5: TLabel
|
||||
Left = 470
|
||||
Top = 45
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20184#27454#26041#24335
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 614
|
||||
Top = 45
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #23492#20214#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 739
|
||||
Top = 20
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #24555#36882#20844#21496
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label4: TLabel
|
||||
Left = 739
|
||||
Top = 45
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #21512#21516#32534#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 190
|
||||
Top = 16
|
||||
Width = 92
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 189
|
||||
Top = 41
|
||||
Width = 93
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object ComboBox2: TComboBox
|
||||
Left = 49
|
||||
Top = 16
|
||||
Width = 109
|
||||
Height = 21
|
||||
Style = csDropDownList
|
||||
ItemHeight = 13
|
||||
TabOrder = 2
|
||||
end
|
||||
object KDNO: TEdit
|
||||
Tag = 2
|
||||
Left = 357
|
||||
Top = 16
|
||||
Width = 89
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object Country: TEdit
|
||||
Tag = 2
|
||||
Left = 357
|
||||
Top = 41
|
||||
Width = 89
|
||||
Height = 21
|
||||
TabOrder = 4
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KHName: TEdit
|
||||
Tag = 2
|
||||
Left = 525
|
||||
Top = 16
|
||||
Width = 77
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KDType: TEdit
|
||||
Tag = 2
|
||||
Left = 655
|
||||
Top = 16
|
||||
Width = 65
|
||||
Height = 21
|
||||
TabOrder = 6
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object FKType: TEdit
|
||||
Tag = 2
|
||||
Left = 525
|
||||
Top = 41
|
||||
Width = 77
|
||||
Height = 21
|
||||
TabOrder = 7
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object JYPerson: TEdit
|
||||
Tag = 2
|
||||
Left = 655
|
||||
Top = 41
|
||||
Width = 66
|
||||
Height = 21
|
||||
TabOrder = 8
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KDComName: TEdit
|
||||
Tag = 2
|
||||
Left = 794
|
||||
Top = 16
|
||||
Width = 84
|
||||
Height = 21
|
||||
TabOrder = 9
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object ConNO: TEdit
|
||||
Tag = 2
|
||||
Left = 794
|
||||
Top = 41
|
||||
Width = 84
|
||||
Height = 21
|
||||
TabOrder = 10
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 106
|
||||
Width = 1206
|
||||
Height = 22
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24050#36865#23457
|
||||
#23457#26680#36890#36807
|
||||
#23457#26680#19981#36890#36807
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1206
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 128
|
||||
Width = 1206
|
||||
Height = 433
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column3
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column15
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #23492#20214#26085#26399
|
||||
DataBinding.FieldName = 'KDDate'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24555#36882#20844#21496
|
||||
DataBinding.FieldName = 'KDComName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #24555#36882#21333#21495
|
||||
DataBinding.FieldName = 'KDNO'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 95
|
||||
end
|
||||
object v1KHName: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154
|
||||
DataBinding.FieldName = 'KHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #23492#20214#20154
|
||||
DataBinding.FieldName = 'JYPerson'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderAlignmentVert = vaCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 93
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #19994#21153#21161#29702
|
||||
DataBinding.FieldName = 'YWZhuLi'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 75
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#21306
|
||||
DataBinding.FieldName = 'Country'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 108
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #23492#20214#36135#29289#35814#24773
|
||||
DataBinding.FieldName = 'KDInfo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 132
|
||||
end
|
||||
object v1Column25: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #24555#36882#36153#29992
|
||||
DataBinding.FieldName = 'KDMoneyS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 80
|
||||
end
|
||||
object v1Column26: TcxGridDBColumn
|
||||
Caption = #36153#29992#25910#21462#26041#24335
|
||||
DataBinding.FieldName = 'FeeShouQuType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 94
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Caption = #23492#20214#31867#22411
|
||||
DataBinding.FieldName = 'KDType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
end
|
||||
object v1Column23: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #37325#37327'(KG)'
|
||||
DataBinding.FieldName = 'KgQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_WTOA.FoneRed
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 75
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #36865#23457#26102#38388
|
||||
DataBinding.FieldName = 'SSTime'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 71
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #36865#23457#20154
|
||||
DataBinding.FieldName = 'SSPerson'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #30331#35760#20154
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 69
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26102#38388
|
||||
DataBinding.FieldName = 'FillTime'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #23457#26680#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 61
|
||||
end
|
||||
object v1Column21: TcxGridDBColumn
|
||||
Caption = #23457#26680#26102#38388
|
||||
DataBinding.FieldName = 'ChkTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
end
|
||||
object v1Column22: TcxGridDBColumn
|
||||
Caption = #23457#26680#22791#27880
|
||||
DataBinding.FieldName = 'ChkNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1FKName: TcxGridDBColumn
|
||||
Caption = #20184#27454#20154
|
||||
DataBinding.FieldName = 'FKName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'Status'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1QSDate: TcxGridDBColumn
|
||||
Caption = #31614#25910#26085#26399
|
||||
DataBinding.FieldName = 'QSDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1ConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 552
|
||||
Top = 192
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.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 = 1063
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1093
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
end
|
||||
419
云翔OA(WTOA.dll)/U_KDDeptList.pas
Normal file
419
云翔OA(WTOA.dll)/U_KDDeptList.pas
Normal file
|
|
@ -0,0 +1,419 @@
|
|||
unit U_KDDeptList;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmKDDeptList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
Panel1: TPanel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
ComboBox2: TComboBox;
|
||||
Label3: TLabel;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column25: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
v1Column26: TcxGridDBColumn;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Column23: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
v1Column21: TcxGridDBColumn;
|
||||
v1Column22: TcxGridDBColumn;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
lbl1: TLabel;
|
||||
lbl2: TLabel;
|
||||
lbl3: TLabel;
|
||||
lbl4: TLabel;
|
||||
lbl5: TLabel;
|
||||
KDNO: TEdit;
|
||||
Country: TEdit;
|
||||
KHName: TEdit;
|
||||
KDType: TEdit;
|
||||
FKType: TEdit;
|
||||
v1KHName: TcxGridDBColumn;
|
||||
v1QSDate: TcxGridDBColumn;
|
||||
Label10: TLabel;
|
||||
JYPerson: TEdit;
|
||||
Label2: TLabel;
|
||||
KDComName: TEdit;
|
||||
v1ConNo: TcxGridDBColumn;
|
||||
Label4: TLabel;
|
||||
ConNO: TEdit;
|
||||
v1FKName: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxPageControl1Change(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure WorkerChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure edtKDNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
function DelData():Boolean;
|
||||
procedure InitGridWsql(fsj:string);
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmKDDeptList: TfrmKDDeptList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmKDDeptList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmKDDeptList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('快递信息部门查看',Tv1,'寄件管理');
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.InitGrid();
|
||||
var
|
||||
fsj,fsjHZ:String;
|
||||
begin
|
||||
fsjHZ:='';
|
||||
if cxTabControl1.TabIndex<>0 then
|
||||
begin
|
||||
fsj:=TA(ComboBox2.Items.Objects[ComboBox2.Items.IndexOf(Trim(ComboBox2.Text))]).S;
|
||||
fsjHZ:=fsjHZ+' and A.'+Trim(fsj)+'>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''';
|
||||
fsjHZ:=fsjHZ+' and A.'+Trim(fsj)+'<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''';
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
fsjHZ:=fsjHZ+' and (isnull(A.Status,'''')=''已送审'' or isnull(A.Status,'''')=''审核中'') ';
|
||||
end else
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
fsjHZ:=fsjHZ+' and isnull(A.Status,'''')=''审核通过'' ';
|
||||
end else
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
fsjHZ:=fsjHZ+' and isnull(A.Status,'''')=''审核不通过'' ';
|
||||
end;
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' exec P_View_KDDeptView :canshu1,:WSql,:DCode ');
|
||||
Parameters.ParamByName('canshu1').Value:='';
|
||||
Parameters.ParamByName('WSql').Value:=fsjHZ;
|
||||
Parameters.ParamByName('DCode').Value:=Trim(DCode);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.InitForm();
|
||||
begin
|
||||
FNowDate:=SGetServerDate(ADOQueryTemp);
|
||||
EndDate.Date:=SGetServerDateMEnd(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDateMBeg(ADOQueryTemp);
|
||||
ReadCxGrid('快递信息部门查看',Tv1,'寄件管理');
|
||||
//InitGrid();
|
||||
end;
|
||||
|
||||
function TfrmKDDeptList.DelData():Boolean;
|
||||
begin
|
||||
try
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
while Locate('SSel',True,[]) do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KuaiDi_Money where KDId='''+Trim(Order_Main.fieldbyname('KDId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
|
||||
Delete;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('数据删除异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('寄件信息',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
SInitComBoxByTvColumns(ComboBox2,Tv1,999,True,True);
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.cxPageControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmModuleNote:=TfrmModuleNote.Create(Application);
|
||||
with frmModuleNote do
|
||||
begin
|
||||
flag:='寄件信息登记';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmModuleNote.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.InitGridWsql(fsj:string);
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
SQL.Add(' from KuaiDi_Money A');
|
||||
sql.Add(' where isnull(HZType,'''')='''' ');
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
sql.Add('and (Filler in(select UserName from SY_User where DPID in');
|
||||
sql.Add(' (select DPID from SY_User where UserName='''+Trim(DName)+'''))');
|
||||
SQL.Add(' )');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')<>'''' and isnull(A.MoneyPerson,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.MoneyPerson,'''')<>'''' ');
|
||||
end;
|
||||
sql.Add(fsj);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.WorkerChange(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 TfrmKDDeptList.ToolButton1Click(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 TfrmKDDeptList.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.edtKDNOKeyPress(Sender: TObject; var Key: Char);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
if Key<>#13 then Exit;
|
||||
if Length(Trim(KDNo.Text))<3 then Exit;
|
||||
fsj:=' and A.KDNo like '''+'%'+Trim(KDNo.Text)+'%'+'''';
|
||||
InitGridWsql(fsj);
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmKDDeptList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
end.
|
||||
573
云翔OA(WTOA.dll)/U_KDInPut.dfm
Normal file
573
云翔OA(WTOA.dll)/U_KDInPut.dfm
Normal file
|
|
@ -0,0 +1,573 @@
|
|||
object frmKDInPut: TfrmKDInPut
|
||||
Left = 189
|
||||
Top = 133
|
||||
Width = 1381
|
||||
Height = 695
|
||||
Caption = #23492#20214#20449#24687#24405#20837
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1365
|
||||
Height = 29
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 5
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 1365
|
||||
Height = 330
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
OnCellClick = Tv1CellClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column3
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column2
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1HKMoney
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Caption = #23492#20214#26085#26399
|
||||
DataBinding.FieldName = 'KDDate'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 76
|
||||
end
|
||||
object v1ConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1ConNoPropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 70
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #24555#36882#21333#21495
|
||||
DataBinding.FieldName = 'KDNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taRightJustify
|
||||
Width = 99
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24555#36882#20844#21496
|
||||
DataBinding.FieldName = 'KDComName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = True
|
||||
Properties.OnButtonClick = v1Column1PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Width = 79
|
||||
end
|
||||
object v1Column11: TcxGridDBColumn
|
||||
Caption = #23492#20214#20154
|
||||
DataBinding.FieldName = 'JYPerson'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 78
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #19994#21153#21161#29702
|
||||
DataBinding.FieldName = 'YWZhuLi'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.CharCase = ecUpperCase
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 82
|
||||
end
|
||||
object v1KHName: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154
|
||||
DataBinding.FieldName = 'KHName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1Column18PropertiesButtonClick
|
||||
Properties.OnEditValueChanged = v1KHNamePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 94
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#22336
|
||||
DataBinding.FieldName = 'ToPlace'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.OnButtonClick = v1Column6PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 75
|
||||
end
|
||||
object v1FKName: TcxGridDBColumn
|
||||
Caption = #20184#27454#20154
|
||||
DataBinding.FieldName = 'FKName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 76
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154#32852#31995#26041#24335
|
||||
DataBinding.FieldName = 'KHLXFS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 97
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#21306
|
||||
DataBinding.FieldName = 'Country'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = True
|
||||
Properties.OnButtonClick = v1Column9PropertiesButtonClick
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #23492#20214#36135#29289#35814#24773
|
||||
DataBinding.FieldName = 'KDInfo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 87
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 58
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #24555#36882#36153#29992
|
||||
DataBinding.FieldName = 'KDMoneyS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object v1FeeShouQuType: TcxGridDBColumn
|
||||
Caption = #36153#29992#25910#21462#26041#24335
|
||||
DataBinding.FieldName = 'FeeShouQuType'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
#20844#36153
|
||||
#33258#36153
|
||||
#29616#37329)
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 94
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Caption = #23492#20214#31867#22411
|
||||
DataBinding.FieldName = 'KDType'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
#21253#35065
|
||||
#24555#36882#34955
|
||||
#25991#20214)
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
#23492#20184
|
||||
#21040#20184
|
||||
#20195#20184)
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #37325#37327'(KG)'
|
||||
DataBinding.FieldName = 'KgQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 78
|
||||
end
|
||||
object v1IFDS: TcxGridDBColumn
|
||||
Caption = #26159#21542#20195#25910#36135#27454
|
||||
DataBinding.FieldName = 'IFDS'
|
||||
PropertiesClassName = 'TcxComboBoxProperties'
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.Items.Strings = (
|
||||
#26159
|
||||
'')
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 84
|
||||
end
|
||||
object v1HKMoney: TcxGridDBColumn
|
||||
Caption = #36135#27454#37329#39069
|
||||
DataBinding.FieldName = 'HKMoney'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object v1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 147
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object ToolBar2: TToolBar
|
||||
Left = 0
|
||||
Top = 359
|
||||
Width = 1365
|
||||
Height = 29
|
||||
Align = alBottom
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.ThreeImgList
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 2
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 15
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TYPADD: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26679#21697#22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = TYPADDClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 150
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #33457#22411#22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToADD: TToolButton
|
||||
Left = 237
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25163#21160#22686#34892
|
||||
ImageIndex = 12
|
||||
OnClick = ToADDClick
|
||||
end
|
||||
object ToolButton5: TToolButton
|
||||
Left = 324
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 13
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 388
|
||||
Width = 1365
|
||||
Height = 267
|
||||
Align = alBottom
|
||||
TabOrder = 3
|
||||
object Tv2: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
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>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object cxGridDBColumn3: TcxGridDBColumn
|
||||
Caption = #20135#21697#32534#21495
|
||||
DataBinding.FieldName = 'CYNO'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = cxGridDBColumn3PropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Width = 115
|
||||
end
|
||||
object v2Column2: TcxGridDBColumn
|
||||
Caption = #20135#21697#21517#31216
|
||||
DataBinding.FieldName = 'CYName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 92
|
||||
end
|
||||
object cxGridDBColumn4: TcxGridDBColumn
|
||||
Caption = #25104#20998
|
||||
DataBinding.FieldName = 'CYCF'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 104
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'CYMF'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 99
|
||||
end
|
||||
object cxGridDBColumn6: TcxGridDBColumn
|
||||
Caption = #20811#37325
|
||||
DataBinding.FieldName = 'CYKZ'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Width = 99
|
||||
end
|
||||
object cxGridDBColumn9: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object cxGridDBColumn10: TcxGridDBColumn
|
||||
Caption = #25968#37327#21333#20301
|
||||
DataBinding.FieldName = 'QtyUnit'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object cxGridDBColumn17: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 104
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object ADOTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 344
|
||||
Top = 77
|
||||
end
|
||||
object ADOCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 373
|
||||
Top = 75
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Sub
|
||||
Left = 471
|
||||
Top = 80
|
||||
end
|
||||
object Order_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 398
|
||||
Top = 76
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 434
|
||||
Top = 78
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = ClientDataSet2
|
||||
Left = 630
|
||||
Top = 422
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 665
|
||||
Top = 424
|
||||
end
|
||||
object ClientDataSet2: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 701
|
||||
Top = 425
|
||||
end
|
||||
end
|
||||
835
云翔OA(WTOA.dll)/U_KDInPut.pas
Normal file
835
云翔OA(WTOA.dll)/U_KDInPut.pas
Normal file
|
|
@ -0,0 +1,835 @@
|
|||
unit U_KDInPut;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
||||
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
||||
ExtCtrls, BtnEdit, cxDropDownEdit, cxCalendar, cxGridCustomPopupMenu,
|
||||
cxGridPopupMenu, cxSplitter;
|
||||
|
||||
type
|
||||
TfrmKDInPut = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOTemp: TADOQuery;
|
||||
ADOCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
Order_Sub: TClientDataSet;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1KHName: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Note: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column11: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1FeeShouQuType: TcxGridDBColumn;
|
||||
ToolBar2: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
cxGridDBColumn6: TcxGridDBColumn;
|
||||
cxGridDBColumn9: TcxGridDBColumn;
|
||||
cxGridDBColumn10: TcxGridDBColumn;
|
||||
cxGridDBColumn17: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource2: TDataSource;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
ClientDataSet2: TClientDataSet;
|
||||
v2Column2: TcxGridDBColumn;
|
||||
v1ConNo: TcxGridDBColumn;
|
||||
v1IFDS: TcxGridDBColumn;
|
||||
v1HKMoney: TcxGridDBColumn;
|
||||
TYPADD: TToolButton;
|
||||
ToADD: TToolButton;
|
||||
v1FKName: TcxGridDBColumn;
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure v1Column6PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1Column1PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column9PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column16PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure cxGridDBColumn3PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure v1Column6PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1Column18PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure v1KHNamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure v1ConNoPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
procedure TYPADDClick(Sender: TObject);
|
||||
procedure ToADDClick(Sender: TObject);
|
||||
private
|
||||
FXS:Integer;
|
||||
procedure InitData();
|
||||
procedure ZDYHelp(FButn:TcxButtonEdit;LType:string);
|
||||
function SaveData():Boolean;
|
||||
function SaveDataMX():Boolean;
|
||||
procedure GetMaxConNO();
|
||||
{ Private declarations }
|
||||
public
|
||||
PState,PCopyInt:Integer;
|
||||
FMainId,FConNo,FConType,FYLType,canshu1:String;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmKDInPut: TfrmKDInPut;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel , U_ZHKHListNewCX,U_CPManage_Sel,U_ZdyAttachCP_HX,U_ContractList_CX;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmKDInPut.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('寄件信息录入11',Tv1,'寄件管理');
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.InitData();
|
||||
begin
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select A.*');
|
||||
SQL.Add(' from KuaiDi_Money A');
|
||||
sql.Add(' where A.KDID='''+Trim(FMainId)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOTemp,Order_Sub);
|
||||
SInitCDSData20(ADOTemp,Order_Sub);
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KuaiDi_Money_Sub ');
|
||||
sql.Add('where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOTemp,ClientDataSet2);
|
||||
SInitCDSData20(ADOTemp,ClientDataSet2);
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ZDYHelp(FButn:TcxButtonEdit;LType:string);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid('寄件信息录入11',Tv1,'寄件管理');
|
||||
v1Column20.Visible:=false;
|
||||
InitData();
|
||||
end;
|
||||
procedure TfrmKDInPut.GetMaxConNO();
|
||||
begin
|
||||
|
||||
end;
|
||||
function TfrmKDInPut.SaveData():Boolean;
|
||||
var
|
||||
maxno:String;
|
||||
begin
|
||||
try
|
||||
Result:=False;
|
||||
ADOCmd.Connection.BeginTrans;
|
||||
//保存主表
|
||||
Order_Sub.DisableControls;
|
||||
with Order_Sub do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if Trim(Order_Sub.fieldbyname('KDID').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOCmd,maxno,'KD','KuaiDi_Money',4,1)=False then
|
||||
begin
|
||||
Order_Sub.EnableControls;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取规则流水号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(Order_Sub.fieldbyname('KDID').AsString);
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from KuaiDi_Money where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
if Trim(Order_Sub.fieldbyname('KDID').AsString)='' then
|
||||
begin
|
||||
Append;
|
||||
end
|
||||
else begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('KDID').Value:=Trim(maxno);
|
||||
fieldbyname('fillCode').Value:=trim(DCode);
|
||||
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'KuaiDi_Money',0) ;
|
||||
FieldByName('KHID').Value:=Trim(Order_Sub.fieldbyname('KHID').AsString);
|
||||
FieldByName('ConMainid').Value:=Trim(Order_Sub.fieldbyname('ConMainid').AsString);
|
||||
if Trim(FMainId)='' then
|
||||
begin
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
end else
|
||||
begin
|
||||
FieldByName('Editer').Value:=Trim(DName);
|
||||
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
||||
end;
|
||||
Post;
|
||||
end;
|
||||
Edit;
|
||||
FieldByName('KDID').Value:=Trim(maxno);
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Sub.EnableControls;
|
||||
ADOCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except;
|
||||
Result:=False;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmKDInPut.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
ToolBar1.SetFocus;
|
||||
|
||||
if Order_Sub.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('明细不能为空!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
if Order_Sub.Locate('KDDate',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('寄件日期不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('KDComName',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('快递公司不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('KDNO',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('快递单号不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('KHName',Null,[]) then
|
||||
begin
|
||||
Application.MessageBox('收件人不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('JYPerson',Null,[]) then
|
||||
begin
|
||||
Application.MessageBox('寄件人不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('ToPlace',Null,[]) then
|
||||
begin
|
||||
Application.MessageBox('收件地址不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('Country',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('收件地区不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
{if Order_Sub.Locate('KDType',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('寄件类型不能为空!','提示',0);
|
||||
Exit;
|
||||
end;}
|
||||
if Order_Sub.Locate('FKType',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('付款方式不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Order_Sub.Locate('FeeShouQuType',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('费用收取方式不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if SaveData() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
//ModalResult:=1;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ToolButton3Click(Sender: TObject);
|
||||
var
|
||||
FSQDate:string;
|
||||
begin
|
||||
FSQDate:=Trim(FormatDateTime('yyyy-MM-dd',SGetServerDate(ADOTemp)));
|
||||
if Order_Sub.IsEmpty then
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('KDDate').Value:=FSQDate;
|
||||
FieldByName('YWZhuLi').Value:=Trim(DName);
|
||||
fieldbyname('KDType').Value:='包裹';
|
||||
Fieldbyname('Qty').AsFloat:=1;
|
||||
Post;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CopyAddRow(Tv1,Order_Sub);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ToolButton4Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Sub.IsEmpty then Exit;
|
||||
if Trim(Order_Sub.fieldbyname('KDId').AsString)<>'' then
|
||||
begin
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KuaiDi_Money where KDId='''+Trim(Order_Sub.fieldbyname('KDId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
Order_Sub.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1Column6PropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('MDID').Value:=Trim(mvalue);
|
||||
Post;
|
||||
end;
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select B.OrderNo,A.PS,A.MDDate from JYOrder_Main_MD A');
|
||||
sql.Add(' inner join JYorder_Main B on A.ORDMainId=B.MainId');
|
||||
sql.Add(' and A.MDID='''+Trim(mvalue)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('条码录入错误!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('OrderNo').Value:=ADOTemp.fieldbyname('OrderNo').Value;
|
||||
FieldByName('PS').Value:=ADOTemp.fieldbyname('PS').Value;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1Column1PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='KDComName';
|
||||
flagname:='快递公司';
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
frmZDYHelp.TBAdd.Visible:=False;
|
||||
frmZDYHelp.TBDel.Visible:=False;
|
||||
frmZDYHelp.TBEdit.Visible:=False;
|
||||
end;
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('KDComName').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1Column9PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='Country';
|
||||
flagname:='收件地区';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Country').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1Column16PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='KDHeZuo';
|
||||
flagname:='快递合作方';
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
frmZDYHelp.TBAdd.Visible:=False;
|
||||
frmZDYHelp.TBDel.Visible:=False;
|
||||
frmZDYHelp.TBEdit.Visible:=False;
|
||||
end;
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('KDHeZuo').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.cxGridDBColumn3PropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var
|
||||
mvalue:String;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('select * from CP_YDang where CYNO='''+Trim(mvalue)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('CYNO').Value:=Trim(mvalue);
|
||||
FieldByName('CYName').Value:=ADOTemp.fieldbyname('CYName').Value;
|
||||
FieldByName('CYCF').Value:=ADOTemp.fieldbyname('CYECF').Value;
|
||||
FieldByName('CYMF').Value:=ADOTemp.fieldbyname('CYMF').Value;
|
||||
FieldByName('CYKZ').Value:=ADOTemp.fieldbyname('CYKZ').Value;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if Order_Sub.IsEmpty then Exit;
|
||||
if ClientDataSet2.IsEmpty then
|
||||
begin
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KuaiDi_Money_Sub ');
|
||||
sql.Add('where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOTemp,ClientDataSet2);
|
||||
SInitCDSData20(ADOTemp,ClientDataSet2);
|
||||
end else
|
||||
begin
|
||||
if Trim(Order_Sub.fieldbyname('KDID').AsString)<>Trim(ClientDataSet2.fieldbyname('KDID').AsString) then
|
||||
begin
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KuaiDi_Money_Sub ');
|
||||
sql.Add('where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOTemp,ClientDataSet2);
|
||||
SInitCDSData20(ADOTemp,ClientDataSet2);
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if Order_Sub.IsEmpty then Exit;
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KuaiDi_Money where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('上面数据未保存,不能增行!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
frmZdyAttachCP_HX:=TfrmZdyAttachCP_HX.Create(self);
|
||||
with frmZdyAttachCP_HX do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with CDS_Sub do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('CYNO').Value:=Trim(CDS_Sub.fieldbyname('ZdyCode').AsString);
|
||||
FieldByName('CYName').Value:=Trim(CDS_Sub.fieldbyname('ZdyName').AsString);
|
||||
FieldByName('KDID').Value:=Trim(Order_Sub.fieldbyname('KDID').AsString);
|
||||
Post;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ToolButton5Click(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet2.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KuaiDi_Money_Sub where KSID='''+Trim(ClientDataSet2.fieldbyname('KSID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
ClientDataSet2.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ToolBar2.SetFocus;
|
||||
if ClientDataSet2.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('寄件明细不能为空!','提示',0);
|
||||
exit;
|
||||
end;
|
||||
if ClientDataSet2.Locate('CYNO',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('产品编号不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if SaveDataMX() then
|
||||
begin
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
//ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
function TfrmKDInPut.SaveDataMX():Boolean;
|
||||
var
|
||||
maxno:String;
|
||||
begin
|
||||
try
|
||||
Result:=False;
|
||||
ADOCmd.Connection.BeginTrans;
|
||||
//保存主表
|
||||
ClientDataSet2.DisableControls;
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if Trim(ClientDataSet2.fieldbyname('KSID').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOCmd,maxno,'KS','KuaiDi_Money_Sub',4,1)=False then
|
||||
begin
|
||||
ClientDataSet2.EnableControls;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取规则流水号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet2.fieldbyname('KSID').AsString);
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from KuaiDi_Money_Sub where KSID='''+Trim(ClientDataSet2.fieldbyname('KSID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
with ADOCmd do
|
||||
begin
|
||||
if Trim(ClientDataSet2.fieldbyname('KSID').AsString)='' then
|
||||
begin
|
||||
Append;
|
||||
end
|
||||
else begin
|
||||
Edit;
|
||||
end;
|
||||
FieldByName('KDID').Value:=Trim(Order_Sub.fieldbyname('KDID').AsString);
|
||||
FieldByName('KSID').Value:=Trim(maxno);
|
||||
RTSetSaveDataCDS(ADOCmd,Tv2,ClientDataSet2,'KuaiDi_Money_Sub',0) ;
|
||||
FieldByName('CYID').Value:=Trim(ClientDataSet2.fieldbyname('CYID').AsString);
|
||||
if Trim(FMainId)='' then
|
||||
begin
|
||||
FieldByName('Filler').Value:=Trim(DName);
|
||||
end else
|
||||
begin
|
||||
FieldByName('Editer').Value:=Trim(DName);
|
||||
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
||||
end;
|
||||
Post;
|
||||
end;
|
||||
Edit;
|
||||
FieldByName('KSID').Value:=Trim(maxno);
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet2.EnableControls;
|
||||
ADOCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
Result:=False;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1Column6PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag:='ToPlace';
|
||||
flagname:='收件地址';
|
||||
{if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
frmZDYHelp.TBAdd.Visible:=False;
|
||||
frmZDYHelp.TBDel.Visible:=False;
|
||||
frmZDYHelp.TBEdit.Visible:=False;
|
||||
end; }
|
||||
Maintype:=trim(DName);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ToPlace').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1Column18PropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
try
|
||||
frmZHKHListNewCX:=TfrmZHKHListNewCX.Create(Application);
|
||||
with frmZHKHListNewCX do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Self.Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('KHName').Value:=Trim(frmZHKHListNewCX.Order_Main.fieldbyname('ZDYName').AsString);
|
||||
fieldbyname('ToPlace').Value:=trim(frmZHKHListNewCX.Order_Main.fieldbyname('DEFNote1').AsString);
|
||||
fieldbyname('KHLXFS').Value:=trim(frmZHKHListNewCX.Order_Main.fieldbyname('Defstr2').AsString);
|
||||
fieldbyname('Country').Value:=trim(frmZHKHListNewCX.Order_Main.fieldbyname('Defstr7').AsString);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally;
|
||||
frmZHKHListNewCX.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1KHNamePropertiesEditValueChanged(Sender: TObject);
|
||||
var mavlue:string;
|
||||
begin
|
||||
mavlue:=TcxTextEdit(Sender).EditingText;
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select Top 1 * from KuaiDi_Money ');
|
||||
sql.Add('where KHName='''+trim(Mavlue)+'''');
|
||||
SQL.Add(' Order by KDDate desc');
|
||||
open;
|
||||
end;
|
||||
with Order_Sub do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('KHName').Value:=Trim(mavlue);
|
||||
FieldByName('ToPlace').Value:=ADOTemp.fieldbyname('ToPlace').AsString;
|
||||
FieldByName('KHLXFS').Value:=ADOTemp.fieldbyname('KHLXFS').AsString;
|
||||
FieldByName('Country').Value:=ADOTemp.fieldbyname('Country').AsString;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.v1ConNoPropertiesButtonClick(Sender: TObject;
|
||||
AButtonIndex: Integer);
|
||||
begin
|
||||
frmContractList_CX:=TfrmContractList_CX.create(self);
|
||||
with frmContractList_CX do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with Order_Sub do
|
||||
begin
|
||||
edit;
|
||||
FieldByName('ConNo').Value:=Trim(Order_Main.fieldbyname('ConNO').AsString);
|
||||
FieldByName('ConMainid').Value:=Trim(Order_Main.fieldbyname('Mainid').AsString);
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.TYPADDClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Sub.IsEmpty then Exit;
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KuaiDi_Money where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('上面数据未保存,不能增行!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
frmCPManageSel:=TfrmCPManageSel.Create(self);
|
||||
with frmCPManageSel do
|
||||
begin
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('CYNO').Value:=Trim(ClientDataSet1.fieldbyname('CYNo').AsString);
|
||||
FieldByName('CYName').Value:=Trim(ClientDataSet1.fieldbyname('CYName').AsString);
|
||||
FieldByName('CYCF').Value:=Trim(ClientDataSet1.fieldbyname('CYCF').AsString);
|
||||
FieldByName('CYMF').Value:=Trim(ClientDataSet1.fieldbyname('CYMF').AsString);
|
||||
FieldByName('CYKZ').Value:=Trim(ClientDataSet1.fieldbyname('CYKZ').AsString);
|
||||
FieldByName('KDID').Value:=Trim(Order_Sub.fieldbyname('KDID').AsString);
|
||||
Post;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDInPut.ToADDClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Sub.IsEmpty then Exit;
|
||||
with ADOTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KuaiDi_Money where KDID='''+Trim(Order_Sub.fieldbyname('KDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOTemp.IsEmpty then
|
||||
begin
|
||||
Application.MessageBox('上面数据未保存,不能增行!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('KDID').Value:=Trim(Order_Sub.fieldbyname('KDID').AsString);
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
1227
云翔OA(WTOA.dll)/U_KDList.dfm
Normal file
1227
云翔OA(WTOA.dll)/U_KDList.dfm
Normal file
File diff suppressed because it is too large
Load Diff
1116
云翔OA(WTOA.dll)/U_KDList.pas
Normal file
1116
云翔OA(WTOA.dll)/U_KDList.pas
Normal file
File diff suppressed because it is too large
Load Diff
727
云翔OA(WTOA.dll)/U_KDPersonList.dfm
Normal file
727
云翔OA(WTOA.dll)/U_KDPersonList.dfm
Normal file
|
|
@ -0,0 +1,727 @@
|
|||
object frmKDPersonList: TfrmKDPersonList
|
||||
Left = 187
|
||||
Top = 119
|
||||
Width = 1230
|
||||
Height = 610
|
||||
Caption = #23492#20214#20449#24687#26597#30475
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 107
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1214
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 83
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Flat = True
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_WTOA.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 ToolButton1: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 20
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBExport: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 6
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25805#20316#35828#26126
|
||||
ImageIndex = 41
|
||||
Visible = False
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 276
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 4
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 339
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 21
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 32
|
||||
Width = 1214
|
||||
Height = 72
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 33
|
||||
Top = 18
|
||||
Width = 14
|
||||
Height = 13
|
||||
Caption = #25353
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 159
|
||||
Top = 18
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #26597#35810
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl1: TLabel
|
||||
Left = 301
|
||||
Top = 18
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #38754#21333#21495
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl2: TLabel
|
||||
Left = 301
|
||||
Top = 42
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #25910#20214#22320#21306
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl3: TLabel
|
||||
Left = 463
|
||||
Top = 18
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #25910#20214#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl4: TLabel
|
||||
Left = 612
|
||||
Top = 18
|
||||
Width = 28
|
||||
Height = 13
|
||||
Caption = #31867#22411
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object lbl5: TLabel
|
||||
Left = 463
|
||||
Top = 42
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #20184#27454#26041#24335
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 612
|
||||
Top = 42
|
||||
Width = 42
|
||||
Height = 13
|
||||
Caption = #23492#20214#20154
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 742
|
||||
Top = 19
|
||||
Width = 56
|
||||
Height = 13
|
||||
Caption = #24555#36882#20844#21496
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object BegDate: TDateTimePicker
|
||||
Left = 190
|
||||
Top = 14
|
||||
Width = 92
|
||||
Height = 21
|
||||
Date = 40675.464742650460000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464742650460000000
|
||||
TabOrder = 0
|
||||
end
|
||||
object EndDate: TDateTimePicker
|
||||
Left = 189
|
||||
Top = 38
|
||||
Width = 93
|
||||
Height = 21
|
||||
Date = 40675.464761099540000000
|
||||
Format = 'yyyy-MM-dd'
|
||||
Time = 40675.464761099540000000
|
||||
TabOrder = 1
|
||||
end
|
||||
object ComboBox2: TComboBox
|
||||
Left = 49
|
||||
Top = 14
|
||||
Width = 109
|
||||
Height = 21
|
||||
Style = csDropDownList
|
||||
ItemHeight = 13
|
||||
TabOrder = 2
|
||||
end
|
||||
object KDNO: TEdit
|
||||
Tag = 2
|
||||
Left = 356
|
||||
Top = 14
|
||||
Width = 84
|
||||
Height = 21
|
||||
TabOrder = 3
|
||||
OnChange = WorkerChange
|
||||
OnKeyPress = KDNOKeyPress
|
||||
end
|
||||
object Country: TEdit
|
||||
Tag = 2
|
||||
Left = 356
|
||||
Top = 38
|
||||
Width = 84
|
||||
Height = 21
|
||||
TabOrder = 4
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KHName: TEdit
|
||||
Tag = 2
|
||||
Left = 517
|
||||
Top = 14
|
||||
Width = 77
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KDType: TEdit
|
||||
Tag = 2
|
||||
Left = 654
|
||||
Top = 14
|
||||
Width = 65
|
||||
Height = 21
|
||||
TabOrder = 6
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object FKType: TEdit
|
||||
Tag = 2
|
||||
Left = 519
|
||||
Top = 38
|
||||
Width = 76
|
||||
Height = 21
|
||||
TabOrder = 7
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object JYPerson: TEdit
|
||||
Tag = 2
|
||||
Left = 654
|
||||
Top = 38
|
||||
Width = 66
|
||||
Height = 21
|
||||
TabOrder = 8
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
object KDComName: TEdit
|
||||
Tag = 2
|
||||
Left = 797
|
||||
Top = 15
|
||||
Width = 84
|
||||
Height = 21
|
||||
TabOrder = 9
|
||||
OnChange = WorkerChange
|
||||
end
|
||||
end
|
||||
object cxTabControl1: TcxTabControl
|
||||
Left = 0
|
||||
Top = 104
|
||||
Width = 1214
|
||||
Height = 22
|
||||
Align = alTop
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
Style = 8
|
||||
TabIndex = 0
|
||||
TabOrder = 2
|
||||
Tabs.Strings = (
|
||||
#24453#36865#23457
|
||||
#24050#36865#23457
|
||||
#23457#26680#36890#36807
|
||||
#23457#26680#19981#36890#36807
|
||||
#20840#37096)
|
||||
OnChange = cxTabControl1Change
|
||||
ClientRectBottom = 24
|
||||
ClientRectRight = 1214
|
||||
ClientRectTop = 24
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 126
|
||||
Width = 1214
|
||||
Height = 444
|
||||
Align = alClient
|
||||
TabOrder = 3
|
||||
object Tv1: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column3
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
Column = v1Column15
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.GroupFooters = gfAlwaysVisible
|
||||
Styles.Inactive = DataLink_WTOA.SkyBlue
|
||||
Styles.IncSearch = DataLink_WTOA.SkyBlue
|
||||
Styles.Selection = DataLink_WTOA.SkyBlue
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
object v1Column10: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #23492#20214#26085#26399
|
||||
DataBinding.FieldName = 'KDDate'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #24555#36882#20844#21496
|
||||
DataBinding.FieldName = 'KDComName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 89
|
||||
end
|
||||
object v1Column6: TcxGridDBColumn
|
||||
Caption = #24555#36882#21333#21495
|
||||
DataBinding.FieldName = 'KDNO'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 103
|
||||
end
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #23492#20214#20154
|
||||
DataBinding.FieldName = 'JYPerson'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderAlignmentVert = vaCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 93
|
||||
end
|
||||
object v1Column14: TcxGridDBColumn
|
||||
Caption = #19994#21153#21161#29702
|
||||
DataBinding.FieldName = 'YWZhuLi'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 75
|
||||
end
|
||||
object v1Column13: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#22336
|
||||
DataBinding.FieldName = 'ToPlace'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 97
|
||||
end
|
||||
object v1Column18: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154
|
||||
DataBinding.FieldName = 'KHName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 99
|
||||
end
|
||||
object v1Column24: TcxGridDBColumn
|
||||
Caption = #25910#20214#20154#32852#31995#26041#24335
|
||||
DataBinding.FieldName = 'KHLXFS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 98
|
||||
end
|
||||
object v1Column9: TcxGridDBColumn
|
||||
Caption = #25910#20214#22320#21306
|
||||
DataBinding.FieldName = 'Country'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 108
|
||||
end
|
||||
object v1Column12: TcxGridDBColumn
|
||||
Caption = #23492#20214#36135#29289#35814#24773
|
||||
DataBinding.FieldName = 'KDInfo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 132
|
||||
end
|
||||
object v1Column25: TcxGridDBColumn
|
||||
Caption = #25968#37327
|
||||
DataBinding.FieldName = 'Qty'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 68
|
||||
end
|
||||
object v1Column15: TcxGridDBColumn
|
||||
Caption = #24555#36882#36153#29992
|
||||
DataBinding.FieldName = 'KDMoneyS'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 80
|
||||
end
|
||||
object v1Column26: TcxGridDBColumn
|
||||
Caption = #36153#29992#25910#21462#26041#24335
|
||||
DataBinding.FieldName = 'FeeShouQuType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Header = DataLink_WTOA.Default
|
||||
Width = 94
|
||||
end
|
||||
object v1Column20: TcxGridDBColumn
|
||||
Caption = #23492#20214#31867#22411
|
||||
DataBinding.FieldName = 'KDType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
end
|
||||
object v1Column23: TcxGridDBColumn
|
||||
Caption = #20184#27454#26041#24335
|
||||
DataBinding.FieldName = 'FKType'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 75
|
||||
end
|
||||
object v1Column3: TcxGridDBColumn
|
||||
Caption = #37325#37327'(KG)'
|
||||
DataBinding.FieldName = 'KgQty'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Styles.Content = DataLink_WTOA.FoneRed
|
||||
Styles.Header = DataLink_WTOA.FoneRed
|
||||
Width = 75
|
||||
end
|
||||
object v1Column16: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #36865#23457#26102#38388
|
||||
DataBinding.FieldName = 'SSTime'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
HeaderGlyphAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 71
|
||||
end
|
||||
object v1Column8: TcxGridDBColumn
|
||||
Caption = #36865#23457#20154
|
||||
DataBinding.FieldName = 'SSPerson'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Column2: TcxGridDBColumn
|
||||
Caption = #30331#35760#20154
|
||||
DataBinding.FieldName = 'Filler'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 69
|
||||
end
|
||||
object v1Column4: TcxGridDBColumn
|
||||
Tag = 999
|
||||
Caption = #30331#35760#26102#38388
|
||||
DataBinding.FieldName = 'FillTime'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.Alignment.Horz = taCenter
|
||||
Properties.Alignment.Vert = taVCenter
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1Column19: TcxGridDBColumn
|
||||
Caption = #23457#26680#20154
|
||||
DataBinding.FieldName = 'Chker'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 61
|
||||
end
|
||||
object v1Column21: TcxGridDBColumn
|
||||
Caption = #23457#26680#26102#38388
|
||||
DataBinding.FieldName = 'ChkTime'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 72
|
||||
end
|
||||
object v1Column22: TcxGridDBColumn
|
||||
Caption = #23457#26680#22791#27880
|
||||
DataBinding.FieldName = 'ChkNote'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 73
|
||||
end
|
||||
object v1CConNo: TcxGridDBColumn
|
||||
Caption = #21512#21516#21495
|
||||
DataBinding.FieldName = 'ConNo'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1FKName: TcxGridDBColumn
|
||||
Caption = #20184#27454#20154
|
||||
DataBinding.FieldName = 'FKName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 70
|
||||
end
|
||||
object v1Column17: TcxGridDBColumn
|
||||
Caption = #29366#24577
|
||||
DataBinding.FieldName = 'Status'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 76
|
||||
end
|
||||
object v1Column7: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 104
|
||||
end
|
||||
object v1QSDate: TcxGridDBColumn
|
||||
Caption = #31614#25910#26085#26399
|
||||
DataBinding.FieldName = 'QSDate'
|
||||
PropertiesClassName = 'TcxDateEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 552
|
||||
Top = 192
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.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 = 1063
|
||||
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 = 454
|
||||
Top = 193
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDBMain: TRMDBDataSet
|
||||
Visible = True
|
||||
DataSet = ADOQueryPrint
|
||||
Left = 392
|
||||
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 = 423
|
||||
Top = 192
|
||||
end
|
||||
object CDS_PRT: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 1093
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryPrint: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
Parameters = <>
|
||||
Left = 485
|
||||
Top = 195
|
||||
end
|
||||
end
|
||||
434
云翔OA(WTOA.dll)/U_KDPersonList.pas
Normal file
434
云翔OA(WTOA.dll)/U_KDPersonList.pas
Normal file
|
|
@ -0,0 +1,434 @@
|
|||
unit U_KDPersonList;
|
||||
|
||||
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, cxCheckBox, Menus;
|
||||
|
||||
|
||||
type
|
||||
TfrmKDPersonList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
TBExport: TToolButton;
|
||||
Order_Main: TClientDataSet;
|
||||
RM1: TRMGridReport;
|
||||
RMDBMain: TRMDBDataSet;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
CDS_PRT: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
Panel1: TPanel;
|
||||
BegDate: TDateTimePicker;
|
||||
EndDate: TDateTimePicker;
|
||||
ComboBox2: TComboBox;
|
||||
Label3: TLabel;
|
||||
Label1: TLabel;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ADOQueryPrint: TADOQuery;
|
||||
cxTabControl1: TcxTabControl;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column10: TcxGridDBColumn;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column6: TcxGridDBColumn;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
v1Column14: TcxGridDBColumn;
|
||||
v1Column13: TcxGridDBColumn;
|
||||
v1Column18: TcxGridDBColumn;
|
||||
v1Column24: TcxGridDBColumn;
|
||||
v1Column9: TcxGridDBColumn;
|
||||
v1Column12: TcxGridDBColumn;
|
||||
v1Column25: TcxGridDBColumn;
|
||||
v1Column15: TcxGridDBColumn;
|
||||
v1Column26: TcxGridDBColumn;
|
||||
v1Column20: TcxGridDBColumn;
|
||||
v1Column23: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
v1Column16: TcxGridDBColumn;
|
||||
v1Column8: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column4: TcxGridDBColumn;
|
||||
v1Column19: TcxGridDBColumn;
|
||||
v1Column21: TcxGridDBColumn;
|
||||
v1Column22: TcxGridDBColumn;
|
||||
v1Column17: TcxGridDBColumn;
|
||||
v1Column7: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
lbl1: TLabel;
|
||||
lbl2: TLabel;
|
||||
lbl3: TLabel;
|
||||
lbl4: TLabel;
|
||||
lbl5: TLabel;
|
||||
KDNO: TEdit;
|
||||
Country: TEdit;
|
||||
KHName: TEdit;
|
||||
KDType: TEdit;
|
||||
FKType: TEdit;
|
||||
v1QSDate: TcxGridDBColumn;
|
||||
Label10: TLabel;
|
||||
JYPerson: TEdit;
|
||||
Label2: TLabel;
|
||||
KDComName: TEdit;
|
||||
v1CConNo: TcxGridDBColumn;
|
||||
v1FKName: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBExportClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxPageControl1Change(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure WorkerChange(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure KDNOKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
|
||||
private
|
||||
FInt,PFInt:Integer;
|
||||
canshu1,canshu2:string;
|
||||
FNowDate:TDateTime;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
function DelData():Boolean;
|
||||
procedure InitGridWsql(fsj:string);
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmKDPersonList: TfrmKDPersonList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_KDInPut,U_ModuleNote, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmKDPersonList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmKDPersonList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('快递信息个人查看',Tv1,'寄件管理');
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.InitGrid();
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
SQL.Add(' from KuaiDi_Money A where 1=1 ');
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
sql.Add(' and( isnull(JYPerson,'''')='''+Trim(DName)+'''');
|
||||
sql.Add(' or isnull(YWZhuLi,'''')='''+Trim(DName)+'''');
|
||||
sql.Add(' or isnull(Filler,'''')='''+Trim(DName)+''')');
|
||||
end;
|
||||
if cxTabControl1.TabIndex<>0 then
|
||||
begin
|
||||
fsj:=TA(ComboBox2.Items.Objects[ComboBox2.Items.IndexOf(Trim(ComboBox2.Text))]).S;
|
||||
sql.Add(' and A.'+Trim(fsj)+'>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
||||
sql.Add(' and A.'+Trim(fsj)+'<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add(' and (isnull(A.Status,'''')=''已送审'' or isnull(A.Status,'''')=''审核中'') ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')=''审核通过'' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=3 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')=''审核不通过'' ');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.InitForm();
|
||||
begin
|
||||
FNowDate:=SGetServerDate(ADOQueryTemp);
|
||||
EndDate.Date:=SGetServerDateMEnd(ADOQueryTemp);
|
||||
BegDate.Date:=SGetServerDateMBeg(ADOQueryTemp);
|
||||
ReadCxGrid('快递信息个人查看',Tv1,'寄件管理');
|
||||
v1Column13.Visible:=False;
|
||||
v1Column24.Visible:=False;
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
v1Column13.Visible:=True;
|
||||
v1Column24.Visible:=True;
|
||||
end;
|
||||
//InitGrid();
|
||||
end;
|
||||
|
||||
function TfrmKDPersonList.DelData():Boolean;
|
||||
begin
|
||||
try
|
||||
Result:=false;
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
while Locate('SSel',True,[]) do
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KuaiDi_Money where KDId='''+Trim(Order_Main.fieldbyname('KDId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
|
||||
Delete;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Result:=True;
|
||||
except
|
||||
Order_Main.EnableControls;
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Result:=False;
|
||||
Application.MessageBox('数据删除异常!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.TBExportClick(Sender: TObject);
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
TcxGridToExcel('寄件信息',cxGrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.FormShow(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
InitForm();
|
||||
SInitComBoxByTvColumns(ComboBox2,Tv1,999,True,True);
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.cxPageControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
frmModuleNote:=TfrmModuleNote.Create(Application);
|
||||
with frmModuleNote do
|
||||
begin
|
||||
flag:='寄件信息登记';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmModuleNote.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
canshu1:=Trim(DParameters1);
|
||||
canshu2:=Trim(DParameters2);
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.InitGridWsql(fsj:string);
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' select A.* ');
|
||||
SQL.Add(' from KuaiDi_Money A');
|
||||
sql.Add(' where isnull(HZType,'''')='''' ');
|
||||
if Trim(canshu1)<>'高权限' then
|
||||
begin
|
||||
sql.Add('and (Filler in(select UserName from SY_User where DPID in');
|
||||
sql.Add(' (select DPID from SY_User where UserName='''+Trim(DName)+'''))');
|
||||
SQL.Add(' )');
|
||||
end;
|
||||
if cxTabControl1.TabIndex=0 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=1 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.Status,'''')<>'''' and isnull(A.MoneyPerson,'''')='''' ');
|
||||
end else
|
||||
if cxTabControl1.TabIndex=2 then
|
||||
begin
|
||||
sql.Add(' and isnull(A.MoneyPerson,'''')<>'''' ');
|
||||
end;
|
||||
sql.Add(fsj);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.WorkerChange(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 TfrmKDPersonList.ToolButton1Click(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 TfrmKDPersonList.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
fPrintFile:String;
|
||||
begin
|
||||
if Order_Main.IsEmpty then Exit;
|
||||
if Order_Main.Locate('SSel',True,[])=False then
|
||||
begin
|
||||
Application.MessageBox('没有选择数据!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\检验指示单标签.rmf' ;
|
||||
Order_Main.DisableControls;
|
||||
with Order_Main do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Order_Main.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
{with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.FieldByName('NotPrint').AsBoolean=True then
|
||||
begin
|
||||
Order_Main.EnableControls;
|
||||
Application.MessageBox('不能打印《不打印》的缸条码!','提示',0);
|
||||
Exit;
|
||||
end; }
|
||||
if FileExists(fPrintFile) then
|
||||
begin
|
||||
with ADOQueryPrint do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select B.OrderNo,B.MPRTCodeName,B.MPRTMF,B.MPRTKZ,C.PRTHX,C.PRTColorNo,C.PRTColor,GangNo=A.GangNo,A.PS,A.Qty,A.QtyUnit,A.MDID ');
|
||||
SQL.Add(',B.MPRTCode,B.MPRTGY,C.PRTColorEng,A.SelfGangNo');
|
||||
sql.Add('from JYOrder_Main_MD A');
|
||||
sql.Add('inner join JYOrder_Main B on A.OrdMainid=B.Mainid');
|
||||
sql.Add(' inner join JYOrder_Sub C on A.OrdSubid=C.SubId');
|
||||
sql.Add(' where A.MDID='''+Trim(Order_Main.fieldbyname('MDID').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
RM1.LoadFromFile(fPrintFile);
|
||||
//RM1.ShowReport;
|
||||
RM1.PrintReport;
|
||||
end else
|
||||
begin
|
||||
Order_Main.DisableControls;
|
||||
Application.MessageBox(PChar('没有找'+ExtractFilePath(Application.ExeName)+'Report\检验指示单标签.rmf'),'提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
Order_Main.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.KDNOKeyPress(Sender: TObject; var Key: Char);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
if Key<>#13 then Exit;
|
||||
if Length(Trim(KDNo.Text))<3 then Exit;
|
||||
fsj:=' and A.KDNo like '''+'%'+Trim(KDNo.Text)+'%'+'''';
|
||||
InitGridWsql(fsj);
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.N1Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,True);
|
||||
end;
|
||||
|
||||
procedure TfrmKDPersonList.N2Click(Sender: TObject);
|
||||
begin
|
||||
SelOKNo(Order_Main,False);
|
||||
end;
|
||||
|
||||
end.
|
||||
181
云翔OA(WTOA.dll)/U_ModuleNote.dfm
Normal file
181
云翔OA(WTOA.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
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
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_WTOA.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_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 48
|
||||
Top = 136
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_WTOA.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 80
|
||||
Top = 144
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_WTOA.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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user