886 lines
25 KiB
ObjectPascal
886 lines
25 KiB
ObjectPascal
![]() |
unit U_KCRLLTZ;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, strutils,SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
|||
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
|||
|
cxGridCustomView, cxGrid, StdCtrls, cxContainer, cxTextEdit,
|
|||
|
cxCurrencyEdit, BtnEdit, ExtCtrls, ComCtrls, ToolWin, DBClient, ADODB,
|
|||
|
MovePanel, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport,
|
|||
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|||
|
|
|||
|
type
|
|||
|
TfrmKCRLLTZ = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBSave: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
Label1: TLabel;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
v1MJID: TcxGridDBColumn;
|
|||
|
v1P_Code: TcxGridDBColumn;
|
|||
|
v1P_Color: TcxGridDBColumn;
|
|||
|
v1RollNum: TcxGridDBColumn;
|
|||
|
v1Qty: TcxGridDBColumn;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
Panel2: TPanel;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
TV2: TcxGridDBTableView;
|
|||
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
cxGridDBColumn7: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
CDSOrder: TClientDataSet;
|
|||
|
CDSMJID: TClientDataSet;
|
|||
|
DataSource1: TDataSource;
|
|||
|
DataSource2: TDataSource;
|
|||
|
SmNO: TEdit;
|
|||
|
ADOQueryTmp: TADOQuery;
|
|||
|
MovePanel1: TMovePanel;
|
|||
|
Label2: TLabel;
|
|||
|
Edit2: TEdit;
|
|||
|
Button4: TButton;
|
|||
|
V2Column1: TcxGridDBColumn;
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
cxStyle2: TcxStyle;
|
|||
|
cxStyle_gridRow: TcxStyle;
|
|||
|
cxStyle_gridFoot: TcxStyle;
|
|||
|
cxStyle_gridHead: TcxStyle;
|
|||
|
cxStyle_gridGroupBox: TcxStyle;
|
|||
|
cxStyle_yellow: TcxStyle;
|
|||
|
cxStyle_Red: TcxStyle;
|
|||
|
cxStyle_fontBlack: TcxStyle;
|
|||
|
cxStyle_fontclFuchsia: TcxStyle;
|
|||
|
cxStyle_fontclPurple: TcxStyle;
|
|||
|
cxStyle_fontclGreen: TcxStyle;
|
|||
|
cxStyle_fontclBlue: TcxStyle;
|
|||
|
cxStyle_fontclTeal: TcxStyle;
|
|||
|
cxStyle_fontclOlive: TcxStyle;
|
|||
|
CheckBox3: TCheckBox;
|
|||
|
Panel3: TPanel;
|
|||
|
MJLen: TEdit;
|
|||
|
Label5: TLabel;
|
|||
|
Label9: TLabel;
|
|||
|
Edit7: TEdit;
|
|||
|
Label32: TLabel;
|
|||
|
Label33: TLabel;
|
|||
|
Edit8: TEdit;
|
|||
|
Edit6: TEdit;
|
|||
|
Label26: TLabel;
|
|||
|
BTPrint: TButton;
|
|||
|
Button5: TButton;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
RM2: TRMGridReport;
|
|||
|
RMDB_Main: TRMDBDataSet;
|
|||
|
MJQty4: TEdit;
|
|||
|
Label3: TLabel;
|
|||
|
Label4: TLabel;
|
|||
|
MJQty3: TEdit;
|
|||
|
Label6: TLabel;
|
|||
|
Label7: TLabel;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
TV2Column1: TcxGridDBColumn;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
|||
|
procedure FormCreate(Sender: TObject);
|
|||
|
procedure SmNOKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure Button4Click(Sender: TObject);
|
|||
|
procedure Edit7Click(Sender: TObject);
|
|||
|
procedure Edit8Click(Sender: TObject);
|
|||
|
procedure Edit6Click(Sender: TObject);
|
|||
|
procedure BTPrintClick(Sender: TObject);
|
|||
|
procedure Tv1DblClick(Sender: TObject);
|
|||
|
procedure Button5Click(Sender: TObject);
|
|||
|
private
|
|||
|
procedure InitGrid();
|
|||
|
procedure InitMJID();
|
|||
|
function Savedata1():boolean;
|
|||
|
function Savedata2():boolean;
|
|||
|
procedure Printdata(FMJID:string);
|
|||
|
procedure On1301(Var Message:Tmessage);Message 1301;
|
|||
|
procedure CloseCom(DllName:string);
|
|||
|
procedure OpenCom(DllName:string);
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
iscom:boolean;
|
|||
|
isCommopen:boolean;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmKCRLLTZ: TfrmKCRLLTZ;
|
|||
|
newh,newh1:hwnd;
|
|||
|
implementation
|
|||
|
uses
|
|||
|
U_DataLink,U_Fun,U_iniParam, U_ZDYHelp;
|
|||
|
{$R *.dfm}
|
|||
|
procedure TfrmKCRLLTZ.CloseCom(DllName:string);
|
|||
|
type
|
|||
|
TMyFunc = function(sCommName:PAnsiChar): HWND; stdcall;
|
|||
|
var
|
|||
|
Tf1: TMyFunc;
|
|||
|
Tp1: TFarProc;
|
|||
|
Th1:Thandle;
|
|||
|
begin
|
|||
|
Th1 := LoadLibrary(Pchar(trim(DllName)));
|
|||
|
if Th1 > 0 then
|
|||
|
begin
|
|||
|
try
|
|||
|
Tp1 := GetProcAddress(Th1, 'CommClose');
|
|||
|
if Tp1 <> nil then
|
|||
|
begin
|
|||
|
Tf1 := TMyFunc(Tp1);
|
|||
|
newh1:=Tf1('Comm1');
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
finally
|
|||
|
// FreeLibrary(Th1);
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
application.MessageBox(Pchar('<27>Ҳ<EFBFBD><D2B2><EFBFBD> '+trim(DllName)+' <20>ļ<EFBFBD><C4BC><EFBFBD>'),'<27><>ʾ');
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.OpenCom(DllName:string);
|
|||
|
type
|
|||
|
TMyFunc = function(fhandle:hwnd;sCommName:PAnsiChar;
|
|||
|
IntTime:integer;IsMessage:integer): HWND; stdcall;
|
|||
|
var
|
|||
|
Tf:TMyFunc;
|
|||
|
Tp:TFarProc;
|
|||
|
Th:Thandle;
|
|||
|
begin
|
|||
|
// closeCom(FComFile);
|
|||
|
Th := LoadLibrary(Pchar(trim(DllName)));
|
|||
|
if Th > 0 then
|
|||
|
begin
|
|||
|
try
|
|||
|
Tp := GetProcAddress(Th, 'CommOpen');
|
|||
|
if Tp <> nil then
|
|||
|
begin
|
|||
|
Tf := TMyFunc(Tp);
|
|||
|
newh:=Tf(self.Handle,'Comm1',500,1);
|
|||
|
if newh<1 then
|
|||
|
begin
|
|||
|
application.MessageBox(Pchar('<27><EFBFBD><F2BFAAB4><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>'),'<27><>ʾ');
|
|||
|
end
|
|||
|
else
|
|||
|
IsCommOpen:=true;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
IsCommOpen:=false;
|
|||
|
end;
|
|||
|
finally
|
|||
|
// FreeLibrary(Th);
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
IsCommOpen:=false;
|
|||
|
application.MessageBox(Pchar('<27>Ҳ<EFBFBD><D2B2><EFBFBD> '+trim(DllName)+' <20>ļ<EFBFBD><C4BC><EFBFBD>'),'<27><>ʾ');
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.On1301(Var Message:Tmessage);
|
|||
|
var
|
|||
|
i1,i2:integer;
|
|||
|
unitname:string;
|
|||
|
fdata:double;
|
|||
|
begin
|
|||
|
i1:=message.WParam;
|
|||
|
i2:=message.LParam;
|
|||
|
|
|||
|
IF not CheckBox3.Checked then exit;
|
|||
|
|
|||
|
MJLen.Text:= format('%.1f',[i1/100000]);
|
|||
|
|
|||
|
IF i2=0 then Label9.Caption:='M' else Label9.Caption:='Y';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Printdata(FMJID:string);
|
|||
|
var
|
|||
|
fPrintFile:String;
|
|||
|
Txt,fImagePath:string;
|
|||
|
Moudle: THandle;
|
|||
|
Makebar:TMakebar;
|
|||
|
Mixtext:TMixtext;
|
|||
|
begin
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select QtyUnit=A.MJTypeOther,B.orderNo,B.conNo,GangNo=D.RCgangNO,PRTColorEng=E.Note,B.LBName,B.NLBName,D.LsNo ');
|
|||
|
sql.Add(',khConNo=(select top 1 khConNo from JYOrderCon_Main X where X.ConNO=B.conNO) ');
|
|||
|
sql.Add(',MPRTCodeNameEng=ISNULL((select Top 1 F.note from KH_Zdy F where F.zdyname=B.MPRTCodeName and F.Type=''PRTCodeName''),B.MPRTCodeName)');
|
|||
|
sql.Add(',B.MPRTCF,B.MPRTMF,B.MPRTKZ,C.SOrddefstr4,B.MPRTCodeName,B.MPRTSpec,B.MPRTKuanNO,C.*,A.* ');
|
|||
|
sql.Add(',Case when A.MJSJKZ*A.MJFK<>0 then Cast(A.MJQty4*1000/A.MJSJKZ/(A.MJFK/100) as int) else 0 end as MQty');
|
|||
|
sql.Add(' from WFB_MJJY A') ;
|
|||
|
sql.Add(' inner join JYOrder_Main B On A.Mainid=B.Mainid');
|
|||
|
sql.Add(' inner join JYOrder_Sub C on A.SubId=C.SubId');
|
|||
|
sql.Add(' left join KH_Zdy E on C.PRTColor=E.ZdyName and E.Type=''OrdColor'' ');
|
|||
|
sql.Add(' inner join CK_SXPB_CR D on D.SPId=A.APId ');
|
|||
|
SQL.Add(' where A.MJID='''+Trim(FMJID)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
// fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp' ;
|
|||
|
// if FileExists(fImagePath) then DeleteFile(fImagePath);
|
|||
|
// sleep(200);
|
|||
|
try
|
|||
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
|||
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
|||
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
|||
|
Txt:=Trim(ADOQueryPrint.fieldbyname('MJID').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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(ADOQueryPrint.fieldbyname('LBName').AsString)<>'' then
|
|||
|
fPrintFile:=ExtractFilePath(Application.ExeName)+'Report\'+Trim(ADOQueryPrint.fieldbyname('LBName').AsString)+'.rmf'
|
|||
|
else
|
|||
|
fPrintFile:=ExtractFilePath(Application.ExeName)+'Report\ͨ<><CDA8>Ӣ<EFBFBD>ı<EFBFBD>ǩ.rmf' ;
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['QRBARCODE']:=fImagePath;
|
|||
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
Rm2.DefaultCopies:=1;
|
|||
|
RM2.ShowReport;
|
|||
|
// RM2.PrintReport;
|
|||
|
|
|||
|
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\'+Trim(ADOQueryPrint.fieldbyname('LBName').AsString)),'<27><>ʾ',0);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
function TfrmKCRLLTZ.Savedata2():boolean;
|
|||
|
var
|
|||
|
i,FCRID:integer;
|
|||
|
fconNo,FC_CodeName,FC_Color,fMJID:string;
|
|||
|
fRollNum,FQty,fMJQty2,FMJQty3,fMJQty4,FMJQty5,fMJMaoZ:double;
|
|||
|
begin
|
|||
|
result:=false;
|
|||
|
IF CDSOrder.RecordCount<=1 then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ڻ<EFBFBD><DABB>ߵ<EFBFBD><DFB5><EFBFBD>һƥ<D2BB><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD>赽<EFBFBD><E8B5BD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
i:=0;
|
|||
|
{with CDSOrder do
|
|||
|
begin
|
|||
|
DisableControls;
|
|||
|
First;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
if i=0 then
|
|||
|
begin
|
|||
|
// fconNo:= trim(Fieldbyname('ConNo').AsString);
|
|||
|
FC_CodeName:= trim(Fieldbyname('CodeName').AsString);
|
|||
|
FC_Color:= trim(Fieldbyname('C_Color').AsString);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
{ if trim(fconNo)<>trim(Fieldbyname('ConNo').AsString) then
|
|||
|
begin
|
|||
|
EnableControls;
|
|||
|
application.MessageBox('<27><><EFBFBD>Ų<F1B5A5BA>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ܺϲ<DCBA><CFB2><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if trim(FC_CodeName)<>trim(Fieldbyname('C_CodeName').AsString) then
|
|||
|
begin
|
|||
|
EnableControls;
|
|||
|
application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ʋ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ܺϲ<DCBA><CFB2><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
if trim(FC_Color)<>trim(Fieldbyname('C_Color').AsString) then
|
|||
|
begin
|
|||
|
EnableControls;
|
|||
|
application.MessageBox('<27><>ɫ<EFBFBD><C9AB>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ܺϲ<DCBA><CFB2><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
i:=i+1;
|
|||
|
next;
|
|||
|
end;
|
|||
|
EnableControls;
|
|||
|
First;
|
|||
|
end;
|
|||
|
|
|||
|
if i<2 then exit; }
|
|||
|
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
try
|
|||
|
|
|||
|
fRollNum:=0;
|
|||
|
FQty:=0;
|
|||
|
i:=0;
|
|||
|
fMJQty2:=0;
|
|||
|
fMJQty3:=0;
|
|||
|
fMJQty4:=0;
|
|||
|
fMJQty5:=0;
|
|||
|
fmjMaoZ:=0;
|
|||
|
with CDSOrder do
|
|||
|
begin
|
|||
|
DisableControls;
|
|||
|
First;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
// if Fieldbyname('Ssel').AsBoolean then
|
|||
|
// begin
|
|||
|
IF i=0 then
|
|||
|
begin
|
|||
|
fCRID:=Fieldbyname('CRID').AsInteger;
|
|||
|
fMJID:=Fieldbyname('MJID').asstring;
|
|||
|
end;
|
|||
|
|
|||
|
fRollNum:=1;
|
|||
|
FQty:=strtofloatdef(trim(MJLen.Text),0);
|
|||
|
|
|||
|
fMJQty2:=fMJQty2+Fieldbyname('MJQty2').AsFloat;
|
|||
|
fMJQty3:=strtofloatdef(trim(mjQty3.Text),0);
|
|||
|
fMJQty4:=strtofloatdef(trim(mjQty4.Text),0);
|
|||
|
fMJQty5:=fMJQty5+Fieldbyname('MJQty5').AsFloat;
|
|||
|
fmjMaoZ:=fMJQty3+fMJQty4;
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_KC ');
|
|||
|
sql.Add('where CRID='+quotedstr(trim(CDSOrder.Fieldbyname('CRID').AsString)));
|
|||
|
open;
|
|||
|
edit;
|
|||
|
fieldbyname('ZDYstr1').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD>';
|
|||
|
fieldbyname('ZDYFlote1').Value:=fieldbyname('kcQty').AsFloat;
|
|||
|
// fieldbyname('KCROllNum').Value:=0;
|
|||
|
fieldbyname('kcQty').Value:=0;
|
|||
|
fieldbyname('kcKGQty').Value:=0;
|
|||
|
post;
|
|||
|
end;
|
|||
|
i:=i+1;
|
|||
|
//end;
|
|||
|
next;
|
|||
|
end;
|
|||
|
EnableControls;
|
|||
|
First;
|
|||
|
end;
|
|||
|
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_KC ');
|
|||
|
sql.Add('where CRID='+quotedstr(inttostr(fCRID)));
|
|||
|
open;
|
|||
|
edit;
|
|||
|
// fieldbyname('KCROllNum').Value:=1;
|
|||
|
fieldbyname('kcQty').Value:=FQty;
|
|||
|
fieldbyname('kckgQty').Value:=fmjMaoZ;
|
|||
|
post;
|
|||
|
end;
|
|||
|
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY ');
|
|||
|
sql.Add('where MJID='+quotedstr(trim(fMJID)));
|
|||
|
open;
|
|||
|
edit;
|
|||
|
fieldbyname('MJLen').Value:=FQty;
|
|||
|
fieldbyname('MJQty2').Value:=fMJQty2;
|
|||
|
fieldbyname('MJQty3').Value:=fMJQty3;
|
|||
|
fieldbyname('MJQty4').Value:=fMJQty4;
|
|||
|
fieldbyname('MJQty5').Value:=fMJQty5;
|
|||
|
fieldbyname('MJMaoZ').Value:=fMJMaoZ;
|
|||
|
post;
|
|||
|
end;
|
|||
|
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select A.*,D.PRTCodeName,D.PrtColor,C.MJQty2,C.MJQty3,C.MJQty4,C.MJQty5,C.MJMaoZ from CK_BanCP_KC A');
|
|||
|
sql.Add('inner join WFB_MJJY C on C.MJID=A.MJID ');
|
|||
|
sql.Add('inner join JYOrder_sub D on D.MainID=C.MainID and D.subID=C.subID ');
|
|||
|
sql.Add('where CRID='+quotedstr(inttostr(fCRID)));
|
|||
|
open;
|
|||
|
SInitCDSData20(adoqueryCmd,CDSMJID);
|
|||
|
end;
|
|||
|
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
CDSOrder.EmptyDataSet;
|
|||
|
if Trim(Edit6.Text)='<27><>' then
|
|||
|
begin
|
|||
|
|
|||
|
printdata(fMJID);
|
|||
|
end;
|
|||
|
|
|||
|
ModalResult:=1;
|
|||
|
// application.MessageBox('<27><><EFBFBD>ݺϲ<DDBA><CFB2>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
// TBRafresh.Click;
|
|||
|
except
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
// application.MessageBox('<27><><EFBFBD>ݺϲ<DDBA>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmKCRLLTZ.Savedata1():boolean;
|
|||
|
var
|
|||
|
fbcID,FCRID,fAPTM,FMJID,fNewMJID,fnewbcid:string;
|
|||
|
CRID:integer;
|
|||
|
i:integer;
|
|||
|
fKGQty1,fKGQty2:double;
|
|||
|
begin
|
|||
|
result:=false;
|
|||
|
IF CDSOrder.RecordCount>1 then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>һƥ<D2BB><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɨ<EFBFBD>赽<EFBFBD><E8B5BD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
IF strtofloatdef(trim(mjlen.Text),0)>CDSOrder.FieldByName('KCqty').AsFloat then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
if GetLSNo(ADOQueryCmd,fAPTM,'C','APTM',4,1)=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
fbcID:=CDSOrder.fieldbyname('BCID').AsString;
|
|||
|
fcrID:=CDSOrder.fieldbyname('CRID').AsString;
|
|||
|
fMJID:=CDSOrder.fieldbyname('MJID').AsString;
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
try
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD>
|
|||
|
with ADOQueryTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY A');
|
|||
|
sql.Add('where MJID='+quotedstr(trim(CDSOrder.fieldbyname('MJID').asstring)));
|
|||
|
open;
|
|||
|
end;
|
|||
|
if GetLSNo(ADOQueryCmd,fNewMJID,'C','WFB_MJJY',4,1)=False then
|
|||
|
begin
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY A');
|
|||
|
sql.Add('where 1=2 ');
|
|||
|
open;
|
|||
|
end;
|
|||
|
|
|||
|
// fkgQty1:=strtofloat(format('%.1f',[strtofloatdef(MJLen.Text,0)/ADOQueryTmp.fieldbyname('MJlen').AsFloat*ADOQueryTmp.fieldbyname('MJQty4').AsFloat]));
|
|||
|
// fkgQty2:=ADOQueryTmp.fieldbyname('MJQty3').AsFloat+ fkgQty1;
|
|||
|
ADOQueryCmd.Append;
|
|||
|
for i:=0 to ADOQueryCmd.FieldCount-1 do
|
|||
|
begin
|
|||
|
ADOQueryCmd.fields[i].value:=ADOQueryTmp.Fields[i].Value ;
|
|||
|
end;
|
|||
|
ADOQueryCmd.FieldByName('MJID').Value:=fNewMJID;
|
|||
|
ADOQueryCmd.FieldByName('MJLen').Value:=strtofloatdef(MJLen.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('MJQty2').Value:=0;
|
|||
|
ADOQueryCmd.FieldByName('MJQty5').Value:=0;
|
|||
|
ADOQueryCmd.FieldByName('MJQty3').Value:=strtofloatdef(MJQty3.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('MJQty4').Value:=strtofloatdef(MJQty4.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('MJmaoz').Value:=strtofloatdef(MJQty4.Text,0)+strtofloatdef(MJQty3.Text,0);
|
|||
|
// ADOQueryCmd.FieldByName('MJQty4').Value:=fkgQty1;
|
|||
|
// ADOQueryCmd.FieldByName('MJmaoz').Value:=fkgQty2;
|
|||
|
ADOQueryCmd.FieldByName('ZDMJID').Value:=fMJID;
|
|||
|
ADOQueryCmd.Post;
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update WFB_MJJY SET mjxh=1+isnull((select cast (max(mjxh) as int) from WFB_MJJY X where X.subID=WFB_MJJY.subID and X.MJstr4=WFB_MJJY.Mjstr4 and X.MJID<>WFB_MJJY.MJID and X.MJType<>''<27><><EFBFBD><EFBFBD>''),0)');
|
|||
|
sql.Add('where MJID='''+Trim(fNewMJID)+'''');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>¿<EFBFBD><C2BF><EFBFBD>
|
|||
|
with ADOQueryTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_KC A');
|
|||
|
sql.Add('where BCID='+quotedstr(trim(fBCID)));
|
|||
|
sql.Add('and CRID='+quotedstr(trim(fCRID)));
|
|||
|
open;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.add('Update CK_BanCP_CRID Set CRID=CRID+1');
|
|||
|
sql.Add('select * from CK_BanCP_CRID');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
CRID:=ADOQueryCmd.fieldbyname('CRID').AsInteger;
|
|||
|
if GetLSNo(ADOQueryCmd,fNewBCID,'JF','CK_BanCP_CR',4,1)=False then
|
|||
|
begin
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_KC A');
|
|||
|
sql.Add('where 1=2 ');
|
|||
|
open;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Append;
|
|||
|
for i:=0 to ADOQueryCmd.FieldCount-1 do
|
|||
|
begin
|
|||
|
ADOQueryCmd.fields[i].value:=ADOQueryTmp.Fields[i].Value ;
|
|||
|
end;
|
|||
|
ADOQueryCmd.FieldByName('CRID').Value:=CRID;
|
|||
|
ADOQueryCmd.FieldByName('BCID').Value:=fNewBCID;
|
|||
|
// ADOQueryCmd.FieldByName('KCROllNum').Value:=1;
|
|||
|
ADOQueryCmd.FieldByName('KCQty').Value:=strtofloatdef(MJLen.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('KCKGQty').Value:=strtofloatdef(MJQty4.Text,0)+strtofloatdef(MJQty3.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('MJID').Value:=trim(fNewMJID);
|
|||
|
ADOQueryCmd.fieldbyname('ZDYstr1').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
ADOQueryCmd.fieldbyname('ZDYFlote1').Value:= 0;
|
|||
|
ADOQueryCmd.Post;
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
|||
|
with ADOQueryTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_CR A');
|
|||
|
sql.Add('where BCID='+quotedstr(trim(fBCID)));
|
|||
|
// sql.Add('and CRID='+quotedstr(trim(fCRID)));
|
|||
|
open;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_CR A');
|
|||
|
sql.Add('where 1=2 ');
|
|||
|
open;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Append;
|
|||
|
for i:=0 to ADOQueryCmd.FieldCount-1 do
|
|||
|
begin
|
|||
|
ADOQueryCmd.fields[i].value:=ADOQueryTmp.Fields[i].Value ;
|
|||
|
end;
|
|||
|
ADOQueryCmd.FieldByName('CRID').Value:=CRID;
|
|||
|
ADOQueryCmd.FieldByName('BCID').Value:=fNewBCID;
|
|||
|
ADOQueryCmd.FieldByName('CRFlag').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
ADOQueryCmd.FieldByName('Qty').Value:=strtofloatdef(MJLen.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('KGQty').Value:=strtofloatdef(MJQty4.Text,0)+strtofloatdef(MJQty3.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('MJID').Value:=trim(fNewMJID);
|
|||
|
ADOQueryCmd.Post;
|
|||
|
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_KC A');
|
|||
|
sql.Add('where CRID='''+trim(fCRID)+'''');
|
|||
|
open;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Edit;
|
|||
|
// ADOQueryCmd.FieldByName('KCROllNum').Value:=ADOQueryCmd.FieldByName('KCROllNum').AsFloat;
|
|||
|
ADOQueryCmd.FieldByName('KCQty').Value:=ADOQueryCmd.FieldByName('KCQty').AsFloat - strtofloatdef(MJLen.Text,0);
|
|||
|
ADOQueryCmd.FieldByName('KCKGQty').Value:=ADOQueryCmd.FieldByName('KCKGQty').AsFloat - (strtofloatdef(MJQty4.Text,0)+strtofloatdef(MJQty3.Text,0));
|
|||
|
ADOQueryCmd.fieldbyname('ZDYstr1').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
ADOQueryCmd.fieldbyname('ZDYFlote1').Value:= ADOQueryCmd.FieldByName('KCQty').AsFloat;
|
|||
|
ADOQueryCmd.Post;
|
|||
|
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY ');
|
|||
|
sql.Add('where MJID='+quotedstr(trim(fMJID)));
|
|||
|
open;
|
|||
|
edit;
|
|||
|
fieldbyname('MJLen').Value:=fieldbyname('MJLen').AsFloat-strtofloatdef(MJLen.Text,0);
|
|||
|
fieldbyname('MJQty4').Value:=fieldbyname('MJQty4').AsFloat-strtofloatdef(MJQty4.Text,0);
|
|||
|
fieldbyname('MJMaoZ').Value:=fieldbyname('MJMaoZ').AsFloat-strtofloatdef(MJQty4.Text,0)-strtofloatdef(MJQty3.Text,0);
|
|||
|
post;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select A.*,D.PRTCodeName,D.PrtColor,C.MJQty2,C.MJQty3,C.MJQty4,C.MJQty5,C.MJMaoZ from CK_BanCP_KC A');
|
|||
|
sql.Add('inner join WFB_MJJY C on C.MJID=A.MJID ');
|
|||
|
sql.Add('inner join JYOrder_sub D on D.MainID=C.MainID and D.subID=C.subID ');
|
|||
|
sql.Add('where CRID='+quotedstr(inttostr(CRID)));
|
|||
|
open;
|
|||
|
SInitCDSData20(adoqueryCmd,CDSMJID);
|
|||
|
end;
|
|||
|
|
|||
|
with adoqueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select A.*,D.PRTCodeName,D.PrtColor,C.MJQty2,C.MJQty3,C.MJQty4,C.MJQty5,C.MJMaoZ from CK_BanCP_KC A');
|
|||
|
sql.Add('inner join WFB_MJJY C on C.MJID=A.MJID ');
|
|||
|
sql.Add('inner join JYOrder_sub D on D.MainID=C.MainID and D.subID=C.subID');
|
|||
|
sql.Add('where CRID='+quotedstr(fCRID));
|
|||
|
open;
|
|||
|
SInitCDSData20(adoqueryCmd,CDSMJID);
|
|||
|
end;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
// application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
CDSOrder.EmptyDataSet;
|
|||
|
|
|||
|
if Trim(Edit6.Text)='<27><>' then
|
|||
|
begin
|
|||
|
printdata(fNewMJID);
|
|||
|
printdata(fMJID);
|
|||
|
end;
|
|||
|
ModalResult:=1;
|
|||
|
except
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.InitGrid();
|
|||
|
begin
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select A.*,D.PRTCodeName,D.PrtColor,C.MJQty2,C.MJQty3,C.MJQty4,C.MJQty5,C.MJMaoZ from CK_BanCP_KC A');
|
|||
|
sql.Add('inner join WFB_MJJY C on C.MJID=A.MJID ');
|
|||
|
sql.Add('inner join JYOrder_sub D on D.MainID=C.MainID and D.subID=C.subID ');
|
|||
|
SQL.Add('where 1=2 ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,CDSOrder);
|
|||
|
SInitCDSData20(ADOQueryMain,CDSOrder);
|
|||
|
SCreateCDS20(ADOQueryMain,CDSMJID);
|
|||
|
SInitCDSData20(ADOQueryMain,CDSMJID);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.InitMJID();
|
|||
|
var
|
|||
|
fP_No:string;
|
|||
|
begin
|
|||
|
MovePanel1.Visible:=false;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select A.*,D.PRTCodeName,D.PrtColor,C.MJQty2,C.MJQty3,C.MJQty4,C.MJQty5,C.MJMaoZ from CK_BanCP_KC A');
|
|||
|
sql.Add('inner join WFB_MJJY C on C.MJID=A.MJID ');
|
|||
|
sql.Add('inner join JYOrder_sub D on D.MainID=C.MainID and D.SubId=C.SubId ');
|
|||
|
// sql.add('left join CK_BanCP_CR B on B.BCID=A.BCID and B.CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
SQL.Add('where A.MJID='+quotedstr(trim(SmNO.text)));
|
|||
|
sql.Add('and (KCQty>0 or KCKGQty>0) '); //KCQty>0
|
|||
|
// ShowMessage(SQL.text);
|
|||
|
Open;
|
|||
|
if not IsEmpty then
|
|||
|
begin
|
|||
|
IF (Fieldbyname('KCQty').AsFloat<=0) and (Fieldbyname('KCKGQty').AsFloat<=0) then
|
|||
|
begin
|
|||
|
MovePanel1.Visible:=true;
|
|||
|
Edit2.Text:=SmNO.Text;
|
|||
|
Label2.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѳ<EFBFBD><D1B3><EFBFBD>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
SInitCDSData20(ADOQueryMain,CDSOrder);
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
MovePanel1.Visible:=true;
|
|||
|
Edit2.Text:=SmNO.Text;
|
|||
|
Label2.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD>';
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
wRITECxGrid(self.Caption+tV1.Name,Tv1,'<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
wRITECxGrid(self.Caption+TV2.Name,Tv2,'<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
frmKCRLLTZ:=nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.FormClose(Sender: TObject;
|
|||
|
var Action: TCloseAction);
|
|||
|
begin
|
|||
|
if isCommopen then
|
|||
|
begin
|
|||
|
closeCom(JCYDLL);
|
|||
|
end;
|
|||
|
Action:=caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel2.Align:=alClient;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.SmNOKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
IF key=#13 then
|
|||
|
begin
|
|||
|
MovePanel1.Visible:=false;
|
|||
|
if not CDSOrder.Locate('MJID',trim(smNo.Text),[]) then
|
|||
|
initMjid();
|
|||
|
smno.Text:='';
|
|||
|
smno.SetFocus;
|
|||
|
|
|||
|
IF trim(Edit8.Text)='<27><>' then
|
|||
|
begin
|
|||
|
IF not CDSOrder.IsEmpty then
|
|||
|
MJLen.Text:=floattostr(tv1.DataController.Summary.FooterSummaryValues[1]);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
ReadCxGrid(self.Caption+tV1.Name,Tv1,'<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
ReadCxGrid(self.Caption+TV2.Name,Tv2,'<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
MovePanel1.Left:=(Width-MovePanel1.Width) div 2;
|
|||
|
MovePanel1.top:=(Height-MovePanel1.Height-200) div 2;
|
|||
|
InitGrid();
|
|||
|
{ if iscom then
|
|||
|
begin
|
|||
|
if CommOpen(frmKCRLLTZ.Handle,'',500,1)<1 then
|
|||
|
begin
|
|||
|
showmessage('<27><EFBFBD><F2BFAAB4>ڴ<EFBFBD><DAB4><EFBFBD>');
|
|||
|
end;
|
|||
|
end; }
|
|||
|
SmNO.SetFocus;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Button4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
MovePanel1.Visible:=false;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Edit7Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit7.Text)='' then
|
|||
|
begin
|
|||
|
Edit7.Text:='<27><>';
|
|||
|
Edit8.Text:='';
|
|||
|
// Edit9.Text:='';
|
|||
|
end else
|
|||
|
begin
|
|||
|
Edit7.Text:='';
|
|||
|
Edit8.Text:='';
|
|||
|
// Edit9.Text:='';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Edit8Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit8.Text)='' then
|
|||
|
begin
|
|||
|
Edit7.Text:='';
|
|||
|
Edit8.Text:='<27><>';
|
|||
|
// Edit9.Text:='';
|
|||
|
end else
|
|||
|
begin
|
|||
|
Edit7.Text:='';
|
|||
|
Edit8.Text:='';
|
|||
|
// Edit9.Text:='';
|
|||
|
end;
|
|||
|
IF trim(Edit8.Text)='<27><>' then
|
|||
|
begin
|
|||
|
// IF not CDSOrder.IsEmpty then
|
|||
|
// MJLen.Text:=floattostr(tv1.DataController.Summary.FooterSummaryValues[1]);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Edit6Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit6.Text)='' then
|
|||
|
begin
|
|||
|
Edit6.Text:='<27><>';
|
|||
|
end else
|
|||
|
begin
|
|||
|
Edit6.Text:='';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.BTPrintClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit7.Text)='<27><>' then
|
|||
|
begin
|
|||
|
savedata1();
|
|||
|
end;
|
|||
|
if Trim(Edit8.Text)='<27><>' then
|
|||
|
begin
|
|||
|
savedata2();
|
|||
|
end;
|
|||
|
SmNO.SetFocus;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Tv1DblClick(Sender: TObject);
|
|||
|
begin
|
|||
|
IF CDSOrder.IsEmpty then exit;
|
|||
|
CDSOrder.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmKCRLLTZ.Button5Click(Sender: TObject);
|
|||
|
begin
|
|||
|
If CDSMJID.IsEmpty then exit;
|
|||
|
printdata(CDSMJID.fieldbyname('MJID').AsString);
|
|||
|
SmNO.SetFocus;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|