D7wmguihua/桂华管理系统/U_KCRLLTZ.pas
DESKTOP-E401PHE\Administrator b4b5840f18 1
2025-01-18 16:22:10 +08:00

687 lines
18 KiB
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
function CommOpen(fhandle: hwnd; sCommName: PAnsiChar; IntTime: integer; IsMessage: integer): integer; stdcall; external 'JCYData.DLL';
function CommClose(sCommName: PAnsiChar): integer; stdcall; external 'JCYData.DLL';
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;
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(fCRID: string);
procedure On1201(var Message: Tmessage); message 1201;
{ Private declarations }
public
iscom: boolean;
{ Public declarations }
end;
var
frmKCRLLTZ: TfrmKCRLLTZ;
implementation
uses
U_DataLink, U_Fun, U_UserHelp, U_ZDYHelp;
{$R *.dfm}
procedure TfrmKCRLLTZ.On1201(var Message: Tmessage);
var
i1, i2: integer;
unitname: string;
fdata: double;
begin
i1 := Message.WParam;
i2 := Message.LParam;
if not CheckBox3.Checked then
exit;
if trim(DParameters10) = '<27><>С<EFBFBD><D0A1>' then
MJLen.Text := format('%.2f', [i1 / 100000])
else
MJLen.Text := format('%.0f', [i1 / 100000]);
if i2 = 0 then
Label9.Caption := 'M'
else
Label9.Caption := 'Y';
end;
procedure TfrmKCRLLTZ.Printdata(fCRID: string);
var
fPrintFile: string;
mvalue: Double;
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
Mixtext: TMixtext;
begin
with ADOQueryPrint do
begin
Close;
SQL.Clear;
sql.Add('select A.*,kcQty as mjlen,kcQtyUnit as MJTypeother,C_CodeNameZW=(select Top 1 defnote3 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and Type=''CP'') ');
sql.Add(',C_colorName=(select Top 1 DEFstr6 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and X.DEFstr3=A.C_Color and Type=''CP'') ');
sql.Add(' from CK_BanCP_KC A');
//SQL.Add(' where A.MJID='''+Trim(CDS_Main.fieldbyname('MJID').AsString)+'''');
SQL.Add(' where A.CRID=' + quotedstr(trim(fCRID)));
Open;
end;
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;
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͨ<>ñ<EFBFBD>ǩ.rmf';
if FileExists(fPrintFile) then
begin
RMVariables['QRBARCODE'] := fImagePath;
RM2.LoadFromFile(fPrintFile);
// RM2.ShowReport;
RM2.PrintReport;
// MJLen.SetFocus;
end
else
begin
Application.MessageBox(PChar(<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ǩ.rmf'), '<27><>ʾ', 0);
end;
end;
function TfrmKCRLLTZ.Savedata2(): boolean;
var
i, FCRID: integer;
fconNo, FC_CodeName, FC_Color: string;
fRollNum, FQty: 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
with ADOQueryMain do
begin
Close;
sql.Clear;
SQL.Add('select A.* from CK_BanCP_KC A');
SQL.Add('where A.MJID=''' + CDSOrder.Fieldbyname('MJID').AsString + '''');
sql.Add('and isnull(A.KCStatus,''0'')=''0'' ');
sql.Add('and KCQty>0 ');
Open;
if not IsEmpty then
begin
if Fieldbyname('BHFlag').AsBoolean = True then
begin
// MovePanel1.Visible := true;
// Edit2.Text := CDSOrder.Fieldbyname('MJID').AsString;
// Label2.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѱ<EFBFBD><D1B1><EFBFBD>';
CDSOrder.EnableControls;
application.MessageBox(PChar(CDSOrder.Fieldbyname('MJID').AsString+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD><EFBFBD>'), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
exit;
end;
end;
end;
if i = 0 then
begin
// fconNo:= trim(Fieldbyname('ConNo').AsString);
FC_CodeName := trim(Fieldbyname('C_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;
with CDSOrder do
begin
DisableControls;
First;
while not eof do
begin
// if Fieldbyname('Ssel').AsBoolean then
// begin
if i = 0 then
FCRID := Fieldbyname('CRID').AsInteger;
fRollNum := 1;
FQty := strtofloatdef(trim(MJLen.Text), 0);
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('oldCRID').Value := FCRID;
fieldbyname('KCROllNum').Value := 0;
fieldbyname('kcQty').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;
post;
end;
with adoqueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from CK_BanCP_KC ');
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(inttostr(FCRID));
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: string;
CRID: integer;
i: integer;
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;
ADOQueryCmd.Connection.BeginTrans;
try
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;
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('KCROllNum').Value := 1;
ADOQueryCmd.FieldByName('KCQty').Value := strtofloatdef(MJLen.Text, 0);
ADOQueryCmd.FieldByName('oldCRID').Value := FCRID;
ADOQueryCmd.FieldByName('KCStatus').Value := NULL;
ADOQueryCmd.FieldByName('MJID').Value := trim(fAPTM);
ADOQueryCmd.fieldbyname('ZDYstr1').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
ADOQueryCmd.fieldbyname('ZDYFlote1').Value := 0;
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 - 1;
ADOQueryCmd.FieldByName('KCQty').Value := ADOQueryCmd.FieldByName('KCQty').AsFloat - strtofloatdef(MJLen.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('UPDATE CK_BanCp_KC SET KCRollNum =1 ');
sql.Add('WHERE (KCQty<>0 or KCKgQty<>0)and KcRollNum=0 ');
ExecSQL;
end;
with adoqueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from CK_BanCP_KC ');
sql.Add('where CRID=' + quotedstr(inttostr(CRID)));
open;
SInitCDSData20(adoqueryCmd, CDSMJID);
end;
with adoqueryCmd do
begin
close;
sql.Clear;
sql.Add('select * from CK_BanCP_KC ');
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(inttostr(CRID));
printdata(FCRID);
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 * from CK_BanCP_KC A');
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.* from CK_BanCP_KC A');
// 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 isnull(A.KCStatus,''0'')=''0'' ');
sql.Add('and KCQty>0 ');
Open;
if not IsEmpty then
begin
if Fieldbyname('KCQty').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 iscom then
CommClose(pchar('com2'));
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('CRID').AsString);
SmNO.SetFocus;
end;
end.