~
This commit is contained in:
parent
a1881aa2b0
commit
d40c72dd65
|
@ -208,6 +208,19 @@ object frmZdyAttInputCP: TfrmZdyAttInputCP
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Width = 60
|
Width = 60
|
||||||
end
|
end
|
||||||
|
object Tv2Column6: TcxGridDBColumn
|
||||||
|
Caption = #22270#29255
|
||||||
|
DataBinding.FieldName = 'CPFile'
|
||||||
|
PropertiesClassName = 'TcxButtonEditProperties'
|
||||||
|
Properties.Buttons = <
|
||||||
|
item
|
||||||
|
Default = True
|
||||||
|
Kind = bkEllipsis
|
||||||
|
end>
|
||||||
|
Properties.OnButtonClick = Tv2Column6PropertiesButtonClick
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object cxGridLevel1: TcxGridLevel
|
object cxGridLevel1: TcxGridLevel
|
||||||
GridView = Tv2
|
GridView = Tv2
|
||||||
|
|
|
@ -29,7 +29,7 @@ uses
|
||||||
dxSkinscxPCPainter;
|
dxSkinscxPCPainter;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmZdyAttInputCP = class(TForm)
|
TfrmZdyAttInputCP = class(TForm)
|
||||||
ToolBar1: TToolBar;
|
ToolBar1: TToolBar;
|
||||||
TBClose: TToolButton;
|
TBClose: TToolButton;
|
||||||
ADOQueryTemp: TADOQuery;
|
ADOQueryTemp: TADOQuery;
|
||||||
|
@ -73,6 +73,7 @@ type
|
||||||
Tv2Column3: TcxGridDBColumn;
|
Tv2Column3: TcxGridDBColumn;
|
||||||
Tv2Column4: TcxGridDBColumn;
|
Tv2Column4: TcxGridDBColumn;
|
||||||
Tv2Column5: TcxGridDBColumn;
|
Tv2Column5: TcxGridDBColumn;
|
||||||
|
Tv2Column6: TcxGridDBColumn;
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
procedure TBCloseClick(Sender: TObject);
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
@ -86,6 +87,7 @@ type
|
||||||
procedure ToolButton2Click(Sender: TObject);
|
procedure ToolButton2Click(Sender: TObject);
|
||||||
procedure Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
procedure Tv1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||||
procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||||
|
procedure Tv2Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||||
private
|
private
|
||||||
{ Private declarations }
|
{ Private declarations }
|
||||||
procedure InitGrid();
|
procedure InitGrid();
|
||||||
|
@ -95,6 +97,7 @@ type
|
||||||
{ Public declarations }
|
{ Public declarations }
|
||||||
RKFlag, FCYID, Fzdyname: string;
|
RKFlag, FCYID, Fzdyname: string;
|
||||||
fkhType: string;
|
fkhType: string;
|
||||||
|
fFlileFlag: string;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -103,7 +106,7 @@ var
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
U_DataLink, U_Fun, U_ZDYHelp, U_ZdyAttachGYSxz;
|
U_DataLink, U_Fun, U_ZDYHelp, U_ZdyAttachGYSxz, getpic;
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
|
@ -224,7 +227,7 @@ begin
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Edit;
|
Edit;
|
||||||
FieldByName('Editer').Value := Trim(DName);
|
FieldByName('Editer').Value := Trim(DName);
|
||||||
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
||||||
end;
|
end;
|
||||||
|
@ -238,6 +241,7 @@ begin
|
||||||
FieldByName('Type').Value := 'CP';
|
FieldByName('Type').Value := 'CP';
|
||||||
FieldByName('khType').Value := trim(fkhType);
|
FieldByName('khType').Value := trim(fkhType);
|
||||||
FieldByName('Filler').Value := Trim(DName);
|
FieldByName('Filler').Value := Trim(DName);
|
||||||
|
FieldByName('CPFile').Value := Trim(CDS_HZ.fieldbyname('CPFile').AsString);
|
||||||
Post;
|
Post;
|
||||||
end;
|
end;
|
||||||
with ADOQueryCmd do
|
with ADOQueryCmd do
|
||||||
|
@ -567,5 +571,24 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmZdyAttInputCP.Tv2Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
||||||
|
begin
|
||||||
|
FormGetPic := TFormGetPic.create(self);
|
||||||
|
with FormGetPic do
|
||||||
|
begin
|
||||||
|
fFlileFlag := self.fFlileFlag;
|
||||||
|
fkeyNo := CDS_HZ.fieldbyname('CPFile').asstring;
|
||||||
|
pat1 := 'FileName';
|
||||||
|
pic1 := 'FilesOther';
|
||||||
|
FTFType := 'CP';
|
||||||
|
if showmodal = 1 then
|
||||||
|
begin
|
||||||
|
CDS_HZ.edit;
|
||||||
|
CDS_HZ.fieldbyname('CPFile').Value := trim(fkeyNo);
|
||||||
|
end;
|
||||||
|
free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -364,6 +364,12 @@ object frmZdyAttachCP: TfrmZdyAttachCP
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Width = 60
|
Width = 60
|
||||||
end
|
end
|
||||||
|
object Tv2Column6: TcxGridDBColumn
|
||||||
|
Caption = #22270#29255
|
||||||
|
DataBinding.FieldName = 'CPFile'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object cxGridLevel1: TcxGridLevel
|
object cxGridLevel1: TcxGridLevel
|
||||||
GridView = Tv2
|
GridView = Tv2
|
||||||
|
|
|
@ -97,6 +97,7 @@ type
|
||||||
Tv2Column3: TcxGridDBColumn;
|
Tv2Column3: TcxGridDBColumn;
|
||||||
Tv2Column4: TcxGridDBColumn;
|
Tv2Column4: TcxGridDBColumn;
|
||||||
Tv2Column5: TcxGridDBColumn;
|
Tv2Column5: TcxGridDBColumn;
|
||||||
|
Tv2Column6: TcxGridDBColumn;
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
procedure TBCloseClick(Sender: TObject);
|
procedure TBCloseClick(Sender: TObject);
|
||||||
|
@ -134,14 +135,14 @@ uses
|
||||||
procedure TfrmZdyAttachCP.InitGrid();
|
procedure TfrmZdyAttachCP.InitGrid();
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
ADOQueryMain.DisableControls;
|
ADOQueryMain.DisableControls;
|
||||||
with ADOQueryMain do
|
with ADOQueryMain do
|
||||||
begin
|
begin
|
||||||
Filtered := False;
|
Filtered := False;
|
||||||
Close;
|
Close;
|
||||||
SQL.Clear;
|
SQL.Clear;
|
||||||
sql.Add(' select ATID,ZdyName,ZdyCode,DEFstr1,DEFstr2,defNote1,Mrate,defNote2,defNote3,DEFstr3,DEFstr5,DEFstr4,DEFstr10,');
|
sql.Add(' select ATID,ZdyName,ZdyCode,DEFstr1,DEFstr2,defNote1,Mrate,defNote2,defNote3,DEFstr3,DEFstr5,DEFstr4,DEFstr10,');
|
||||||
sql.Add(' DEFstr6,DEFstr7,DEFstr8,Note,DEFstr4,DEFstr5,defflt1,Filler,FillTime ');
|
sql.Add(' DEFstr6,DEFstr7,DEFstr8,Note,DEFstr4,DEFstr5,defflt1,Filler,FillTime,CPFile ');
|
||||||
sql.Add(' from KH_Zdy_Attachment where Type=''CP'' and isnull(DEFstr5,'''')<>''Å÷²¼'' ');
|
sql.Add(' from KH_Zdy_Attachment where Type=''CP'' and isnull(DEFstr5,'''')<>''Å÷²¼'' ');
|
||||||
// sql.Add(' and isnull(khType,'''')=' + quotedstr(trim(fkhType)));
|
// sql.Add(' and isnull(khType,'''')=' + quotedstr(trim(fkhType)));
|
||||||
sql.Add(' order by zdyName,dbo.getNum_copy1(Defstr3) ');
|
sql.Add(' order by zdyName,dbo.getNum_copy1(Defstr3) ');
|
||||||
|
|
157
基础资料维护(BaseInfo.dll)/getpic.dfm
Normal file
157
基础资料维护(BaseInfo.dll)/getpic.dfm
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
object FormGetPic: TFormGetPic
|
||||||
|
Left = 244
|
||||||
|
Top = 118
|
||||||
|
BorderIcons = [biSystemMenu]
|
||||||
|
BorderStyle = bsSingle
|
||||||
|
Caption = #33719#21462#22270#29255
|
||||||
|
ClientHeight = 449
|
||||||
|
ClientWidth = 670
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = GB2312_CHARSET
|
||||||
|
Font.Color = clWindowText
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = #23435#20307
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poDesktopCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
OnDestroy = FormDestroy
|
||||||
|
OnShow = FormShow
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 12
|
||||||
|
object Image2: TImage
|
||||||
|
Left = 464
|
||||||
|
Top = 8
|
||||||
|
Width = 160
|
||||||
|
Height = 120
|
||||||
|
end
|
||||||
|
object SpeedButton1: TSpeedButton
|
||||||
|
Left = 500
|
||||||
|
Top = 334
|
||||||
|
Width = 80
|
||||||
|
Height = 22
|
||||||
|
Caption = #25171#24320#22270#29255'...'
|
||||||
|
OnClick = SpeedButton1Click
|
||||||
|
end
|
||||||
|
object SpeedButton2: TSpeedButton
|
||||||
|
Left = 500
|
||||||
|
Top = 380
|
||||||
|
Width = 80
|
||||||
|
Height = 22
|
||||||
|
Caption = #30830#23450
|
||||||
|
Enabled = False
|
||||||
|
OnClick = SpeedButton2Click
|
||||||
|
end
|
||||||
|
object SpeedButton3: TSpeedButton
|
||||||
|
Left = 500
|
||||||
|
Top = 426
|
||||||
|
Width = 80
|
||||||
|
Height = 22
|
||||||
|
Caption = #25918#24323
|
||||||
|
OnClick = SpeedButton3Click
|
||||||
|
end
|
||||||
|
object SpeedButton4: TSpeedButton
|
||||||
|
Left = 500
|
||||||
|
Top = 358
|
||||||
|
Width = 80
|
||||||
|
Height = 22
|
||||||
|
Caption = #22270#29255#21478#23384'...'
|
||||||
|
OnClick = SpeedButton4Click
|
||||||
|
end
|
||||||
|
object SpeedButton5: TSpeedButton
|
||||||
|
Left = 500
|
||||||
|
Top = 404
|
||||||
|
Width = 80
|
||||||
|
Height = 22
|
||||||
|
Caption = #21024#38500
|
||||||
|
OnClick = SpeedButton5Click
|
||||||
|
end
|
||||||
|
object ScrollBox1: TScrollBox
|
||||||
|
Left = 5
|
||||||
|
Top = 5
|
||||||
|
Width = 440
|
||||||
|
Height = 440
|
||||||
|
HorzScrollBar.Visible = False
|
||||||
|
VertScrollBar.Visible = False
|
||||||
|
TabOrder = 0
|
||||||
|
object Image1: TImage
|
||||||
|
Left = 0
|
||||||
|
Top = 0
|
||||||
|
Width = 437
|
||||||
|
Height = 436
|
||||||
|
Cursor = crSizeAll
|
||||||
|
AutoSize = True
|
||||||
|
Center = True
|
||||||
|
IncrementalDisplay = True
|
||||||
|
OnMouseDown = Image1MouseDown
|
||||||
|
OnMouseMove = Image1MouseMove
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object Button1: TButton
|
||||||
|
Left = 464
|
||||||
|
Top = 252
|
||||||
|
Width = 81
|
||||||
|
Height = 21
|
||||||
|
Caption = #25171#24320#25668#20687#22836
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = Button1Click
|
||||||
|
end
|
||||||
|
object Button2: TButton
|
||||||
|
Left = 560
|
||||||
|
Top = 252
|
||||||
|
Width = 81
|
||||||
|
Height = 21
|
||||||
|
Caption = #25235#22270
|
||||||
|
TabOrder = 2
|
||||||
|
OnClick = Button2Click
|
||||||
|
end
|
||||||
|
object Twain: TDelphiTwain
|
||||||
|
OnTwainAcquire = TwainTwainAcquire
|
||||||
|
TransferMode = ttmMemory
|
||||||
|
SourceCount = 0
|
||||||
|
Info.MajorVersion = 1
|
||||||
|
Info.MinorVersion = 0
|
||||||
|
Info.Language = tlUserLocale
|
||||||
|
Info.CountryCode = 1
|
||||||
|
Info.Groups = [tgControl, tgImage]
|
||||||
|
Info.VersionInfo = 'Application name'
|
||||||
|
Info.Manufacturer = 'Application manufacturer'
|
||||||
|
Info.ProductFamily = 'App product family'
|
||||||
|
Info.ProductName = 'App product name'
|
||||||
|
LibraryLoaded = False
|
||||||
|
SourceManagerLoaded = False
|
||||||
|
Left = 518
|
||||||
|
Top = 160
|
||||||
|
end
|
||||||
|
object OpenPictureDialog1: TOpenPictureDialog
|
||||||
|
DefaultExt = 'jpg'
|
||||||
|
Filter = 'JPEG '#22270#24418#25991#20214' (*.jpg)|*.jpg'
|
||||||
|
Left = 568
|
||||||
|
Top = 152
|
||||||
|
end
|
||||||
|
object ADOQuery1: TADOQuery
|
||||||
|
Connection = DataLink_BaseInfo.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 504
|
||||||
|
Top = 280
|
||||||
|
end
|
||||||
|
object SaveDialog1: TSavePictureDialog
|
||||||
|
Filter = 'JPG'#22270#29255#26684#24335' (*.JPG)|*.JPG'
|
||||||
|
Left = 568
|
||||||
|
Top = 299
|
||||||
|
end
|
||||||
|
object adoqueryImage: TADOQuery
|
||||||
|
Connection = DataLink_BaseInfo.ADOLink
|
||||||
|
Parameters = <>
|
||||||
|
Left = 488
|
||||||
|
Top = 184
|
||||||
|
end
|
||||||
|
object IdFTP1: TIdFTP
|
||||||
|
MaxLineAction = maException
|
||||||
|
ReadTimeout = 0
|
||||||
|
ProxySettings.ProxyType = fpcmNone
|
||||||
|
ProxySettings.Port = 0
|
||||||
|
Left = 500
|
||||||
|
Top = 198
|
||||||
|
end
|
||||||
|
end
|
595
基础资料维护(BaseInfo.dll)/getpic.pas
Normal file
595
基础资料维护(BaseInfo.dll)/getpic.pas
Normal file
|
@ -0,0 +1,595 @@
|
||||||
|
unit getpic;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, strUtils,Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ComCtrls, ToolWin, ExtCtrls, jpeg, IniFiles, ExtDlgs,
|
||||||
|
DelphiTwain, Buttons, StdCtrls, DB, ADODB, IdBaseComponent, IdComponent,
|
||||||
|
IdTCPConnection, IdTCPClient, IdFTP;
|
||||||
|
|
||||||
|
type
|
||||||
|
TFormGetPic = class(TForm)
|
||||||
|
Twain: TDelphiTwain;
|
||||||
|
ScrollBox1: TScrollBox;
|
||||||
|
Image1: TImage;
|
||||||
|
OpenPictureDialog1: TOpenPictureDialog;
|
||||||
|
Image2: TImage;
|
||||||
|
SpeedButton1: TSpeedButton;
|
||||||
|
SpeedButton2: TSpeedButton;
|
||||||
|
SpeedButton3: TSpeedButton;
|
||||||
|
Button1: TButton;
|
||||||
|
Button2: TButton;
|
||||||
|
ADOQuery1: TADOQuery;
|
||||||
|
SpeedButton4: TSpeedButton;
|
||||||
|
SaveDialog1: TSavePictureDialog;
|
||||||
|
adoqueryImage: TADOQuery;
|
||||||
|
IdFTP1: TIdFTP;
|
||||||
|
SpeedButton5: TSpeedButton;
|
||||||
|
procedure ToolButton1Click(Sender: TObject);
|
||||||
|
procedure ToolButton3Click(Sender: TObject);
|
||||||
|
procedure TwainTwainAcquire(Sender: TObject; const Index: Integer;
|
||||||
|
Image: TBitmap; var Cancel: Boolean);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
|
||||||
|
Y: Integer);
|
||||||
|
procedure SpeedButton1Click(Sender: TObject);
|
||||||
|
procedure SpeedButton2Click(Sender: TObject);
|
||||||
|
procedure SpeedButton3Click(Sender: TObject);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure SpeedButton4Click(Sender: TObject);
|
||||||
|
procedure Initimage();
|
||||||
|
procedure SpeedButton5Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
hWndC : THandle;
|
||||||
|
CapturingAVI : bool;
|
||||||
|
{ Private declarations }
|
||||||
|
ClickPos: TPoint;
|
||||||
|
SelectedSource, PicLeft, PicTop, PicWidth, PicHeight: Integer;
|
||||||
|
procedure CreThumb(Width, Height: Integer);
|
||||||
|
function SaveImage():Boolean;
|
||||||
|
public
|
||||||
|
FilePath:string;
|
||||||
|
FileName:string;
|
||||||
|
FTFType:string;
|
||||||
|
pat1:string;
|
||||||
|
pic1:string;
|
||||||
|
fkeyNo:string;
|
||||||
|
fFlileFlag:string;
|
||||||
|
{ Public declarations }
|
||||||
|
MyJpeg: TJPEGImage;
|
||||||
|
// JPStream: TMemoryStream;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
FormGetPic: TFormGetPic;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses U_DataLink,U_Fun10;
|
||||||
|
const WM_CAP_START = WM_USER;
|
||||||
|
const WM_CAP_STOP = WM_CAP_START + 68;
|
||||||
|
const WM_CAP_DRIVER_CONNECT = WM_CAP_START + 10;
|
||||||
|
const WM_CAP_DRIVER_DISCONNECT = WM_CAP_START + 11;
|
||||||
|
const WM_CAP_SAVEDIB = WM_CAP_START + 25;
|
||||||
|
const WM_CAP_GRAB_FRAME = WM_CAP_START + 60;
|
||||||
|
const WM_CAP_SEQUENCE = WM_CAP_START + 62;
|
||||||
|
const WM_CAP_FILE_SET_CAPTURE_FILEA = WM_CAP_START + 20;
|
||||||
|
const WM_CAP_SEQUENCE_NOFILE =WM_CAP_START+ 63 ;
|
||||||
|
const WM_CAP_SET_OVERLAY =WM_CAP_START+ 51 ;
|
||||||
|
const WM_CAP_SET_PREVIEW =WM_CAP_START+ 50 ;
|
||||||
|
const WM_CAP_SET_CALLBACK_VIDEOSTREAM = WM_CAP_START +6;
|
||||||
|
const WM_CAP_SET_CALLBACK_ERROR=WM_CAP_START +2;
|
||||||
|
const WM_CAP_SET_CALLBACK_STATUSA= WM_CAP_START +3;
|
||||||
|
const WM_CAP_SET_CALLBACK_FRAME= WM_CAP_START +5;
|
||||||
|
const WM_CAP_SET_SCALE=WM_CAP_START+ 53 ;
|
||||||
|
const WM_CAP_SET_PREVIEWRATE=WM_CAP_START+ 52 ;
|
||||||
|
function capCreateCaptureWindowA(lpszWindowName : PCHAR;
|
||||||
|
dwStyle : longint;
|
||||||
|
x : integer;
|
||||||
|
y : integer;
|
||||||
|
nWidth : integer;
|
||||||
|
nHeight : integer;
|
||||||
|
ParentWin : HWND;
|
||||||
|
nId : integer): HWND;
|
||||||
|
STDCALL EXTERNAL 'AVICAP32.DLL';
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TFormGetPic.Initimage();
|
||||||
|
var
|
||||||
|
jpg:TJpegImage;
|
||||||
|
myStream: TADOBlobStream;
|
||||||
|
sFieldName:string;
|
||||||
|
JPStream: TMemoryStream;
|
||||||
|
begin
|
||||||
|
jpg:=TJpegImage.Create();
|
||||||
|
JPStream := TMemoryStream.Create;
|
||||||
|
try
|
||||||
|
|
||||||
|
with adoqueryImage do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from TP_File where WBID='+quotedstr(trim(fkeyNo)));
|
||||||
|
open;
|
||||||
|
IF not IsEmpty then
|
||||||
|
begin
|
||||||
|
IF not fieldbyname(pic1).IsNull then
|
||||||
|
begin
|
||||||
|
myStream:=tadoblobstream.Create(tblobfield(adoqueryImage.fieldbyname(pic1)),bmread);
|
||||||
|
jpg.LoadFromStream(myStream);
|
||||||
|
Image2.Picture.Assign(jpg);
|
||||||
|
myStream.Free;
|
||||||
|
|
||||||
|
try
|
||||||
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||||
|
IdFTP1.Username := 'three';
|
||||||
|
IdFTP1.Password := '641010';
|
||||||
|
IdFTP1.Connect();
|
||||||
|
except
|
||||||
|
;
|
||||||
|
end;
|
||||||
|
|
||||||
|
JPStream.Clear;
|
||||||
|
if IdFTP1.Connected then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
IdFTP1.Get(fFlileFlag+'\'+ Trim(fieldbyname(pat1).AsString), JPStream);
|
||||||
|
except
|
||||||
|
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||||
|
IdFTP1.Quit;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||||
|
IdFTP1.Quit;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if IdFTP1.Connected then IdFTP1.Quit;
|
||||||
|
JPStream.Position := 0;
|
||||||
|
jpg.LoadFromStream(JPStream);
|
||||||
|
Image1.Picture.Assign(jpg);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
jpg.free;
|
||||||
|
JPStream.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TFormGetPic.SaveImage():Boolean;
|
||||||
|
var
|
||||||
|
myStream: TADOBlobStream;
|
||||||
|
maxNo:string;
|
||||||
|
fNewFileName:string;
|
||||||
|
begin
|
||||||
|
fNewFileName:=formatdatetime('yyyyMMddhhnnsszzz',now())+ExtractFileExt(FilePath);
|
||||||
|
IF fkeyNO='' then fkeyNO:=fNewFileName;
|
||||||
|
result:=false;
|
||||||
|
try
|
||||||
|
with adoqueryImage do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from TP_File where WBID='+quotedstr(trim(fkeyNo)));
|
||||||
|
sql.Add('and TFType='+quotedstr(trim(FTFType)));
|
||||||
|
open;
|
||||||
|
if RecordCount<=0 then
|
||||||
|
begin
|
||||||
|
Append;
|
||||||
|
if GetLSNo(ADOQuery1,maxNo,'FJ','TP_File',4,1)=False then
|
||||||
|
begin
|
||||||
|
Application.MessageBox('取最大号失败!','提示',0);
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
fieldByName('TFID').AsString := maxNo;
|
||||||
|
fieldByName('WBID').AsString := fkeyNO;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
edit;
|
||||||
|
end;
|
||||||
|
fieldByName(pat1).AsString :=trim(fNewFileName);
|
||||||
|
fieldByName('Filler').AsString :=trim(dName);
|
||||||
|
fieldByName('TFType').AsString :=trim(FTFType);
|
||||||
|
myStream := TADOBlobStream.Create(TBlobField(FieldByName(pic1)), bmWrite);
|
||||||
|
MyJpeg.Assign(Image2.Picture.Graphic);
|
||||||
|
MyJpeg.SaveToStream(myStream);
|
||||||
|
myStream.Free;
|
||||||
|
Post;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if FilePath <> '' then
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI','SERVER','服务器地址','127.0.0.1');
|
||||||
|
IdFTP1.Username := 'three';
|
||||||
|
IdFTP1.Password := '641010';
|
||||||
|
IdFTP1.Connect();
|
||||||
|
IdFTP1.Put(FilePath, fFlileFlag+'\' + Trim(fNewFileName));
|
||||||
|
IdFTP1.Quit;
|
||||||
|
except
|
||||||
|
IdFTP1.Quit;
|
||||||
|
Application.MessageBox('上传客户图样文件失败,请检查文件服务器!', '提示', MB_ICONWARNING);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
IdFTP1.Quit;
|
||||||
|
|
||||||
|
result:=true;
|
||||||
|
except
|
||||||
|
myStream.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.ToolButton1Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini: TIniFile;
|
||||||
|
begin
|
||||||
|
if Twain.LoadLibrary then
|
||||||
|
begin
|
||||||
|
{Load source manager}
|
||||||
|
Twain.SourceManagerLoaded := TRUE;
|
||||||
|
{Allow user to select source}
|
||||||
|
SelectedSource := Twain.SelectSource;
|
||||||
|
if SelectedSource <> -1 then
|
||||||
|
begin
|
||||||
|
Ini := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'scanner.ini');
|
||||||
|
try
|
||||||
|
Ini.WriteInteger( 'SCANNER', 'Scanner', SelectedSource);
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end {if SelectedSource <> -1}
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ShowMessage('未安装扫描仪');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.ToolButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Twain.LoadLibrary then
|
||||||
|
begin
|
||||||
|
{Load source manager}
|
||||||
|
Twain.SourceManagerLoaded := TRUE;
|
||||||
|
|
||||||
|
if SelectedSource <> -1 then
|
||||||
|
begin
|
||||||
|
{Load source, select transference method and enable (display interface)}
|
||||||
|
Twain.Source[SelectedSource].Loaded := TRUE;
|
||||||
|
Twain.Source[SelectedSource].SetICapUnits(tuInches);
|
||||||
|
Twain.Source[SelectedSource].SetImagelayoutFrame(PicLeft/25.4, PicTop/25.4, (PicLeft+PicWidth)/25.4, (PicTop+PicHeight)/25.4);
|
||||||
|
Twain.Source[SelectedSource].SetIYResolution(200);
|
||||||
|
Twain.Source[SelectedSource].SetIXResolution(200);
|
||||||
|
Twain.Source[SelectedSource].TransferMode := ttmMemory;
|
||||||
|
Twain.Source[SelectedSource].EnableSource(FALSE, TRUE);
|
||||||
|
while Twain.Source[SelectedSource].Enabled do Application.ProcessMessages;
|
||||||
|
end; {if SelectedSource <> -1}
|
||||||
|
// Twain.UnloadLibrary;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
ShowMessage('未安装扫描仪');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.TwainTwainAcquire(Sender: TObject;
|
||||||
|
const Index: Integer; Image: TBitmap; var Cancel: Boolean);
|
||||||
|
begin
|
||||||
|
Image1.Picture.Assign(Image);
|
||||||
|
Cancel := TRUE;
|
||||||
|
CreThumb(150, 150);
|
||||||
|
SpeedButton2.Enabled := TRUE;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.FormShow(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini: TIniFile;
|
||||||
|
begin
|
||||||
|
{ Ini := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'scanner.ini');
|
||||||
|
try
|
||||||
|
SelectedSource := Ini.ReadInteger( 'SCANNER', 'Scanner', 0);
|
||||||
|
PicLeft := Ini.ReadInteger( 'SCANNER', 'Left', 0);
|
||||||
|
PicTop := Ini.ReadInteger( 'SCANNER', 'Top', 0);
|
||||||
|
PicWidth := Ini.ReadInteger( 'SCANNER', 'Width', 100);
|
||||||
|
PicHeight := Ini.ReadInteger( 'SCANNER', 'Height', 100);
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end; }
|
||||||
|
Initimage();
|
||||||
|
end;
|
||||||
|
|
||||||
|
{
|
||||||
|
procedure TFormGetPic.ToolButton6Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
Ini: TIniFile;
|
||||||
|
begin
|
||||||
|
FormGetPos := TFormGetPos.Create(Self);
|
||||||
|
FormGetPos.SpinEdit1.Value := PicLeft;
|
||||||
|
FormGetPos.SpinEdit2.Value := PicTop;
|
||||||
|
FormGetPos.SpinEdit3.Value := PicWidth;
|
||||||
|
FormGetPos.SpinEdit4.Value := PicHeight;
|
||||||
|
if FormGetPos.ShowModal = 1 then
|
||||||
|
begin
|
||||||
|
PicLeft := FormGetPos.SpinEdit1.Value;
|
||||||
|
PicTop := FormGetPos.SpinEdit2.Value;
|
||||||
|
PicWidth := FormGetPos.SpinEdit3.Value;
|
||||||
|
PicHeight := FormGetPos.SpinEdit4.Value;
|
||||||
|
|
||||||
|
Ini := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'scanner.ini');
|
||||||
|
try
|
||||||
|
Ini.WriteInteger( 'SCANNER', 'Left', PicLeft);
|
||||||
|
Ini.WriteInteger( 'SCANNER', 'Top', PicTop);
|
||||||
|
Ini.WriteInteger( 'SCANNER', 'Width', PicWidth);
|
||||||
|
Ini.WriteInteger( 'SCANNER', 'Height', PicHeight);
|
||||||
|
finally
|
||||||
|
Ini.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
FormGetPos.Free;
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
|
procedure TFormGetPic.CreThumb(Width, Height: Integer);
|
||||||
|
var
|
||||||
|
Bitmap: TBitmap;
|
||||||
|
Ratio: Double;
|
||||||
|
ARect: TRect;
|
||||||
|
AHeight, AHeightOffset: Integer;
|
||||||
|
AWidth, AWidthOffset: Integer;
|
||||||
|
begin
|
||||||
|
Bitmap := TBitmap.Create;
|
||||||
|
try
|
||||||
|
Ratio := Image1.Picture.Graphic.Width/Image1.Picture.Graphic.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));
|
||||||
|
// StretchDraw original image
|
||||||
|
ARect := Rect(AWidthOffset, AHeightOffset, AWidth+AWidthOffset, AHeight+AHeightOffset);
|
||||||
|
Bitmap.Canvas.StretchDraw(ARect, Image1.Picture.Graphic);
|
||||||
|
// Assign back to the Jpeg, and save to the file
|
||||||
|
Image2.Picture.Assign(BitMap);
|
||||||
|
// MyJpeg1.Assign(Image2.Picture.Graphic);
|
||||||
|
finally
|
||||||
|
Bitmap.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MyJpeg := TJpegImage.Create;
|
||||||
|
// MyJpeg1 := TJpegImage.Create;
|
||||||
|
Button2.Enabled:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// MyJpeg1.Free;
|
||||||
|
MyJpeg.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.Image1MouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
ClickPos.x := X;
|
||||||
|
ClickPos.y := Y;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.Image1MouseMove(Sender: TObject; Shift: TShiftState;
|
||||||
|
X, Y: Integer);
|
||||||
|
var
|
||||||
|
NewPos: TPoint;
|
||||||
|
begin
|
||||||
|
{The left button was pressed}
|
||||||
|
if ssLeft in Shift then
|
||||||
|
begin
|
||||||
|
{Calculate new position}
|
||||||
|
NewPos.X := Image1.Left + x - ClickPos.x;
|
||||||
|
NewPos.Y := Image1.Top + y - ClickPos.y;
|
||||||
|
if NewPos.x + Image1.Width < ScrollBox1.Width then
|
||||||
|
NewPos.x := ScrollBox1.Width - Image1.Width;
|
||||||
|
if NewPos.y + Image1.Height < ScrollBox1.Height then
|
||||||
|
NewPos.y := ScrollBox1.Height - Image1.Height;
|
||||||
|
if NewPos.X > 0 then NewPos.X := 0;
|
||||||
|
if NewPos.Y > 0 then NewPos.Y := 0;
|
||||||
|
|
||||||
|
Image1.Top := NewPos.Y;
|
||||||
|
Image1.Left := NewPos.X;
|
||||||
|
end {if ssLeft in Shift}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.SpeedButton1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if OpenPictureDialog1.Execute then
|
||||||
|
begin
|
||||||
|
Image1.Top := 0;
|
||||||
|
Image1.Left := 0;
|
||||||
|
Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
|
||||||
|
FilePath:=OpenPictureDialog1.FileName;
|
||||||
|
FileName:=ExtractFileName(FilePath);
|
||||||
|
CreThumb(240, 180);
|
||||||
|
SpeedButton2.Enabled := TRUE;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.SpeedButton2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
|
||||||
|
IF SaveImage() then
|
||||||
|
begin
|
||||||
|
ModalResult := 1;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
application.MessageBox('数据保存失败!','提示信息',0)
|
||||||
|
end;
|
||||||
|
// JPStream := TMemoryStream.Create;
|
||||||
|
// MyJPeg.Assign(Image1.Picture.Graphic);
|
||||||
|
// MyJPeg.SaveToStream(JPStream);
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.SpeedButton3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ModalResult := 2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
hWndC := 0;
|
||||||
|
try
|
||||||
|
hWndC := capCreateCaptureWindowA('My Own Capture Window',
|
||||||
|
WS_CHILD or WS_VISIBLE ,
|
||||||
|
ScrollBox1.Left,
|
||||||
|
ScrollBox1.Top,
|
||||||
|
ScrollBox1.Width,
|
||||||
|
ScrollBox1.Height,
|
||||||
|
FormGetPic.Handle,
|
||||||
|
0);
|
||||||
|
if hWndC <> 0 then
|
||||||
|
begin
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_CALLBACK_ERROR, 0, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_CALLBACK_STATUSA, 0, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_DRIVER_CONNECT, 0, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_SCALE, 1, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_PREVIEWRATE, 66, 0);
|
||||||
|
//SendMessage(hWndC, WM_CAP_SEQUENCE_NOFILE, 1, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_OVERLAY, 1, 0);
|
||||||
|
SendMessage(hWndC, WM_CAP_SET_PREVIEW, 1, 0);
|
||||||
|
Button1.Enabled:=false;
|
||||||
|
Button2.Enabled:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
application.MessageBox('连接摄像头失败!','错误信息',MB_ICONERROR);
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
end;
|
||||||
|
application.ProcessMessages;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.Button2Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
sFieldName:string;
|
||||||
|
MBMP:TBitmap;
|
||||||
|
MJPG:TJpegImage;
|
||||||
|
begin
|
||||||
|
|
||||||
|
sFieldName:='D:\抓图';
|
||||||
|
if not DirectoryExists(pchar(sFieldName)) then
|
||||||
|
CreateDirectory(pchar(sFieldName),nil);
|
||||||
|
|
||||||
|
sFieldName:=sFieldName+'\'+formatdateTime('yyyyMMddhhnnss',SGetServerDateTime(ADOQuery1));
|
||||||
|
|
||||||
|
FileName:=ExtractFileName(sFieldName);
|
||||||
|
if hWndC <> 0 then
|
||||||
|
begin
|
||||||
|
SendMessage(hWndC,WM_CAP_SAVEDIB,0,longint(pchar(sFieldName+'.BMP')));
|
||||||
|
SendMessage(hWndC, WM_CAP_DRIVER_DISCONNECT, 0, 0);
|
||||||
|
hWndC := 0;
|
||||||
|
application.ProcessMessages;
|
||||||
|
Button1.Enabled:=true;
|
||||||
|
Button2.Enabled:=false;
|
||||||
|
try
|
||||||
|
MBMP:= TBitmap.Create;
|
||||||
|
MJPG:= TJpegImage.Create;
|
||||||
|
MBMP.LoadFromFile(pchar(sFieldName+'.BMP'));
|
||||||
|
MJPG.assign(MBMP);
|
||||||
|
Image1.Picture.Bitmap.Assign(MJPG);
|
||||||
|
application.ProcessMessages;
|
||||||
|
MJPG.SaveToFile(pchar(sFieldName+'.JPG'));
|
||||||
|
CreThumb(240, 180);
|
||||||
|
finally
|
||||||
|
MBMP.Free;
|
||||||
|
MJPG.Free;
|
||||||
|
if Fileexists(pchar(sFieldName+'.BMP')) then DeleteFile(pchar(sFieldName+'.BMP'));
|
||||||
|
FilePath:=sFieldName+'.JPG';
|
||||||
|
FileName:=ExtractFileName(FilePath);
|
||||||
|
end;
|
||||||
|
SpeedButton2.Enabled:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.SpeedButton4Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
MJPG:TJpegImage;
|
||||||
|
pathFile:string;
|
||||||
|
begin
|
||||||
|
if Image1.Picture.Graphic=nil then exit;
|
||||||
|
|
||||||
|
MJPG:= TJpegImage.Create;
|
||||||
|
try
|
||||||
|
SaveDialog1.FileName:=FileName;
|
||||||
|
if SaveDialog1.Execute then
|
||||||
|
begin
|
||||||
|
if SaveDialog1.FileName<>'' then
|
||||||
|
begin
|
||||||
|
pathFile:=trim(SaveDialog1.FileName);
|
||||||
|
|
||||||
|
IF (RightStr(UPPERCASE(pathFile),4)<>'.JPG') and (RightStr(UPPERCASE(pathFile),5)<>'.JPEG') then
|
||||||
|
begin
|
||||||
|
pathFile:=pathFile+'.JPG';
|
||||||
|
end;
|
||||||
|
MJPG.Assign(Image1.Picture.Graphic);
|
||||||
|
if fileexists(pathFile) then
|
||||||
|
begin
|
||||||
|
if application.MessageBox(pchar('文件['+trim(pathFile)+']已存在,是否要替换它?'),'提示信息',MB_YESNO+mb_iconinformation+MB_DEFBUTTON2)=idyes then
|
||||||
|
MJPG.SaveToFile(pathFile);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
MJPG.SaveToFile(pathFile);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
MJPG.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormGetPic.SpeedButton5Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
|
||||||
|
try
|
||||||
|
with adoqueryImage do
|
||||||
|
begin
|
||||||
|
close;
|
||||||
|
sql.Clear;
|
||||||
|
sql.Add('select * from TP_File where WBID='+quotedstr(trim(fkeyNo)));
|
||||||
|
open;
|
||||||
|
if RecordCount>0 then
|
||||||
|
begin
|
||||||
|
edit;
|
||||||
|
fieldByName(pat1).Value:=null;
|
||||||
|
FieldByName(pic1).Value:=null;
|
||||||
|
post;
|
||||||
|
Image1.Picture.Assign(nil);
|
||||||
|
Image2.Picture.Assign(nil);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
|
@ -331,6 +331,7 @@ object frmClothContractInPut_CG: TfrmClothContractInPut_CG
|
||||||
Default = True
|
Default = True
|
||||||
Kind = bkEllipsis
|
Kind = bkEllipsis
|
||||||
end>
|
end>
|
||||||
|
Properties.ReadOnly = True
|
||||||
Properties.OnButtonClick = JHPlacePropertiesButtonClick
|
Properties.OnButtonClick = JHPlacePropertiesButtonClick
|
||||||
Style.BorderStyle = ebsSingle
|
Style.BorderStyle = ebsSingle
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
|
|
|
@ -851,6 +851,9 @@ begin
|
||||||
Self.Order_Sub.FieldByName('C_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
Self.Order_Sub.FieldByName('C_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
||||||
Self.Order_Sub.FieldByName('C_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
|
Self.Order_Sub.FieldByName('C_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
|
||||||
Self.Order_Sub.FieldByName('C_Color').Value := Trim(CDS_HZ.fieldbyname('DEFstr3').AsString);
|
Self.Order_Sub.FieldByName('C_Color').Value := Trim(CDS_HZ.fieldbyname('DEFstr3').AsString);
|
||||||
|
Self.Order_Sub.FieldByName('C_Spec').Value := Trim(CDS_HZ.fieldbyname('DEFstr4').AsString);
|
||||||
|
Self.Order_Sub.FieldByName('KZQty').Value := Trim(CDS_HZ.fieldbyname('DEFstr2').AsString);
|
||||||
|
Self.Order_Sub.FieldByName('MFQty').Value := Trim(CDS_HZ.fieldbyname('DEFstr1').AsString);
|
||||||
// Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
// Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
||||||
Self.Order_Sub.Post;
|
Self.Order_Sub.Post;
|
||||||
|
|
||||||
|
|
|
@ -639,6 +639,13 @@ object frmClothContractInPut_Tp: TfrmClothContractInPut_Tp
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Width = 80
|
Width = 80
|
||||||
end
|
end
|
||||||
|
object Tv1Column4: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402
|
||||||
|
DataBinding.FieldName = 'gongyi'
|
||||||
|
Visible = False
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object cxGrid1Level1: TcxGridLevel
|
object cxGrid1Level1: TcxGridLevel
|
||||||
GridView = Tv1
|
GridView = Tv1
|
||||||
|
|
|
@ -97,6 +97,7 @@ type
|
||||||
Tv1Column3: TcxGridDBColumn;
|
Tv1Column3: TcxGridDBColumn;
|
||||||
Label13: TLabel;
|
Label13: TLabel;
|
||||||
DYer: TBtnEditC;
|
DYer: TBtnEditC;
|
||||||
|
Tv1Column4: TcxGridDBColumn;
|
||||||
procedure TBCloseClick(Sender: TObject);
|
procedure TBCloseClick(Sender: TObject);
|
||||||
procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||||
procedure Button1Click(Sender: TObject);
|
procedure Button1Click(Sender: TObject);
|
||||||
|
@ -495,6 +496,11 @@ begin
|
||||||
Label13.Visible := True;
|
Label13.Visible := True;
|
||||||
DYer.Visible := True;
|
DYer.Visible := True;
|
||||||
end;
|
end;
|
||||||
|
if Trim(FConType) = '成品后加工' then
|
||||||
|
begin
|
||||||
|
Tv1Column4.Visible := True;
|
||||||
|
// DYer.Visible := True;
|
||||||
|
end;
|
||||||
readCXgrid(self.Caption, tv1);
|
readCXgrid(self.Caption, tv1);
|
||||||
InitData();
|
InitData();
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -60,6 +60,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #26032#22686
|
Caption = #26032#22686
|
||||||
ImageIndex = 3
|
ImageIndex = 3
|
||||||
|
Visible = False
|
||||||
OnClick = TBAddClick
|
OnClick = TBAddClick
|
||||||
end
|
end
|
||||||
object TBEdit: TToolButton
|
object TBEdit: TToolButton
|
||||||
|
@ -77,6 +78,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #21024#38500
|
Caption = #21024#38500
|
||||||
ImageIndex = 17
|
ImageIndex = 17
|
||||||
|
Visible = False
|
||||||
OnClick = TBDelClick
|
OnClick = TBDelClick
|
||||||
end
|
end
|
||||||
object tchk: TToolButton
|
object tchk: TToolButton
|
||||||
|
@ -85,6 +87,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #30830#35748#23436#25104
|
Caption = #30830#35748#23436#25104
|
||||||
ImageIndex = 41
|
ImageIndex = 41
|
||||||
|
Visible = False
|
||||||
OnClick = tchkClick
|
OnClick = tchkClick
|
||||||
end
|
end
|
||||||
object Tnochk: TToolButton
|
object Tnochk: TToolButton
|
||||||
|
@ -94,6 +97,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
Caption = #25764#38144#23436#25104
|
Caption = #25764#38144#23436#25104
|
||||||
Enabled = False
|
Enabled = False
|
||||||
ImageIndex = 56
|
ImageIndex = 56
|
||||||
|
Visible = False
|
||||||
OnClick = TnochkClick
|
OnClick = TnochkClick
|
||||||
end
|
end
|
||||||
object Tth: TToolButton
|
object Tth: TToolButton
|
||||||
|
@ -102,6 +106,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = #36864#36135
|
Caption = #36864#36135
|
||||||
ImageIndex = 129
|
ImageIndex = 129
|
||||||
|
Visible = False
|
||||||
OnClick = TthClick
|
OnClick = TthClick
|
||||||
end
|
end
|
||||||
object ToolButton1: TToolButton
|
object ToolButton1: TToolButton
|
||||||
|
@ -328,11 +333,9 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Kind = skSum
|
Kind = skSum
|
||||||
Column = v1Price
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Kind = skSum
|
Kind = skSum
|
||||||
Column = v1Money
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Kind = skSum
|
Kind = skSum
|
||||||
|
@ -464,7 +467,7 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
end
|
end
|
||||||
object v1PRTOrderQty: TcxGridDBColumn
|
object v1PRTOrderQty: TcxGridDBColumn
|
||||||
Caption = #25968#37327
|
Caption = #25968#37327
|
||||||
DataBinding.FieldName = 'C_Qty'
|
DataBinding.FieldName = 'T_Qty'
|
||||||
HeaderAlignmentHorz = taCenter
|
HeaderAlignmentHorz = taCenter
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
Styles.Content = cxStyle_fontclBlue
|
Styles.Content = cxStyle_fontclBlue
|
||||||
|
@ -480,22 +483,6 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
Styles.Header = DataLink_TradeManage.Default
|
Styles.Header = DataLink_TradeManage.Default
|
||||||
Width = 47
|
Width = 47
|
||||||
end
|
end
|
||||||
object v1Price: TcxGridDBColumn
|
|
||||||
Caption = #21333#20215
|
|
||||||
DataBinding.FieldName = 'Price'
|
|
||||||
HeaderAlignmentHorz = taCenter
|
|
||||||
Options.Editing = False
|
|
||||||
Styles.Header = DataLink_TradeManage.Default
|
|
||||||
Width = 57
|
|
||||||
end
|
|
||||||
object v1Money: TcxGridDBColumn
|
|
||||||
Caption = #24635#20215
|
|
||||||
DataBinding.FieldName = 'Money'
|
|
||||||
HeaderAlignmentHorz = taCenter
|
|
||||||
Options.Editing = False
|
|
||||||
Styles.Header = DataLink_TradeManage.Default
|
|
||||||
Width = 58
|
|
||||||
end
|
|
||||||
object v1Column4: TcxGridDBColumn
|
object v1Column4: TcxGridDBColumn
|
||||||
Caption = #22791#27880
|
Caption = #22791#27880
|
||||||
DataBinding.FieldName = 'C_Note'
|
DataBinding.FieldName = 'C_Note'
|
||||||
|
@ -601,9 +588,10 @@ object frmClothContractList_CK: TfrmClothContractList_CK
|
||||||
Height = 22
|
Height = 22
|
||||||
Align = alTop
|
Align = alTop
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
|
Visible = False
|
||||||
Properties.CustomButtons.Buttons = <>
|
Properties.CustomButtons.Buttons = <>
|
||||||
Properties.Style = 9
|
Properties.Style = 9
|
||||||
Properties.TabIndex = 0
|
Properties.TabIndex = 2
|
||||||
Properties.Tabs.Strings = (
|
Properties.Tabs.Strings = (
|
||||||
#26410#23436#25104
|
#26410#23436#25104
|
||||||
#24050#23436#25104
|
#24050#23436#25104
|
||||||
|
|
|
@ -66,8 +66,6 @@ type
|
||||||
v1PRTKZ: TcxGridDBColumn;
|
v1PRTKZ: TcxGridDBColumn;
|
||||||
v1PRTOrderQty: TcxGridDBColumn;
|
v1PRTOrderQty: TcxGridDBColumn;
|
||||||
v1OrderUnit: TcxGridDBColumn;
|
v1OrderUnit: TcxGridDBColumn;
|
||||||
v1Price: TcxGridDBColumn;
|
|
||||||
v1Money: TcxGridDBColumn;
|
|
||||||
cxGrid1Level1: TcxGridLevel;
|
cxGrid1Level1: TcxGridLevel;
|
||||||
ClientDataSet3: TClientDataSet;
|
ClientDataSet3: TClientDataSet;
|
||||||
DataSource2: TDataSource;
|
DataSource2: TDataSource;
|
||||||
|
@ -198,9 +196,9 @@ begin
|
||||||
sql.Add('exec P_Get_Contract');
|
sql.Add('exec P_Get_Contract');
|
||||||
sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' ');
|
sql.Add('@begdate=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ''' ');
|
||||||
sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' ');
|
sql.Add(',@enddate=''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ''' ');
|
||||||
sql.Add(',@conType=''Ĺ÷˛źľ˝ťő'' ');
|
sql.Add(',@conType=''Ĺ÷˛źłöżâ'' ');
|
||||||
sql.Add(',@status=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
|
sql.Add(',@status=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
|
||||||
// ShowMessage(SQL.text);
|
ShowMessage(SQL.text);
|
||||||
{ sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) ');
|
{ sql.Add('select *,fromConNo=(select Top 1 conNo from Contract_Main X where X.MainID=A.fromMainID) ');
|
||||||
sql.Add('from Contract_Main A');
|
sql.Add('from Contract_Main A');
|
||||||
sql.Add('inner join Contract_sub B on B.MainID=A.mainID ');
|
sql.Add('inner join Contract_sub B on B.MainID=A.mainID ');
|
||||||
|
@ -221,39 +219,39 @@ end;
|
||||||
|
|
||||||
procedure TfrmClothContractList_CK.InitForm();
|
procedure TfrmClothContractList_CK.InitForm();
|
||||||
begin
|
begin
|
||||||
if fDParameters1 = '˛éŃŻ' then
|
// if fDParameters1 = '˛éŃŻ' then
|
||||||
begin
|
// begin
|
||||||
TBADD.Visible := false;
|
// TBADD.Visible := false;
|
||||||
// TBEdit.Visible:=false;
|
// // TBEdit.Visible:=false;
|
||||||
TBDel.Visible := false;
|
// TBDel.Visible := false;
|
||||||
// Tchk.Visible:=false;
|
// // Tchk.Visible:=false;
|
||||||
// TNochk.Visible:=false;
|
// // TNochk.Visible:=false;
|
||||||
Tth.Visible := false;
|
// Tth.Visible := false;
|
||||||
v1Price.Visible := false;
|
// v1Price.Visible := false;
|
||||||
v1Price.Hidden := true;
|
// v1Price.Hidden := true;
|
||||||
v1money.Visible := false;
|
// v1money.Visible := false;
|
||||||
v1money.Hidden := true;
|
// v1money.Hidden := true;
|
||||||
// v1T_money.Visible := false;
|
//// v1T_money.Visible := false;
|
||||||
// v1T_money.Hidden := true;
|
//// v1T_money.Hidden := true;
|
||||||
ToolButton1.Visible := false;
|
// ToolButton1.Visible := false;
|
||||||
end;
|
// end;
|
||||||
|
//
|
||||||
TBEdit.Enabled := false;
|
// TBEdit.Enabled := false;
|
||||||
TBDel.Enabled := false;
|
// TBDel.Enabled := false;
|
||||||
Tchk.Enabled := false;
|
// Tchk.Enabled := false;
|
||||||
TNochk.Enabled := false;
|
// TNochk.Enabled := false;
|
||||||
Tth.Enabled := false;
|
// Tth.Enabled := false;
|
||||||
if cxTabControl1.TabIndex = 0 then
|
// if cxTabControl1.TabIndex = 0 then
|
||||||
begin
|
// begin
|
||||||
// TBEdit.Enabled := true;
|
//// TBEdit.Enabled := true;
|
||||||
TBDel.Enabled := true;
|
// TBDel.Enabled := true;
|
||||||
Tchk.Enabled := true;
|
// Tchk.Enabled := true;
|
||||||
Tth.Enabled := true;
|
// Tth.Enabled := true;
|
||||||
end;
|
// end;
|
||||||
if cxTabControl1.TabIndex = 1 then
|
// if cxTabControl1.TabIndex = 1 then
|
||||||
begin
|
// begin
|
||||||
TNochk.Enabled := true;
|
// TNochk.Enabled := true;
|
||||||
end;
|
// end;
|
||||||
InitGrid();
|
InitGrid();
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -307,10 +305,10 @@ begin
|
||||||
if trim(fDParameters1) = '查询' then
|
if trim(fDParameters1) = '查询' then
|
||||||
begin
|
begin
|
||||||
frmClothContractOutPut.Caption := '到货信息查询';
|
frmClothContractOutPut.Caption := '到货信息查询';
|
||||||
v1Money.Visible := false;
|
// v1Money.Visible := false;
|
||||||
v1Price.Visible := false;
|
// v1Price.Visible := false;
|
||||||
v1Money.Hidden := true;
|
// v1Money.Hidden := true;
|
||||||
v1Price.Hidden := true;
|
// v1Price.Hidden := true;
|
||||||
v1T_money.Visible := false;
|
v1T_money.Visible := false;
|
||||||
v1T_money.Hidden := true;
|
v1T_money.Hidden := true;
|
||||||
v1T_price.Visible := false;
|
v1T_price.Visible := false;
|
||||||
|
@ -501,19 +499,19 @@ begin
|
||||||
if trim(fDParameters1) = '查询' then
|
if trim(fDParameters1) = '查询' then
|
||||||
begin
|
begin
|
||||||
// frmClothContractOutPut.Caption := '到货信息查询';
|
// frmClothContractOutPut.Caption := '到货信息查询';
|
||||||
v1Money.Visible := false;
|
// v1Money.Visible := false;
|
||||||
v1Price.Visible := false;
|
// v1Price.Visible := false;
|
||||||
v1Money.Hidden := true;
|
// v1Money.Hidden := true;
|
||||||
v1Price.Hidden := true;
|
// v1Price.Hidden := true;
|
||||||
v1T_money.Visible := false;
|
v1T_money.Visible := false;
|
||||||
v1T_money.Hidden := true;
|
v1T_money.Hidden := true;
|
||||||
ScrollBox1.Enabled := false;
|
ScrollBox1.Enabled := false;
|
||||||
for i := 0 to tv1.ColumnCount - 2 do
|
for i := 0 to tv1.ColumnCount - 2 do
|
||||||
begin
|
begin
|
||||||
tv1.Columns[i].Options.Editing := false;
|
tv1.Columns[i].Options.Editing := false;
|
||||||
end;
|
end;
|
||||||
// v1Mrate.Options.Editing := true;
|
// v1Mrate.Options.Editing := true;
|
||||||
ToolBar2.Enabled := false;
|
ToolBar2.Enabled := false;
|
||||||
end;
|
end;
|
||||||
PState := 0;
|
PState := 0;
|
||||||
FMainId := '';
|
FMainId := '';
|
||||||
|
|
|
@ -429,7 +429,7 @@ begin
|
||||||
FConType := '´òÑù¼Æ»®';
|
FConType := '´òÑù¼Æ»®';
|
||||||
if ShowModal = 1 then
|
if ShowModal = 1 then
|
||||||
begin
|
begin
|
||||||
TBRafresh.Click;
|
TBRafresh.Click;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
|
|
@ -536,6 +536,12 @@ object frmClothContractList_JG: TfrmClothContractList_JG
|
||||||
Options.Editing = False
|
Options.Editing = False
|
||||||
Width = 80
|
Width = 80
|
||||||
end
|
end
|
||||||
|
object Tv1Column1: TcxGridDBColumn
|
||||||
|
Caption = #24037#33402
|
||||||
|
DataBinding.FieldName = 'gongyi'
|
||||||
|
HeaderAlignmentHorz = taCenter
|
||||||
|
Width = 60
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object cxGrid1Level1: TcxGridLevel
|
object cxGrid1Level1: TcxGridLevel
|
||||||
GridView = Tv1
|
GridView = Tv1
|
||||||
|
|
|
@ -97,6 +97,7 @@ type
|
||||||
v1Column10: TcxGridDBColumn;
|
v1Column10: TcxGridDBColumn;
|
||||||
v1Column11: TcxGridDBColumn;
|
v1Column11: TcxGridDBColumn;
|
||||||
ToolButton1: TToolButton;
|
ToolButton1: TToolButton;
|
||||||
|
Tv1Column1: TcxGridDBColumn;
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
@ -349,9 +350,9 @@ begin
|
||||||
with frmClothContractInPut_Tp do
|
with frmClothContractInPut_Tp do
|
||||||
begin
|
begin
|
||||||
PState := 0;
|
PState := 0;
|
||||||
FMainId := '';
|
FMainId := '';
|
||||||
FConType := '³ÉÆ·ºó¼Ó¹¤';
|
FConType := '³ÉÆ·ºó¼Ó¹¤';
|
||||||
caption := 'ºó¼Ó¹¤';
|
caption := 'ºó¼Ó¹¤';
|
||||||
if ShowModal = 1 then
|
if ShowModal = 1 then
|
||||||
begin
|
begin
|
||||||
TBRafresh.Click;
|
TBRafresh.Click;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user