434 lines
11 KiB
ObjectPascal
434 lines
11 KiB
ObjectPascal
|
|
unit U_PBSQSMCK;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|||
|
|
cxEdit, DB, cxDBData, StdCtrls, ExtCtrls, ADODB, DBClient,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxGridCustomTableView,
|
|||
|
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
|||
|
|
cxGrid, MovePanel, cxCheckBox, Menus, ComCtrls, BtnEdit, ShellAPI, cxTextEdit;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmPBSQSMCK = class(TForm)
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
DS_MainSel: TDataSource;
|
|||
|
|
CDS_MainSel: TClientDataSet;
|
|||
|
|
cxGridPopupMenu4: TcxGridPopupMenu;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
Tv3: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
v3Column1: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
v3Column2: TcxGridDBColumn;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
CKOrdNo: TEdit;
|
|||
|
|
SMID: TEdit;
|
|||
|
|
Button2: TButton;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
CDS_Main: TClientDataSet;
|
|||
|
|
CRType: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
V2Column1: TcxGridDBColumn;
|
|||
|
|
DS_FHSQ: TDataSource;
|
|||
|
|
CDS_FHSQ: TClientDataSet;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
Button3: TButton;
|
|||
|
|
CDS_DCK: TClientDataSet;
|
|||
|
|
v3Column3: TcxGridDBColumn;
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure SMIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure TV2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
FCKOrdNo, FSMStr, JXFlag, FMainId, FSubId, FIDType: string;
|
|||
|
|
FFHPS, FSQPS: integer;
|
|||
|
|
procedure InitFHMX();
|
|||
|
|
procedure CheckCkd();
|
|||
|
|
procedure CheckPB(MMJID: string);
|
|||
|
|
procedure SaveCK(MMJID: string);
|
|||
|
|
procedure InitFHPS();
|
|||
|
|
public
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmPBSQSMCK: TfrmPBSQSMCK;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_Fun, MMSystem, U_FHSQListSel, U_PBKCListSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.InitFHPS();
|
|||
|
|
begin
|
|||
|
|
with CDS_FHSQ do
|
|||
|
|
begin
|
|||
|
|
Locate('SubId', FSubId, []);
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('FHPS').Value := FFHPS;
|
|||
|
|
|
|||
|
|
Edit1.Text := IntToStr(FFHPS)
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.SaveCK(MMJID: string);
|
|||
|
|
var
|
|||
|
|
maxno, SMFlag, KYCKFlag: string;
|
|||
|
|
FFQty: Integer;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Do_JYCK_MJID ');
|
|||
|
|
sql.Add(' @MJID= ' + Quotedstr(MMJID));
|
|||
|
|
sql.Add(',@CKOrdNo= ' + Quotedstr(CKOrdNo.Text));
|
|||
|
|
sql.Add(',@DName=' + Quotedstr(Trim(DName)));
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
PlaySound('wav\<5C><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.*,B.CRID from WFB_MJJY A');
|
|||
|
|
sql.Add(' inner join CK_banCP_CR B on A.MJID=B.MJID and B.CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' where A. MJID=''' + Trim(MMJID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryTemp, CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryTemp, CDS_Main);
|
|||
|
|
|
|||
|
|
FMainId := Trim(CDS_Main.fieldbyname('MainID').AsString);
|
|||
|
|
FSubId := Trim(CDS_Main.fieldbyname('SubId').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Update_FHSQ @CKOrdNo=' + quotedstr(trim(CKOrdNo.Text)));
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with CDS_MainSel do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Mainid').Value := Self.CDS_Main.fieldbyname('Mainid').Value;
|
|||
|
|
FieldByName('SubID').Value := Self.CDS_Main.fieldbyname('SubID').Value;
|
|||
|
|
FieldByName('MJMaoZ').Value := Self.CDS_Main.fieldbyname('MJMaoZ').Value;
|
|||
|
|
FieldByName('MJLen').Value := Self.CDS_Main.fieldbyname('MJLen').Value;
|
|||
|
|
FieldByName('MJId').Value := Self.CDS_Main.fieldbyname('MJId').Value;
|
|||
|
|
FieldByName('mjxh').Value := Self.CDS_Main.fieldbyname('mjxh').Value;
|
|||
|
|
FieldByName('MJStr4').Value := Self.CDS_Main.fieldbyname('MJStr4').Value;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
FFHPS := FFHPS + 1;
|
|||
|
|
if FIDType <> '<27><><EFBFBD>ⵥ' then
|
|||
|
|
PlaySound('wav\<5C><>ȷ.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.CheckCkd();
|
|||
|
|
begin
|
|||
|
|
if CKOrdNo.Text = Trim(FSMStr) then
|
|||
|
|
exit;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from FHSQ_Main A inner join FHSQ_Sub B on A.FSId=B.FSId where A.FSID=''' + Trim(FSMStr) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
JXFlag := '999';
|
|||
|
|
PlaySound('wav\<5C><><EFBFBD>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
SCreateCDS20(ADOQueryTemp, CDS_FHSQ);
|
|||
|
|
SInitCDSData20(ADOQueryTemp, CDS_FHSQ);
|
|||
|
|
CKOrdNo.Text := Trim(FSMStr);
|
|||
|
|
InitFHMX();
|
|||
|
|
end;
|
|||
|
|
JXFlag := 'ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD>ɹ<EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.CheckPB(MMJID: string);
|
|||
|
|
begin
|
|||
|
|
if Trim(CKOrdNo.Text) = '' then
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\δɨ<CEB4><C9A8><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.SQPS,A.FHPS,B.* from FHSQ_Sub A');
|
|||
|
|
sql.Add(' inner join WFB_MJJY B on A.MainId=B.MainId');
|
|||
|
|
sql.Add(' where A.FSID=''' + Trim(CKOrdNo.Text) + '''');
|
|||
|
|
sql.Add(' and B.MJID=''' + Trim(MMJID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FSQPS := ADOQueryTemp.fieldbyname('SQPS').AsInteger;
|
|||
|
|
FFHPS := ADOQueryTemp.fieldbyname('FHPS').AsInteger;
|
|||
|
|
if FSQPS <= FFHPS then
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select MJID from CK_banCP_CR C ');
|
|||
|
|
sql.Add(' where C.CRFlag=''<27><><EFBFBD><EFBFBD>'' and C.MJID=''' + Trim(MMJID) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select C.CKOrdNo from CK_banCP_CR C ');
|
|||
|
|
sql.Add(' where C.CRFlag=''<27><><EFBFBD><EFBFBD>'' and C.MJID=' + quotedstr(Trim(MMJID)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
if Trim(ADOQueryTemp.fieldbyname('CKOrdNo').AsString) = Trim(CKOrdNo.Text) then
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\<5C><>ɨ<EFBFBD><C9A8>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\<5C>ѳ<EFBFBD><D1B3><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
JXFlag := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmPBSQSMCK := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SMID.SetFocus;
|
|||
|
|
ReadCxGrid('ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', Tv3, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.InitFHMX();
|
|||
|
|
var
|
|||
|
|
MFHPS: integer;
|
|||
|
|
begin
|
|||
|
|
if CDS_FHSQ.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select B.* ');
|
|||
|
|
sql.Add(' from CK_BanCP_CR A');
|
|||
|
|
sql.Add(' inner join WFB_MJJY B on A.MJID=B.MJID');
|
|||
|
|
sql.Add(' where A.CKOrdNO=' + quotedstr(Trim(CKOrdNo.Text)));
|
|||
|
|
sql.Add(' and A.MainId=' + quotedstr(Trim(CDS_FHSQ.FieldByName('MainId').AsString)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryTemp, CDS_MainSel);
|
|||
|
|
SInitCDSData20(ADOQueryTemp, CDS_MainSel);
|
|||
|
|
if CDS_MainSel.IsEmpty = False then
|
|||
|
|
MFHPS := Tv3.DataController.Summary.FooterSummaryValues[2]
|
|||
|
|
else
|
|||
|
|
MFHPS := 0;
|
|||
|
|
|
|||
|
|
Edit1.Text := IntToStr(MFHPS);
|
|||
|
|
with CDS_FHSQ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('FHPS').Value := MFHPS;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.SMIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
JXFlag := '';
|
|||
|
|
FSMStr := Trim(SMID.Text);
|
|||
|
|
SMID.Text := '';
|
|||
|
|
if Copy(FSMStr, 1, 2) = 'CK' then
|
|||
|
|
begin
|
|||
|
|
FIDType := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
CheckCkd()
|
|||
|
|
end
|
|||
|
|
else if Copy(FSMStr, 1, 2) = 'RK' then
|
|||
|
|
begin
|
|||
|
|
FIDType := '<27><><EFBFBD>ⵥ';
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select * from CK_banCP_CR A inner join CK_BanCP_KC B on A.MJID=B.MJID where A.CRFlag=''<27><><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add(' and B.KCValid=''Y'' and A.RKOrdID=' + quotedstr(Trim(FSMStr)));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryTemp, CDS_DCK);
|
|||
|
|
SInitCDSData20(ADOQueryTemp, CDS_DCK);
|
|||
|
|
|
|||
|
|
if CDS_DCK.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
PlaySound('wav\<5C>ѳ<EFBFBD><D1B3><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
with CDS_DCK do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
CheckPB(Trim(CDS_DCK.FieldByName('MJID').AsString));
|
|||
|
|
if JXFlag = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
SaveCK((Trim(CDS_DCK.FieldByName('MJID').AsString)));
|
|||
|
|
InitFHPS();
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
PlaySound('wav\<5C><>ȷ.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FIDType := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
CheckPB(FSMStr);
|
|||
|
|
if JXFlag = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
SaveCK(FSMStr);
|
|||
|
|
InitFHPS();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
WriteCxGrid('ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', Tv3, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.Button1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
MKey: Char;
|
|||
|
|
begin
|
|||
|
|
MKey := #13;
|
|||
|
|
try
|
|||
|
|
frmFHSQListSel := TfrmFHSQListSel.Create(self);
|
|||
|
|
with frmFHSQListSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
SMID.Text := Trim(Order_Main.fieldbyname('FSID').AsString);
|
|||
|
|
SMIDKeyPress(SMID, MKey);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmFHSQListSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.TV2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
InitFHMX();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPBSQSMCK.Button3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
MKey: Char;
|
|||
|
|
begin
|
|||
|
|
MKey := #13;
|
|||
|
|
if TRIM(SELF.CKOrdNo.Text) = '' then
|
|||
|
|
EXIT;
|
|||
|
|
try
|
|||
|
|
frmPBKCListSel := TfrmPBKCListSel.Create(self);
|
|||
|
|
with frmPBKCListSel do
|
|||
|
|
begin
|
|||
|
|
FCKOrdNo := TRIM(SELF.CKOrdNo.Text);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
while frmPBKCListSel.CDS_Main.Locate('SSel', true, []) do
|
|||
|
|
begin
|
|||
|
|
self.SMID.Text := Trim(frmPBKCListSel.CDS_Main.fieldbyname('MJID').AsString);
|
|||
|
|
self.SMIDKeyPress(SMID, MKey);
|
|||
|
|
frmPBKCListSel.CDS_Main.Delete;
|
|||
|
|
sleep(500);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmPBKCListSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|