2119 lines
62 KiB
ObjectPascal
2119 lines
62 KiB
ObjectPascal
|
|
unit U_QCRKInPut_SD;
|
|||
|
|
|
|||
|
|
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, cxGroupBox, cxCheckBox,
|
|||
|
|
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, Menus,IniFiles,ShellAPI;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmQCRKInPut_SD = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
Label34: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
MYCode: TEdit;
|
|||
|
|
CRTime: TDateTimePicker;
|
|||
|
|
MYName: TEdit;
|
|||
|
|
cxGroupBox1: TcxGroupBox;
|
|||
|
|
QtyLRM: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
UnitM: TEdit;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
UnitKg: TEdit;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
MYColor: TEdit;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
MYKZ: TEdit;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
MYMF: TEdit;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
RCGangNo: TEdit;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
QtyLRKg: TEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
MYColorNo: TEdit;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
GangQty: TEdit;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
MXHZPS: TEdit;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
MXHZKGQty: TEdit;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
MYType: TBtnEditA;
|
|||
|
|
BtnDel: TButton;
|
|||
|
|
MLID: TEdit;
|
|||
|
|
BPID: TEdit;
|
|||
|
|
DYID: TEdit;
|
|||
|
|
PTID: TEdit;
|
|||
|
|
KgQtyAvg: TEdit;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
QtyAvg: TEdit;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label21: TLabel;
|
|||
|
|
Label26: TLabel;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
labMYType: TLabel;
|
|||
|
|
MXHZQty: TEdit;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
CDS_Print: TClientDataSet;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
BtnM: TButton;
|
|||
|
|
BtnKg: TButton;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Panel6: TPanel;
|
|||
|
|
Button2: TButton;
|
|||
|
|
Button5: TButton;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
Label33: TLabel;
|
|||
|
|
Note2: TEdit;
|
|||
|
|
Label32: TLabel;
|
|||
|
|
MXNote: TEdit;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
KuWei: TEdit;
|
|||
|
|
GYLXName: TEdit;
|
|||
|
|
Button4: TButton;
|
|||
|
|
Button8: TButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
v1MYCode: TcxGridDBColumn;
|
|||
|
|
v1MYName: TcxGridDBColumn;
|
|||
|
|
v1MXGYLXName: TcxGridDBColumn;
|
|||
|
|
v1Column6: TcxGridDBColumn;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
v1MYColor: TcxGridDBColumn;
|
|||
|
|
v1MYColorNo: TcxGridDBColumn;
|
|||
|
|
v1MYMF: TcxGridDBColumn;
|
|||
|
|
v1MYKZ: TcxGridDBColumn;
|
|||
|
|
v1Column17: TcxGridDBColumn;
|
|||
|
|
v1KuWei: TcxGridDBColumn;
|
|||
|
|
v1MXNote: TcxGridDBColumn;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
Label35: TLabel;
|
|||
|
|
Label36: TLabel;
|
|||
|
|
Label38: TLabel;
|
|||
|
|
Label39: TLabel;
|
|||
|
|
Label40: TLabel;
|
|||
|
|
KgQty1: TEdit;
|
|||
|
|
MQty1: TEdit;
|
|||
|
|
Button6: TButton;
|
|||
|
|
RCGangNO1: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
MXGYLXName: TEdit;
|
|||
|
|
BGY: TButton;
|
|||
|
|
MXKuWeI: TEdit;
|
|||
|
|
Button9: TButton;
|
|||
|
|
Button10: TButton;
|
|||
|
|
Button11: TButton;
|
|||
|
|
MXMYName: TEdit;
|
|||
|
|
Button12: TButton;
|
|||
|
|
MXMYCode: TEdit;
|
|||
|
|
MXMYMF: TEdit;
|
|||
|
|
MXMYKZ: TEdit;
|
|||
|
|
MXMYColor: TEdit;
|
|||
|
|
MXMYColorNo: TEdit;
|
|||
|
|
MXDYID: TEdit;
|
|||
|
|
MXMLID: TEdit;
|
|||
|
|
MXBPID: TEdit;
|
|||
|
|
MXPTID: TEdit;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
RKNo: TEdit;
|
|||
|
|
Label37: TLabel;
|
|||
|
|
MXNote1: TEdit;
|
|||
|
|
N3: TMenuItem;
|
|||
|
|
Image1: TImage;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
SaveDialog1: TSaveDialog;
|
|||
|
|
TPID: TEdit;
|
|||
|
|
adoqueryPicture: TADOQuery;
|
|||
|
|
Image11: TImage;
|
|||
|
|
Panel16: TPanel;
|
|||
|
|
N5: TMenuItem;
|
|||
|
|
N6: TMenuItem;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Label28: TLabel;
|
|||
|
|
Label29: TLabel;
|
|||
|
|
Label30: TLabel;
|
|||
|
|
ComboBox2: TComboBox;
|
|||
|
|
ComboBox1: TComboBox;
|
|||
|
|
BtnPrt: TButton;
|
|||
|
|
BtnQX: TButton;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure ShuiXiSuoLvClick(Sender: TObject);
|
|||
|
|
procedure ShuiXiSuoLvJGMouseDown(Sender: TObject; Button: TMouseButton;
|
|||
|
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure UnitMClick(Sender: TObject);
|
|||
|
|
procedure UnitKgClick(Sender: TObject);
|
|||
|
|
procedure QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure BtnQXClick(Sender: TObject);
|
|||
|
|
procedure MYNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure Button6Click(Sender: TObject);
|
|||
|
|
procedure BtnDelClick(Sender: TObject);
|
|||
|
|
procedure v1Column7PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure BtnPrtClick(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure BtnMClick(Sender: TObject);
|
|||
|
|
procedure BtnKgClick(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
procedure Panel6DblClick(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure Button5Click(Sender: TObject);
|
|||
|
|
procedure Button4Click(Sender: TObject);
|
|||
|
|
procedure UnitMChange(Sender: TObject);
|
|||
|
|
procedure UnitKgChange(Sender: TObject);
|
|||
|
|
procedure KuWeiKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button7Click(Sender: TObject);
|
|||
|
|
procedure MXKuWeIKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button8Click(Sender: TObject);
|
|||
|
|
procedure Button9Click(Sender: TObject);
|
|||
|
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure BGYClick(Sender: TObject);
|
|||
|
|
procedure MenuItem1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure Button10Click(Sender: TObject);
|
|||
|
|
procedure Button11Click(Sender: TObject);
|
|||
|
|
procedure Button12Click(Sender: TObject);
|
|||
|
|
procedure N3Click(Sender: TObject);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure Image1DblClick(Sender: TObject);
|
|||
|
|
procedure N5Click(Sender: TObject);
|
|||
|
|
procedure N6Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
lstPat:TStringList;
|
|||
|
|
FangXiang1:String;
|
|||
|
|
procedure ReadINIFile10();
|
|||
|
|
procedure InitData();
|
|||
|
|
procedure InitMXData();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
procedure GetHZData();
|
|||
|
|
procedure InitColor();
|
|||
|
|
procedure ShowImage();
|
|||
|
|
procedure SaveImage(maxnoWB:String);
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1,FileName:String;
|
|||
|
|
PState,CopyInt:Integer;
|
|||
|
|
FMainId:String;
|
|||
|
|
FRead:String;
|
|||
|
|
FSaveFlag:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmQCRKInPut_SD: TfrmQCRKInPut_SD;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel, U_GYSList,U_SCPerson,U_BPZdy_LRGX_CX,U_ZHCPBigTP
|
|||
|
|
,U_QCRKJLList,U_RSColorBig,U_MLMangeRS_GYCX,U_MLMangeRS_CX,U_RTPTColor,U_ZDYCPName,
|
|||
|
|
U_KuWeiKCList,U_KuWeiList;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmQCRKInPut_SD.ShowImage();
|
|||
|
|
var
|
|||
|
|
jpg:TJpegImage;
|
|||
|
|
myStream: TADOBlobStream;
|
|||
|
|
begin
|
|||
|
|
with adoqueryPicture do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Image_Info A');
|
|||
|
|
sql.Add(' inner join Image_File B on A.IMID=B.IMID');
|
|||
|
|
sql.Add(' and A.WBID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
sql.Add(' and A.Valid=''Y'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if adoqueryPicture.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
FileName:=Trim(adoqueryPicture.fieldbyname('ImagePath').AsString);
|
|||
|
|
jpg:=TJpegImage.Create();
|
|||
|
|
myStream:=tadoblobstream.Create(tblobfield(adoqueryPicture.fieldbyname('ImageFile')),bmread);
|
|||
|
|
jpg.LoadFromStream(myStream);
|
|||
|
|
Image1.Picture.Assign(jpg);
|
|||
|
|
Image1.Width:=adoqueryPicture.fieldbyname('ImageWidth').Value;
|
|||
|
|
Image1.Height:=adoqueryPicture.fieldbyname('ImageHeight').Value;
|
|||
|
|
if Trim(adoqueryPicture.fieldbyname('FangXiang').AsString)='<27><>ֱ' then
|
|||
|
|
begin
|
|||
|
|
Image1.Top:=1;
|
|||
|
|
Image1.Left:=Round((Panel6.Width-Image1.Width)/2);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Image1.Left:=1;
|
|||
|
|
Image1.Top:=Round((Panel6.Height-Image1.Height)/2);
|
|||
|
|
end;
|
|||
|
|
Image1.Visible:=True;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
image1.picture:=nil;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27>ڳ<EFBFBD><DAB3><EFBFBD>ϸ<EFBFBD>ޱ<EFBFBD><DEB1><EFBFBD>¼<EFBFBD><C2BC>',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.InitData();
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.*');
|
|||
|
|
sql.Add(' from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where A.RKNo='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and isnull(A.CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel3,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel2,2);
|
|||
|
|
MYCode.Hint:=Trim(ADOQuery1.fieldbyname('MYCode').AsString);
|
|||
|
|
labMYType.Caption:=Trim(ADOQuery1.fieldbyname('MYType').AsString);
|
|||
|
|
if Trim(labMYType.Caption)='' then
|
|||
|
|
begin
|
|||
|
|
labMYType.Caption:=' ';
|
|||
|
|
end;
|
|||
|
|
if PState=0 then
|
|||
|
|
begin
|
|||
|
|
CRTime.Date:=SGetServerDate(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
InitMXData();
|
|||
|
|
GetHZData();
|
|||
|
|
if Trim(TPID.Text)<>'' then
|
|||
|
|
ShowImage();
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.SaveImage(maxnoWB:string);
|
|||
|
|
var
|
|||
|
|
ImagePath,ImagName,MaxNo,MaxNoFile:String;
|
|||
|
|
AJpeg:TJPEGImage;
|
|||
|
|
myStream:TADOBlobStream;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ImagePath:=Trim(ClientDataSet1.fieldbyname('TPID').AsString);
|
|||
|
|
ImagName:=Trim(ClientDataSet1.fieldbyname('TPID').AsString);
|
|||
|
|
AJpeg:=TJpegImage.Create();
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('UPdate Image_File Set Valid=''N'' ');
|
|||
|
|
sql.Add(' where IMID=(select IMID from Image_Info');
|
|||
|
|
Sql.Add('where WBID='''+Trim(maxnoWB)+''' and Valid=''Y'' )');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('UPdate Image_Info Set Editer='''+Trim(DName)+''',EditerCode='''+Trim(DCode)+''',EditTime=getdate()');
|
|||
|
|
sql.Add(',Valid=''N'' where WBID='''+Trim(maxnoWB)+''' and Valid=''Y'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
if GetLSNo(ADOCmd,MaxNo,'IM','Image_Info',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡͼƬ<CDBC><C6AC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('select * from Image_Info where 1=2');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('IMID').Value:=Trim(MaxNo);
|
|||
|
|
FieldByName('WBID').Value:=Trim(maxnoWB);
|
|||
|
|
FieldByName('ImageName').Value:=Trim(ImagName);
|
|||
|
|
FieldByName('ImagePath').Value:=Trim(MaxNo)+Trim(ImagName);
|
|||
|
|
FieldByName('ImageDate').Value:=SGetServerDate(ADOTemp);
|
|||
|
|
Fieldbyname('ImageType').value:=Trim('YP');
|
|||
|
|
Fieldbyname('Valid').value:=Trim('Y');
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
if GetLSNo(ADOCmd,MaxNoFile,'IF','Image_File',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡͼƬ<CDBC>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select * from Image_File where 1=2');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('IMID').Value:=Trim(MaxNo);
|
|||
|
|
FieldByName('IFID').Value:=Trim(MaxNoFile);
|
|||
|
|
Fieldbyname('Valid').value:=Trim('Y');
|
|||
|
|
FieldByName('ImageWidth').Value:=Image1.Width;
|
|||
|
|
FieldByName('ImageHeight').Value:=Image1.Height;
|
|||
|
|
FieldByName('FangXiang').Value:=FangXiang1;
|
|||
|
|
FieldByName('IFType').Value:='С';
|
|||
|
|
myStream := TADOBlobStream.Create(TBlobField(ADOCmd.FieldByName('ImageFile')), bmWrite);
|
|||
|
|
AJpeg.Assign(Image1.Picture.Graphic);
|
|||
|
|
AJpeg.SaveToStream(myStream);
|
|||
|
|
myStream.Free;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ReadINIFile10();
|
|||
|
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
IdFTP1.Host :=server;//PicSvr;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Put(lstPat[0], 'YP'+'\'+Trim(MaxNo)+Trim(ImagName));
|
|||
|
|
end;
|
|||
|
|
if IdFTP1.Connected then IdFTP1.Quit;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.ReadINIFile10();
|
|||
|
|
var
|
|||
|
|
programIni:Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
|
FileName:string;
|
|||
|
|
begin
|
|||
|
|
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
|||
|
|
programIni:=Tinifile.create(FileName);
|
|||
|
|
server:=programIni.ReadString('SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
programIni.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.InitMXData();
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.*,Laster=isnull(A.Editer,A.Filler) ');
|
|||
|
|
sql.Add(',RCGangNo1=(case when isnull(A.RCGangNo,'''')='''' then A.GangNo else A.RCGangNo end)');
|
|||
|
|
sql.Add(' from CK_MYSC_CR_MX A inner join CK_MYSC_CR B on B.MYID=A.MYID ');
|
|||
|
|
SQL.Add('where isnull(B.RKNo,'''')='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and isnull(B.CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
//ShowMessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTemp,ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOTemp,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.GetHZData();
|
|||
|
|
var
|
|||
|
|
FKG,FM,FPS:String;
|
|||
|
|
begin
|
|||
|
|
FKG:=Tv1.DataController.Summary.FooterSummaryTexts[0];
|
|||
|
|
FM:=Tv1.DataController.Summary.FooterSummaryTexts[1];
|
|||
|
|
FPS:=Tv1.DataController.Summary.FooterSummaryTexts[2];
|
|||
|
|
MXHZPS.Text:=FPS;
|
|||
|
|
MXHZKGQty.Text:=FKG;
|
|||
|
|
MXHZQty.Text:=FM;
|
|||
|
|
if (Trim(FPS)='') or (Trim(FPS)='0') then
|
|||
|
|
begin
|
|||
|
|
SClearData(Panel2,2);
|
|||
|
|
SClearData(Panel2,99);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Avg_JS :KgQty,:MQty,:PS');
|
|||
|
|
if Trim(FKG)<>'' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=FKG;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
if Trim(FM)<>'' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=FM;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
Parameters.ParamByName('PS').Value:=FPS;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
KgQtyAvg.Text:=ADOTemp.fieldbyname('KgQtyAvg').Value;
|
|||
|
|
QtyAvg.Text:=ADOTemp.fieldbyname('QtyAvg').Value;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27>ڳ<EFBFBD><DAB3><EFBFBD>ϸ<EFBFBD>ޱ<EFBFBD><DEB1><EFBFBD>¼<EFBFBD><C2BC>',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
InitData();
|
|||
|
|
QtyLRM.Visible:=True;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmQCRKInPut_SD.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxno,maxmxno,maxnoflag,fsj,FMXID,FRKNo,FCode:String;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
if RKNo.text='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FRKNo,'RK','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
RKNo.text:=Trim(FRKNo);
|
|||
|
|
FMainId:=Trim(FRKNo);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Delete CK_MYSC_CR where RKNo='''+Trim(RKNo.text)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(fieldbyname('MYID').AsString)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'QC','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
maxno:=Trim(fieldbyname('MYID').AsString);
|
|||
|
|
end;
|
|||
|
|
if Trim(FieldByName('MYCode').AsString)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FCode,'W','CK_MYSC_CR',5,0)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FCode:=Trim(FieldByName('MYCode').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR where MYId='''+Trim(maxno)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('EditerCode').Value:=Trim(DCode);
|
|||
|
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYId').Value:=Trim(maxno);
|
|||
|
|
FieldByName('CRType').Value:='<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('MYType').Value:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRQtyFlag').Value:=1;
|
|||
|
|
FieldByName('RKNo').Value:=Trim(RKNo.Text);
|
|||
|
|
FieldByName('CRTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
FieldByName('MYCode').Value:=Trim(FCode);
|
|||
|
|
FieldByName('MYName').Value:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
FieldByName('GYLXName').Value:=Trim(ClientDataSet1.fieldbyname('MXGYLXName').AsString);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
FieldByName('Note').Value:=Trim(ClientDataSet1.fieldbyname('KuWei').AsString);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
FieldByName('DYID').Value:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(ClientDataSet1.fieldbyname('TPID').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('UPdate CK_MYSC_CR Set KHDayCS=isnull((select isnull(max(KHDayCS),0) from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where A.CRTime=CK_MYSC_CR.CRTime and isnull(A.KHName,'''')=isnull(CK_MYSC_CR.KHName,'''') ');
|
|||
|
|
sql.Add(' and isnull(A.CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>''),'''')');
|
|||
|
|
SQL.Add(' where RKNo='''+Trim(RKNo.Text)+''' and isnull(KHName,'''')<>'''' and isnull(CRType,'''')=''<27>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MYID').AsString:=Trim(maxno);
|
|||
|
|
end;
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('TPID').AsString)<>'' then
|
|||
|
|
begin
|
|||
|
|
SaveImage(maxno);
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
i:=1;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if FieldByName('MXID').AsString='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FMXID,'QM','CK_MYSC_CR_MX',5,1)=False then
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FMXID:=Trim(FieldByName('MXID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(FMXID)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if IsEmpty then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MYID').Value:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
FieldByName('MXID').Value:=Trim(FMXID);
|
|||
|
|
FieldByName('JH').Value:=i;
|
|||
|
|
FieldByName('RCGangNo').Value:=ClientDataSet1.fieldbyname('RCGangNo1').Value;
|
|||
|
|
FieldByName('KuWei').Value:=ClientDataSet1.fieldbyname('KuWei').Value;
|
|||
|
|
FieldByName('MXGYLXName').Value:=ClientDataSet1.fieldbyname('MXGYLXName').Value;
|
|||
|
|
FieldByName('MXNote').Value:=ClientDataSet1.fieldbyname('MXNote').Value;
|
|||
|
|
FieldByName('KgQty').Value:=ClientDataSet1.fieldbyname('KgQty').Value;
|
|||
|
|
FieldByName('MQty').Value:=ClientDataSet1.fieldbyname('MQty').Value;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(ClientDataSet1.fieldbyname('TPID').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
i:=i+1;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_GangNo :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MXID').Value:=Trim(FMXID);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_Qty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('TPID').AsString)<>'' then
|
|||
|
|
begin
|
|||
|
|
SaveImage(FMXID);
|
|||
|
|
end;
|
|||
|
|
//Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
InitData();
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
Result:=False;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.TBSaveClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
if Trim(MYName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MYColor.Text)='' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
GetHZData();
|
|||
|
|
if Trim(FSaveFlag)<>'99' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
TBSave.Caption:='<27>ѱ<EFBFBD><D1B1><EFBFBD>';
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.ShuiXiSuoLvClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(TEdit(Sender).Text)='' then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:='<27><>';
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:='';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.ShuiXiSuoLvJGMouseDown(Sender: TObject;
|
|||
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
if Trim(FRead)='' then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).ReadOnly:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).ReadOnly:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.UnitMClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='<27><>';
|
|||
|
|
QtyLRM.Visible:=True;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='';
|
|||
|
|
QtyLRM.Visible:=False;
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.UnitKgClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitKg.Text)='' then
|
|||
|
|
begin
|
|||
|
|
UnitKg.Text:='<27><>';
|
|||
|
|
QtyLRKg.Visible:=True;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitKg.Text:='';
|
|||
|
|
QtyLRKg.Visible:=False;
|
|||
|
|
BtnKg.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRM.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(Self.TPID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRKg.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRKg.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('KgQty').Value:=Trim(QtyLRKg.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(Self.TPID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
QtyLRKg.Text:='';
|
|||
|
|
if Trim(UnitM.Text)<>'' then QtyLRM.SetFocus;
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.BtnQXClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.MYNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(MYType.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
if BtnDel.Visible=False then Exit;
|
|||
|
|
Panel4.Visible:=True;
|
|||
|
|
RCGangNO1.Text:=ClientDataSet1.fieldbyname('RCGangNO1').AsString;
|
|||
|
|
MXGYLXName.Text:=ClientDataSet1.fieldbyname('MXGYLXName').AsString;
|
|||
|
|
MXKuWeI.Text:=ClientDataSet1.fieldbyname('KuWeI').AsString;
|
|||
|
|
Self.MXMYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Self.MXMYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
Self.MXMYMF.Text:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
Self.MXMYKZ.Text:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
Self.MXMYColor.Text:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
Self.MXMYColorNo.Text:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
Self.MXDYID.Text:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
Self.MXMLID.Text:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
Self.MXBPID.Text:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
Self.MXPTID.Text:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
Self.MXNote1.Text:=Trim(ClientDataSet1.fieldbyname('MXNote').AsString);
|
|||
|
|
Panel6.PopupMenu:=PopupMenu1;
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('KgQty').AsString)<>'' then
|
|||
|
|
KgQty1.Text:=ClientDataSet1.fieldbyname('KgQty').Value
|
|||
|
|
else
|
|||
|
|
KgQty1.Text:='';
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('MQty').AsString)<>'' then
|
|||
|
|
MQty1.Text:=ClientDataSet1.fieldbyname('MQty').Value
|
|||
|
|
else
|
|||
|
|
MQty1.Text:='';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button6Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Trim(KgQty1.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(KgQty1.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Trim(MQty1.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(MQty1.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo1.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo1.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(MXGYLXName.Text);
|
|||
|
|
FieldByName('KuWeI').Value:=Trim(MXKuWeI.Text);
|
|||
|
|
if Trim(MQty1.Text)<>'' then
|
|||
|
|
FieldByName('MQty').Value:=Trim(MQty1.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('MQty').Value:=Null;
|
|||
|
|
if Trim(KgQty1.Text)<>'' then
|
|||
|
|
FieldByName('KgQty').Value:=Trim(KgQty1.Text)
|
|||
|
|
else
|
|||
|
|
FieldByName('KgQty').Value:=Null;
|
|||
|
|
FieldByName('Laster').Value:=Trim(DName);
|
|||
|
|
fieldbyname('MXGYLXName').AsString:=MXGYLXName.Text;
|
|||
|
|
fieldbyname('KuWeI').AsString:=MXKuWeI.Text;
|
|||
|
|
fieldbyname('MYCode').AsString:=Trim(Self.MXMYCode.Text);
|
|||
|
|
fieldbyname('MYName').AsString:=Trim(Self.MXMYName.Text);
|
|||
|
|
fieldbyname('MYMF').AsString:=Trim(Self.MXMYMF.Text);
|
|||
|
|
fieldbyname('MYKZ').AsString:=Trim(Self.MXMYKZ.Text);
|
|||
|
|
fieldbyname('MYColor').AsString:=Trim(Self.MXMYColor.Text);
|
|||
|
|
fieldbyname('MYColorNo').AsString:=Trim(Self.MXMYColorNo.Text);
|
|||
|
|
fieldbyname('DYID').AsString:=Trim(Self.MXDYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MXMLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.MXBPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.MXPTID.Text);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(Self.TPID.Text);
|
|||
|
|
fieldbyname('MXNote').AsString:=Trim(Self.MXNote1.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Panel4.Visible:=False;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.BtnDelClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
{with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' insert into CK_MYSC_CR_MX_Log ');
|
|||
|
|
sql.Add(' select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX_Log Set DelTime=getdate(),DelerCode='''+Trim(DCode)+''',Deler='''+Trim(DName)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' Delete CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end; }
|
|||
|
|
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
{if Trim(FMainId)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_Qty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOTemp,Panel2,2);
|
|||
|
|
end;}
|
|||
|
|
//GetHZData();
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.v1Column7PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmQCRKJLList:=TfrmQCRKJLList.Create(Application);
|
|||
|
|
with frmQCRKJLList do
|
|||
|
|
begin
|
|||
|
|
FMXID:=Trim(Self.ClientDataSet1.fieldbyname('MXID').AsString);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmQCRKJLList.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.BtnPrtClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile,Txt,fImagePath:string;
|
|||
|
|
i,j:Integer;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar:TMakebar;
|
|||
|
|
Mixtext:TMixtext;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('GangNo',null,[])=true then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬<EFBFBD>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox2.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox1.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD>ߴ<EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox1.Text='9*7' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ97.rmf';
|
|||
|
|
end else
|
|||
|
|
if ComboBox1.Text='8*5' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ85.rmf';
|
|||
|
|
end;
|
|||
|
|
if FileExists(fPrintFile)=False then
|
|||
|
|
begin
|
|||
|
|
if ComboBox1.Text='9*7' then
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ97.rmf'),'<27><>ʾ',0);
|
|||
|
|
if ComboBox1.Text='8*5' then
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>Ⱦɫ<C8BE><C9AB><EFBFBD>ϱ<EFBFBD>ǩ85.rmf'),'<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' Exec P_PRT_QCRK_RSML :MXID');
|
|||
|
|
Parameters.ParamByName('MXID').Value:=Trim(ClientDataSet1.fieldbyname('MXID').AsString);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTemp,CDS_Print);
|
|||
|
|
SInitCDSData20(ADOTemp,CDS_Print);
|
|||
|
|
try
|
|||
|
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
|||
|
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
|||
|
|
Txt:=Trim(ClientDataSet1.fieldbyname('MXID').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('<27><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=False;
|
|||
|
|
RMVariables['QRBARCODE']:=fImagePath;
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
//RM1.ShowReport;
|
|||
|
|
for i:=1 to StrToInt(ComboBox2.Text) do
|
|||
|
|
begin
|
|||
|
|
RM1.PrintReport;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ComboBox2.ItemIndex:=0;
|
|||
|
|
ComboBox1.ItemIndex:=-1;
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.InitColor();
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from RT_PTColor where PTID='''+Trim(PTID.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
fsj:=Trim(ADOTemp.fieldbyname('ColDaiMa').AsString);
|
|||
|
|
if fsj<>'' then
|
|||
|
|
Panel6.Color:=StrToInt('$'+Trim(fsj));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set RCGangNo='''+Trim(RCGangNO1.Text)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNO1.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNO1.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
TBSave.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
GetHZData();
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.BtnMClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRM.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(Self.TPID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.BtnKgClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRKg.Text)='' then Exit;
|
|||
|
|
if KuWei.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRKg.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
FieldByName('KgQty').Value:=Trim(QtyLRKg.Text);
|
|||
|
|
FieldByName('MXGYLXName').Value:=Trim(GYLXName.Text);
|
|||
|
|
FieldByName('KuWei').Value:=Trim(KuWei.Text);
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYCode').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('MYName').Value:=Trim(MYName.Text);
|
|||
|
|
FieldByName('MYMF').Value:=Trim(MYMF.Text);
|
|||
|
|
FieldByName('MYKZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('MYColorNo').Value:=Trim(MYColorNo.Text);
|
|||
|
|
FieldByName('MYColor').Value:=Trim(MYColor.Text);
|
|||
|
|
FieldByName('DYID').Value:=Trim(DYID.Text);
|
|||
|
|
fieldbyname('MLID').AsString:=Trim(Self.MLID.Text);
|
|||
|
|
fieldbyname('BPID').AsString:=Trim(Self.BPID.Text);
|
|||
|
|
fieldbyname('PTID').AsString:=Trim(Self.PTID.Text);
|
|||
|
|
fieldbyname('TPID').AsString:=Trim(Self.TPID.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
QtyLRKg.Text:='';
|
|||
|
|
if Trim(UnitM.Text)<>'' then QtyLRM.SetFocus;
|
|||
|
|
GetHZData();
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Panel6DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmRSColorBig:=TfrmRSColorBig.Create(Application);
|
|||
|
|
with frmRSColorBig do
|
|||
|
|
begin
|
|||
|
|
frmRSColorBig.Label1.Caption:=Self.MYColorNo.Text+'#';
|
|||
|
|
frmRSColorBig.Label2.Caption:=Self.MYColor.Text;
|
|||
|
|
frmRSColorBig.Color:=Self.Panel6.Color;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button2Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_CX:=TfrmMLMangeRS_CX.create(self);
|
|||
|
|
with frmMLMangeRS_CX do
|
|||
|
|
begin
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
if Self.ClientDataSet1.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
if Self.ClientDataSet1.Locate('GangNo',Null,[])=True then
|
|||
|
|
begin
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
TBSave.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if GetLSNo(ADOCmd,SXMaxno,'SX','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Self.MYCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYCode.Hint:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYType.Text:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
Self.MYName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
Self.MYMF.Text:=Trim(CDS_Main.fieldbyname('MLMF').AsString);
|
|||
|
|
Self.MYKZ.Text:=Trim(CDS_Main.fieldbyname('MLKZ').AsString);
|
|||
|
|
Self.MYColor.Text:=Trim(CDS_Main.fieldbyname('ColNamekh').AsString);
|
|||
|
|
Self.MYColorNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
Self.DYID.Text:=Trim(SXMaxno);
|
|||
|
|
Self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.PTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
Self.GYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
labMYType.Caption:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
if Trim(MYType.Text)='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
MYType.TxtCode:='RS';
|
|||
|
|
end;
|
|||
|
|
Edit1.Text:='';
|
|||
|
|
FDate:=SGetServerDate(ADOTemp);
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MLID='''+Trim(MLID.Text)+'''');
|
|||
|
|
sql.Add(' and BPID='''+Trim(BPID.Text)+'''');
|
|||
|
|
sql.Add(' and PTID='''+Trim(PTID.Text)+'''');
|
|||
|
|
sql.Add(' and CRTime='''+Trim(FormatDateTime('yyyy-MM-dd',FDate))+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FMainId:=Trim(ADOTemp.fieldbyname('MYID').AsString);
|
|||
|
|
InitMXData();
|
|||
|
|
GetHZData();
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRM.SetFocus;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
BtnKg.Visible:=True;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='<27><>';
|
|||
|
|
QtyLRM.Visible:=True;
|
|||
|
|
QtyLRM.SetFocus;
|
|||
|
|
BtnM.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmRTPTColor:=TfrmRTPTColor.Create(Application);
|
|||
|
|
with frmRTPTColor do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.PTID.Text:=Trim(frmRTPTColor.FPTID);
|
|||
|
|
Self.MYColor.Text:=Trim(frmRTPTColor.FColNameKH);
|
|||
|
|
Self.MYColorNo.Text:=Trim(frmRTPTColor.FColName);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmRTPTColor.Free;
|
|||
|
|
end;
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('delete from Image_File where ');
|
|||
|
|
sql.Add('IMID in (select IMID from Image_Info where WBID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+''' and Valid=''Y'')');
|
|||
|
|
sql.Add('delete from Image_Info ');
|
|||
|
|
sql.Add(' where WBID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+''' and Valid=''Y''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
TPID.Text:='';
|
|||
|
|
ShowImage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYCPName:=TfrmZDYCPName.create(self);
|
|||
|
|
with frmZDYCPName do
|
|||
|
|
begin
|
|||
|
|
flag:='MYName';
|
|||
|
|
flagName:='Ʒ<><C6B7>';
|
|||
|
|
V1Code.Visible:=true;
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
MYName.text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
MYCode.text:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button4Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmBPZDY_LRGX_CX:=TfrmBPZDY_LRGX_CX.Create(self);
|
|||
|
|
with frmBPZDY_LRGX_CX do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
GYLXName.Text:=Trim(FZGY);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.UnitMChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if UnitM.Text='<27><>' then
|
|||
|
|
begin
|
|||
|
|
v1Column3.Visible:=true;
|
|||
|
|
Label18.Visible:=true;
|
|||
|
|
MXHZQty.Visible:=true;
|
|||
|
|
Label24.Visible:=true;
|
|||
|
|
MQty1.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
v1Column3.Visible:=false;
|
|||
|
|
Label18.Visible:=false;
|
|||
|
|
MXHZQty.Visible:=false;
|
|||
|
|
Label24.Visible:=false;
|
|||
|
|
MQty1.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.UnitKgChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if UnitKG.Text='<27><>' then
|
|||
|
|
begin
|
|||
|
|
v1Column17.Visible:=true;
|
|||
|
|
label17.Visible:=true;
|
|||
|
|
MXHZKGQty.Visible:=true;
|
|||
|
|
Label23.Visible:=true;
|
|||
|
|
KgQty1.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
v1Column17.Visible:=false;
|
|||
|
|
label17.Visible:=false;
|
|||
|
|
MXHZKGQty.Visible:=false;
|
|||
|
|
Label23.Visible:=false;
|
|||
|
|
KgQty1.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.KuWeiKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' ');
|
|||
|
|
sql.Add(' and KWID='''+trim(KuWei.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
KuWei.Text:=Trim(ADOQuery1.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_GYCX:=TfrmMLMangeRS_GYCX.create(self);
|
|||
|
|
with frmMLMangeRS_GYCX do
|
|||
|
|
begin
|
|||
|
|
MLNo.Text:=Trim(MYCode.Text);
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.MXGYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.MXKuWeIKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(' from KuWei A where KWType=''GG'' and Valid=''Y'' ');
|
|||
|
|
sql.Add(' and KWID='''+trim(MXKuWeI.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
MXKuWeI.Text:=Trim(ADOQuery1.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button8Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmKuWeiList:=TfrmKuWeiList.Create(Self);
|
|||
|
|
with frmKuWeiList do
|
|||
|
|
begin
|
|||
|
|
TBAdd.Visible:=false;
|
|||
|
|
TBDel.Visible:=false;
|
|||
|
|
ToolButton4.Visible:=false;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
KuWei.Text:=Trim(Order_Main.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button9Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmKuWeiList:=TfrmKuWeiList.Create(Self);
|
|||
|
|
with frmKuWeiList do
|
|||
|
|
begin
|
|||
|
|
TBAdd.Visible:=false;
|
|||
|
|
TBDel.Visible:=false;
|
|||
|
|
ToolButton4.Visible:=false;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
MXKuWeI.Text:=Trim(Order_Main.fieldbyname('KWName').AsString);
|
|||
|
|
end;
|
|||
|
|
Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
Self.MYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Self.MYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
Self.MYMF.Text:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
Self.MYKZ.Text:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
Self.MYColor.Text:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
Self.MYColorNo.Text:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
Self.DYID.Text:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
Self.MLID.Text:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
Self.PTID.Text:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
Self.TPID.Text:=Trim(ClientDataSet1.fieldbyname('TPID').AsString);
|
|||
|
|
InitColor();
|
|||
|
|
ShowImage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.BGYClick(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_GYCX:=TfrmMLMangeRS_GYCX.create(self);
|
|||
|
|
with frmMLMangeRS_GYCX do
|
|||
|
|
begin
|
|||
|
|
MLNo.Text:=Trim(MYCode.Text);
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.MXGYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.MenuItem1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,true);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button10Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR where MYID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MYID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR Set MYName='''+Trim(MXMYName.Text)+'''');
|
|||
|
|
sql.Add(' where MYID='''+Trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('MYName').Value:=Trim(MXMYName.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button11Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set KuWeI='''+Trim(MXKuWeI.Text)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('KuWeI').Value:=Trim(MXKuWeI.Text);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
TBSave.Caption:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Button12Click(Sender: TObject);
|
|||
|
|
var FDate:TDateTime;
|
|||
|
|
SXMaxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_CX:=TfrmMLMangeRS_CX.create(self);
|
|||
|
|
with frmMLMangeRS_CX do
|
|||
|
|
begin
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.MXMYCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MXMYName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
Self.MXMYMF.Text:=Trim(CDS_Main.fieldbyname('MLMF').AsString);
|
|||
|
|
Self.MXMYKZ.Text:=Trim(CDS_Main.fieldbyname('MLKZ').AsString);
|
|||
|
|
Self.MXMYColor.Text:=Trim(CDS_Main.fieldbyname('ColNamekh').AsString);
|
|||
|
|
Self.MXMYColorNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
Self.MXDYID.Text:=Trim(SXMaxno);
|
|||
|
|
Self.MXMLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.MXBPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.MXPTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
Self.MXGYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
|
|||
|
|
Self.MYCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYCode.Hint:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
Self.MYType.Text:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
Self.MYName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
Self.MYMF.Text:=Trim(CDS_Main.fieldbyname('MLMF').AsString);
|
|||
|
|
Self.MYKZ.Text:=Trim(CDS_Main.fieldbyname('MLKZ').AsString);
|
|||
|
|
Self.MYColor.Text:=Trim(CDS_Main.fieldbyname('ColNamekh').AsString);
|
|||
|
|
Self.MYColorNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
Self.DYID.Text:=Trim(SXMaxno);
|
|||
|
|
Self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
Self.BPID.Text:=Trim(CDS_Main.fieldbyname('MBPID').AsString);
|
|||
|
|
Self.PTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
Self.GYLXName.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
InitColor();
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.N3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
AJpeg:TJPEGImage;
|
|||
|
|
Bitmap,Bitmap11: TBitmap;
|
|||
|
|
ARect,ARect11: TRect;
|
|||
|
|
TPHeight, AHeightOffset: Integer;
|
|||
|
|
TPWidth, AWidthOffset: Integer;
|
|||
|
|
WZShuiPing,WZChuiZhi:Integer;
|
|||
|
|
WZFlag:String;
|
|||
|
|
FHFStr:String;
|
|||
|
|
begin
|
|||
|
|
lstPat.Clear;
|
|||
|
|
if ODPat.Execute then
|
|||
|
|
begin
|
|||
|
|
lstPat.AddStrings(ODPat.Files);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if lstPat.Count>1 then
|
|||
|
|
begin
|
|||
|
|
lstPat.Clear;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD><EFBFBD>ͼƬ!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end else
|
|||
|
|
if lstPat.Count<1 then
|
|||
|
|
begin
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
AJpeg:=TJpegImage.Create();
|
|||
|
|
AJpeg.LoadFromFile(ExtractFileName(ODPat.FileName));
|
|||
|
|
Image1.Hint:=ExtractFileName(ODPat.FileName);
|
|||
|
|
TPID.Text:=ExtractFileName(ODPat.FileName);
|
|||
|
|
FileName:=Trim(ExtractFileName(ODPat.FileName));
|
|||
|
|
TPWidth:=AJpeg.Width;
|
|||
|
|
TPHeight:=AJpeg.Height;
|
|||
|
|
Bitmap := TBitmap.Create;
|
|||
|
|
Bitmap11 := TBitmap.Create;
|
|||
|
|
Bitmap.Width :=Panel6.Width-2;
|
|||
|
|
Bitmap.Height :=Round(Panel6.Width/TPWidth*TPHeight);
|
|||
|
|
if Bitmap.Height>Panel6.Height then
|
|||
|
|
begin
|
|||
|
|
WZFlag:='<27><>ֱ';
|
|||
|
|
Bitmap.Height:=Panel6.Height-2;
|
|||
|
|
Bitmap.Width :=Round(Panel6.Height/TPHeight*TPWidth);
|
|||
|
|
end;
|
|||
|
|
Bitmap11.Width:=Bitmap.Width*2;
|
|||
|
|
Bitmap11.Height:=Bitmap.Height*2;
|
|||
|
|
Bitmap.Canvas.FillRect(Rect(0, 0, Bitmap.Width, Bitmap.Height));
|
|||
|
|
ARect := Rect(0, 0, Bitmap.Width, Bitmap.Height);
|
|||
|
|
Bitmap.Canvas.StretchDraw(ARect, AJPeg);
|
|||
|
|
Image1.Height:=Bitmap.Height;
|
|||
|
|
Image1.Width:=Bitmap.Width;
|
|||
|
|
Image1.Picture.Assign(BitMap);
|
|||
|
|
if Trim(WZFlag)='<27><>ֱ' then
|
|||
|
|
begin
|
|||
|
|
Image1.Top:=1;
|
|||
|
|
Image1.Left:=Round((Panel6.Width-Image1.Width)/2);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Image1.Left:=1;
|
|||
|
|
Image1.Top:=Round((Panel6.Height-Image1.Height)/2);
|
|||
|
|
end;
|
|||
|
|
FangXiang1:=WZFlag;
|
|||
|
|
Image1.Visible:=True;
|
|||
|
|
Bitmap11.Canvas.FillRect(Rect(0, 0, Bitmap11.Width, Bitmap11.Height));
|
|||
|
|
ARect11 := Rect(0, 0, Bitmap11.Width, Bitmap11.Height);
|
|||
|
|
Bitmap11.Canvas.StretchDraw(ARect11, AJPeg);
|
|||
|
|
Image11.Height:=Bitmap11.Height;
|
|||
|
|
Image11.Width:=Bitmap11.Width;
|
|||
|
|
Image11.Picture.Assign(BitMap11);
|
|||
|
|
PTID.Text:='';
|
|||
|
|
Panel6.Color:=clBtnFace;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
lstPat := TStringList.Create;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.Image1DblClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
FPath,FFName:string;
|
|||
|
|
FInt:integer;
|
|||
|
|
maxno:string;
|
|||
|
|
j,i:Integer;
|
|||
|
|
fPrintFile,fFileName:string;
|
|||
|
|
begin
|
|||
|
|
if TPID.Text='' then exit;
|
|||
|
|
if Application.MessageBox('ԭͼ<D4AD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ȴ<EFBFBD>ʱ<EFBFBD>䣬ȷ<E4A3AC><C8B7>Ҫ<EFBFBD>鿴ԭͼ<D4AD><CDBC><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ReadINIFile10();
|
|||
|
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
IdFTP1:=TIdFTP.Create(self);
|
|||
|
|
IdFTP1.Host :=server;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
IdFTP1.Free;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel16.Visible:=true;
|
|||
|
|
Panel16.Refresh;
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName)+'Photo\';
|
|||
|
|
if not DirectoryExists(ExtractFileDir(FPrintFile)) then
|
|||
|
|
CreateDir(ExtractFileDir(fPrintFile));
|
|||
|
|
FFName:=Trim(FileName);
|
|||
|
|
FFName:=fPrintFile+FFName;
|
|||
|
|
if not FileExists(FFName) then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Get('YP\'+FileName,FFName);
|
|||
|
|
end;
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
IdFTP1.Free;
|
|||
|
|
end;
|
|||
|
|
Panel16.Visible:=false;
|
|||
|
|
ShellExecute(Handle, 'open',PChar(FFName),'', '', SW_SHOWNORMAL);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.N5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
if BtnDel.Visible=False then Exit;
|
|||
|
|
Panel4.Visible:=True;
|
|||
|
|
RCGangNO1.Text:=ClientDataSet1.fieldbyname('RCGangNO1').AsString;
|
|||
|
|
MXGYLXName.Text:=ClientDataSet1.fieldbyname('MXGYLXName').AsString;
|
|||
|
|
MXKuWeI.Text:=ClientDataSet1.fieldbyname('KuWeI').AsString;
|
|||
|
|
Self.MXMYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Self.MXMYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
Self.MXMYMF.Text:=Trim(ClientDataSet1.fieldbyname('MYMF').AsString);
|
|||
|
|
Self.MXMYKZ.Text:=Trim(ClientDataSet1.fieldbyname('MYKZ').AsString);
|
|||
|
|
Self.MXMYColor.Text:=Trim(ClientDataSet1.fieldbyname('MYColor').AsString);
|
|||
|
|
Self.MXMYColorNo.Text:=Trim(ClientDataSet1.fieldbyname('MYColorNo').AsString);
|
|||
|
|
Self.MXDYID.Text:=Trim(ClientDataSet1.fieldbyname('DYID').AsString);
|
|||
|
|
Self.MXMLID.Text:=Trim(ClientDataSet1.fieldbyname('MLID').AsString);
|
|||
|
|
Self.MXBPID.Text:=Trim(ClientDataSet1.fieldbyname('BPID').AsString);
|
|||
|
|
Self.MXPTID.Text:=Trim(ClientDataSet1.fieldbyname('PTID').AsString);
|
|||
|
|
Self.MXNote1.Text:=Trim(ClientDataSet1.fieldbyname('MXNote').AsString);
|
|||
|
|
Panel6.PopupMenu:=PopupMenu1;
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('KgQty').AsString)<>'' then
|
|||
|
|
KgQty1.Text:=ClientDataSet1.fieldbyname('KgQty').Value
|
|||
|
|
else
|
|||
|
|
KgQty1.Text:='';
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('MQty').AsString)<>'' then
|
|||
|
|
MQty1.Text:=ClientDataSet1.fieldbyname('MQty').Value
|
|||
|
|
else
|
|||
|
|
MQty1.Text:='';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmQCRKInPut_SD.N6Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while ClientDataSet1.Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
{with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' insert into CK_MYSC_CR_MX_Log ');
|
|||
|
|
sql.Add(' select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX_Log Set DelTime=getdate(),DelerCode='''+Trim(DCode)+''',Deler='''+Trim(DName)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
sql.Add(' Delete CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end; }
|
|||
|
|
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
{if Trim(FMainId)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_Qty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOTemp,Panel2,2);
|
|||
|
|
end;}
|
|||
|
|
//GetHZData();
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|