448 lines
12 KiB
ObjectPascal
448 lines
12 KiB
ObjectPascal
![]() |
unit U_THSQSMTH;
|
|||
|
|
|||
|
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,
|
|||
|
RM_Common, RM_Class, RM_GridReport, RM_System, RM_Dataset, RM_e_Xls,
|
|||
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|||
|
type
|
|||
|
TfrmTHSQSMTH = class(TForm)
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
DS_MainSel: TDataSource;
|
|||
|
CDS_MainSel: TClientDataSet;
|
|||
|
cxGridPopupMenu4: TcxGridPopupMenu;
|
|||
|
Panel2: TPanel;
|
|||
|
Label5: TLabel;
|
|||
|
Label4: TLabel;
|
|||
|
Label9: TLabel;
|
|||
|
TCPiQty: TEdit;
|
|||
|
RKOrdID: TEdit;
|
|||
|
BaoID: TEdit;
|
|||
|
CRTime: TDateTimePicker;
|
|||
|
CustomerNoName: TEdit;
|
|||
|
Button2: TButton;
|
|||
|
Label8: TLabel;
|
|||
|
cpname: TEdit;
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
Label2: TLabel;
|
|||
|
Edit1: TEdit;
|
|||
|
Label12: TLabel;
|
|||
|
CDS_Main: TClientDataSet;
|
|||
|
Button1: TButton;
|
|||
|
Label1: TLabel;
|
|||
|
orderNo: TEdit;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
RMDBMX: TRMDBDataSet;
|
|||
|
RM1: TRMGridReport;
|
|||
|
CDS_JuanPRT: TClientDataSet;
|
|||
|
Label10: TLabel;
|
|||
|
edtIsSMTH: TEdit;
|
|||
|
lbl2: TLabel;
|
|||
|
Panel1: TPanel;
|
|||
|
cxGrid3: TcxGrid;
|
|||
|
Tv3: TcxGridDBTableView;
|
|||
|
cv3Column3: TcxGridDBColumn;
|
|||
|
VC_MJXH: TcxGridDBColumn;
|
|||
|
v3Column1: TcxGridDBColumn;
|
|||
|
v3Column2: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
Tv3Column1: TcxGridDBColumn;
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure BaoIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure Button2Click(Sender: TObject);
|
|||
|
procedure edtIsSMTHClick(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
private
|
|||
|
{ Private declarations }
|
|||
|
FRKOrdID, FSMStr, JXFlag, CZZT, fcuowu: string;
|
|||
|
procedure TMPanDuan();
|
|||
|
procedure InitCKGrid();
|
|||
|
public
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmTHSQSMTH: TfrmTHSQSMTH;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_Fun, U_RTFun, MMSystem, U_FHSQListSel, U_CKProductBCPKCListSel,
|
|||
|
U_TCSQXZ;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmTHSQSMTH := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
BaoID.SetFocus;
|
|||
|
ReadCxGrid('ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', Tv3, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
CRTime.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.TMPanDuan();
|
|||
|
begin
|
|||
|
//<2F>ж<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD> <20><><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD><DFB8><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
JXFlag := '';
|
|||
|
|
|||
|
if Copy(FSMStr, 1, 2) = 'TC' then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from Order_TC A where A.MainId=''' + Trim(FSMStr) + '''');
|
|||
|
SQL.Add('AND ISNULL(STATUS,''0'')=''3''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryTemp.IsEmpty then
|
|||
|
begin
|
|||
|
JXFlag := '999';
|
|||
|
PlaySound('wav\<5C>˲ֵ<CBB2><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(RKOrdID.Text) <> '' then
|
|||
|
begin
|
|||
|
FRKOrdID := Trim(RKOrdID.Text);
|
|||
|
end;
|
|||
|
RKOrdID.Text := Trim(FSMStr);
|
|||
|
if FSMStr <> FRKOrdID then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*');
|
|||
|
sql.Add(' from CK_BanCP_CR A');
|
|||
|
sql.Add(' inner join WFB_MJJY B on A.MJID=B.MJID');
|
|||
|
sql.Add(' where A.CRFLAG=''<27><><EFBFBD><EFBFBD>'' and A.RKOrdID=''' + Trim(RKOrdID.Text) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryTemp, CDS_MainSel);
|
|||
|
SInitCDSData20(ADOQueryTemp, CDS_MainSel);
|
|||
|
if CDS_MainSel.IsEmpty = False then
|
|||
|
Edit1.Text := floatToStr(Tv3.DataController.Summary.FooterSummaryValues[2])
|
|||
|
else
|
|||
|
Edit1.Text := '0';
|
|||
|
end;
|
|||
|
BaoID.Text := '';
|
|||
|
JXFlag := '888';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY A ');
|
|||
|
sql.Add('where A.MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryTemp.IsEmpty then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.APID from WFB_MJJY A ');
|
|||
|
sql.Add('where A.MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
// ShowMessage(sql.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryTemp.IsEmpty then
|
|||
|
begin
|
|||
|
JXFlag := '999';
|
|||
|
PlaySound('wav\δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
Exit;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
JXFlag := '999';
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ȷ!', '<27><>ʾ', 0);
|
|||
|
PlaySound('wav\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(RKOrdID.Text) = '' then
|
|||
|
begin
|
|||
|
JXFlag := '999';
|
|||
|
PlaySound('wav\δɨ<CEB4><C9A8><EFBFBD>˲ֵ<CBB2>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_CR A ');
|
|||
|
sql.Add('where A.CRFlag=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and A.MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if not ADOQueryTemp.IsEmpty then
|
|||
|
begin
|
|||
|
JXFlag := '999';
|
|||
|
PlaySound('wav\<5C><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.CKOrdNo from CK_BanCP_CR A ');
|
|||
|
sql.Add('where A.MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
sql.Add('and A.RKOrdID=' + quotedstr(Trim(FRKOrdID)));
|
|||
|
sql.Add('and A.CRFlag=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if not ADOQueryTemp.IsEmpty then
|
|||
|
begin
|
|||
|
|
|||
|
JXFlag := '999';
|
|||
|
PlaySound('wav\<5C><>ɨ<EFBFBD><C9A8>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
//
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select count(*)gs from CK_BanCP_kc A ');
|
|||
|
sql.Add('where A.MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
sql.Add('and EXISTS(select subid from ORDER_TC_MX b where b.PRTCODE=a.C_CODE and b.PRTCOLOR=a.C_COLOR and b.MAINID=' + quotedstr(Trim(RKOrdID.Text)));
|
|||
|
|
|||
|
SQL.Add(')');
|
|||
|
// ShowMessage(SQL.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryTemp.fieldbyname('gs').AsString = '0' then
|
|||
|
begin
|
|||
|
|
|||
|
JXFlag := '999';
|
|||
|
Application.MessageBox('<27>ò<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>ڸ<EFBFBD><DAB8>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_CR A ');
|
|||
|
sql.Add('where A.MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
sql.Add('and ISNowCycle=1 and A.CRFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryTemp, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryTemp, CDS_Main);
|
|||
|
|
|||
|
end;
|
|||
|
//<2F>ж<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD> <20><><EFBFBD>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>Ѿ<EFBFBD>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD><DFB8><EFBFBD><EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD> FHDate
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.BaoIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
var
|
|||
|
maxno, SMFlag, KYCKFlag, FMainId, ff: string;
|
|||
|
FFQty: Integer;
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
FSMStr := Trim(BaoID.Text);
|
|||
|
|
|||
|
if edtIsSMTH.Text = '' then
|
|||
|
begin
|
|||
|
|
|||
|
TMPanDuan();
|
|||
|
if Trim(JXFlag) = '999' then
|
|||
|
begin
|
|||
|
BaoID.Text := '';
|
|||
|
fcuowu := '<27><><EFBFBD><EFBFBD>';
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(JXFlag) = '888' then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.* ');
|
|||
|
sql.Add(' from Order_TC A');
|
|||
|
sql.Add(' where A.MainId=''' + Trim(RKOrdID.Text) + ''' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
SCSHDataNew(ADOQueryTemp, Panel2, 2);
|
|||
|
InitCKGrid();
|
|||
|
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' exec P_CPCK_Insert_TCRK ');
|
|||
|
sql.add(' @RKOrdID=' + quotedstr(Trim(RKOrdID.Text)));
|
|||
|
sql.add(',@DName=' + quotedstr(DName));
|
|||
|
sql.Add(',@MJID=' + quotedstr(Trim(FSMStr)));
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
|
|||
|
// FMainId := Trim(CDS_Main.fieldbyname('MainID').AsString);
|
|||
|
// with ADOQueryCmd do
|
|||
|
// begin
|
|||
|
// Close;
|
|||
|
// sql.Clear;
|
|||
|
// sql.Add('exec P_Do_FHSQ ''' + Trim(CKOrdNo.Text) + '''');
|
|||
|
// ExecSQL;
|
|||
|
// end;
|
|||
|
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
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('KGQty').Value := Self.CDS_Main.fieldbyname('KGQty').Value;
|
|||
|
FieldByName('MJId').Value := Self.CDS_Main.fieldbyname('MJId').Value;
|
|||
|
FieldByName('MJXH').Value := Self.CDS_Main.fieldbyname('MJXH').Value;
|
|||
|
FieldByName('ganghao').Value := Self.CDS_Main.fieldbyname('ganghao').Value;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
|
|||
|
BaoID.Text := '';
|
|||
|
PlaySound('wav\<5C><>ȷ.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
|||
|
except
|
|||
|
BaoID.Text := '';
|
|||
|
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;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
if not CDS_MainSel.Locate('MJID', FSMStr, []) then
|
|||
|
Exit;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
//<2F>жϷ<D0B6><CFB7><EFBFBD>ƥ<EFBFBD><C6A5> CDS_MainSel
|
|||
|
// if CDS_MainSel.IsEmpty = False then
|
|||
|
// Edit1.Text := IntToStr(Tv3.DataController.Summary.FooterSummaryValues[2])
|
|||
|
// else
|
|||
|
// Edit1.Text := '0';
|
|||
|
if CDS_MainSel.IsEmpty = False then
|
|||
|
Edit1.Text := floatToStr(Tv3.DataController.Summary.FooterSummaryValues[2])
|
|||
|
else
|
|||
|
Edit1.Text := '0';
|
|||
|
|
|||
|
// with ADOQueryTemp do
|
|||
|
// begin
|
|||
|
// Close;
|
|||
|
// sql.Clear;
|
|||
|
// sql.Add(' select COUNT(*) fhjs from CK_BanCP_CR where CKOrdNo= ''' + Trim(CKOrdNo.Text) + '''');
|
|||
|
// Open;
|
|||
|
// end;
|
|||
|
// ff := Format('%.2f', [StrToFloat(Edit1.Text)]);
|
|||
|
// with ADOQueryTemp do
|
|||
|
// begin
|
|||
|
// Close;
|
|||
|
// sql.Clear;
|
|||
|
// sql.Add(' select sum(KGQTY) FMJMaoZ from CK_BanCP_CR where CKOrdNo= ''' + Trim(CKOrdNo.Text) + '''');
|
|||
|
// Open;
|
|||
|
// end;
|
|||
|
// if StrToFloat(Edit1.Text) <> ADOQueryTemp.FieldByName('FMJMaoZ').AsFloat then //asfloat
|
|||
|
// if Tv3.DataController.Summary.FooterSummaryValues[3] <> ADOQueryTemp.FieldByName('FMJMaoZ').AsFloat then
|
|||
|
// begin
|
|||
|
// PlaySound('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5>', '<27><>ʾ', 0);
|
|||
|
// end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.Button2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
WriteCxGrid('ɨ<><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', Tv3, '<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.edtIsSMTHClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(edtIsSMTH.Text) = '' then
|
|||
|
edtIsSMTH.Text := '<27><>'
|
|||
|
else
|
|||
|
edtIsSMTH.Text := '';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.InitCKGrid();
|
|||
|
begin
|
|||
|
if RKOrdID.Text <> '' then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*, B.MJMaoZ,B.MJStr4,B.MJXH,B.MJID,C.PRTColor');
|
|||
|
sql.Add(' from CK_BanCP_CR A');
|
|||
|
sql.Add(' inner join WFB_MJJY B on A.MJID=B.MJID');
|
|||
|
SQL.Add(' inner join JYOrder_Sub C ON B.SUBID=C.SubId');
|
|||
|
sql.Add(' where A.CRFlag=''<27><><EFBFBD><EFBFBD>'' and A.RKOrdID=''' + Trim(RKOrdID.Text) + '''');
|
|||
|
// ShowMessage(SQL.Text);
|
|||
|
Open;
|
|||
|
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryTemp, CDS_MainSel);
|
|||
|
SInitCDSData20(ADOQueryTemp, CDS_MainSel);
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmTHSQSMTH.Button1Click(Sender: TObject);
|
|||
|
var
|
|||
|
MKey: Char;
|
|||
|
begin
|
|||
|
MKey := #13;
|
|||
|
try
|
|||
|
frmTCSQXZ := TfrmTCSQXZ.Create(self);
|
|||
|
with frmTCSQXZ do
|
|||
|
begin
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
BaoID.Text := Trim(Order_Main.fieldbyname('TCNO').AsString);
|
|||
|
BaoIDKeyPress(BaoID, MKey);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmTCSQXZ.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|