1572 lines
42 KiB
ObjectPascal
1572 lines
42 KiB
ObjectPascal
|
|
unit U_LLRKList;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
|||
|
|
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
|
|||
|
|
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|||
|
|
cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
|
|||
|
|
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, cxButtonEdit,
|
|||
|
|
cxDropDownEdit, cxPC, Buttons, cxContainer, cxGroupBox, IdBaseComponent,
|
|||
|
|
IdComponent, IdTCPConnection, IdTCPClient, IdFTP, ShellAPI, ImgList, StrUtils,
|
|||
|
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmLLRKList = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBFind: TToolButton;
|
|||
|
|
TBAdd: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
TBExport: TToolButton;
|
|||
|
|
Order_Main: TClientDataSet;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
Label34: TLabel;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
v1Column9: TcxGridDBColumn;
|
|||
|
|
KHName: TEdit;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDBMain: TRMDBDataSet;
|
|||
|
|
RMXLSExport2: TRMXLSExport;
|
|||
|
|
CDS_PRT: TClientDataSet;
|
|||
|
|
v1Column17: TcxGridDBColumn;
|
|||
|
|
v1Column5: TcxGridDBColumn;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
MYName: TEdit;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
v1Column2: TcxGridDBColumn;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Note: TEdit;
|
|||
|
|
v1MYColor: TcxGridDBColumn;
|
|||
|
|
v1Column6: TcxGridDBColumn;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
MYColor: TEdit;
|
|||
|
|
labMYType: TLabel;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
SpeedButton1: TSpeedButton;
|
|||
|
|
SpeedButton2: TSpeedButton;
|
|||
|
|
SpeedButton3: TSpeedButton;
|
|||
|
|
SpeedButton4: TSpeedButton;
|
|||
|
|
SpeedButton5: TSpeedButton;
|
|||
|
|
Image2: TImage;
|
|||
|
|
v1MYType: TcxGridDBColumn;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
MYType: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
SpeedButton6: TSpeedButton;
|
|||
|
|
SpeedButton7: TSpeedButton;
|
|||
|
|
SpeedButton8: TSpeedButton;
|
|||
|
|
SpeedButton9: TSpeedButton;
|
|||
|
|
SpeedButton10: TSpeedButton;
|
|||
|
|
Image1: TImage;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
JCDanWei: TEdit;
|
|||
|
|
v1HWType: TcxGridDBColumn;
|
|||
|
|
N3: TMenuItem;
|
|||
|
|
v1MXHZPS: TcxGridDBColumn;
|
|||
|
|
v1MXHZKgQty: TcxGridDBColumn;
|
|||
|
|
v1MXHZQty: TcxGridDBColumn;
|
|||
|
|
N4: TMenuItem;
|
|||
|
|
v1JCDanWei: TcxGridDBColumn;
|
|||
|
|
cxGroupBox2: TcxGroupBox;
|
|||
|
|
Image3: TImage;
|
|||
|
|
ListView1: TListView;
|
|||
|
|
Panel12: TPanel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Button4: TButton;
|
|||
|
|
Panel13: TPanel;
|
|||
|
|
Image4: TImage;
|
|||
|
|
WJName: TEdit;
|
|||
|
|
Button7: TButton;
|
|||
|
|
WJPach: TEdit;
|
|||
|
|
Button8: TButton;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
N5: TMenuItem;
|
|||
|
|
v1IFFZ: TcxGridDBColumn;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
MenuItem2: TMenuItem;
|
|||
|
|
MenuItem3: TMenuItem;
|
|||
|
|
MenuItem4: TMenuItem;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
ImageList1: TImageList;
|
|||
|
|
v1SJKZ: TcxGridDBColumn;
|
|||
|
|
N6: TMenuItem;
|
|||
|
|
v1Ssel: TcxGridDBColumn;
|
|||
|
|
N7: TMenuItem;
|
|||
|
|
N8: TMenuItem;
|
|||
|
|
Button2: TButton;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Button5: TButton;
|
|||
|
|
Button6: TButton;
|
|||
|
|
N9: TMenuItem;
|
|||
|
|
v1PJKG: TcxGridDBColumn;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Filler: TComboBox;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure TBFindClick(Sender: TObject);
|
|||
|
|
procedure TBExportClick(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure TBAddClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure CustomerNoNameChange(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure ZJStatusChange(Sender: TObject);
|
|||
|
|
procedure Tv1DblClick(Sender: TObject);
|
|||
|
|
procedure Image2Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton1Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton2Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton4Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton5Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton3Click(Sender: TObject);
|
|||
|
|
procedure Image1Click(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton6Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton7Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton8Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton9Click(Sender: TObject);
|
|||
|
|
procedure SpeedButton10Click(Sender: TObject);
|
|||
|
|
procedure N3Click(Sender: TObject);
|
|||
|
|
procedure N4Click(Sender: TObject);
|
|||
|
|
procedure Image3Click(Sender: TObject);
|
|||
|
|
procedure N5Click(Sender: TObject);
|
|||
|
|
procedure Button4Click(Sender: TObject);
|
|||
|
|
procedure Button8Click(Sender: TObject);
|
|||
|
|
procedure Button7Click(Sender: TObject);
|
|||
|
|
procedure Image4Click(Sender: TObject);
|
|||
|
|
procedure MenuItem1Click(Sender: TObject);
|
|||
|
|
procedure MenuItem2Click(Sender: TObject);
|
|||
|
|
procedure MenuItem3Click(Sender: TObject);
|
|||
|
|
procedure MenuItem4Click(Sender: TObject);
|
|||
|
|
procedure ListView1DblClick(Sender: TObject);
|
|||
|
|
procedure N6Click(Sender: TObject);
|
|||
|
|
procedure N7Click(Sender: TObject);
|
|||
|
|
procedure N8Click(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
procedure Button5Click(Sender: TObject);
|
|||
|
|
procedure Button6Click(Sender: TObject);
|
|||
|
|
procedure N9Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
canshu1: string;
|
|||
|
|
DQdate: TDateTime;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitForm();
|
|||
|
|
function DelData(): Boolean;
|
|||
|
|
procedure Initimage();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FFInt, FCloth: Integer;
|
|||
|
|
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmLLRKList: TfrmLLRKList;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_QCRKInPut, U_ZDYHelp, U_LLRKInPut, U_LLRKInPutMH,
|
|||
|
|
U_LLRKInPutX, U_LLRKMXInPut, U_Fun, U_KHListSelJJ;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmLLRKList.Initimage();
|
|||
|
|
var
|
|||
|
|
ListItem: TListItem;
|
|||
|
|
Flag: Cardinal;
|
|||
|
|
info: SHFILEINFOA;
|
|||
|
|
Icon: TIcon;
|
|||
|
|
begin
|
|||
|
|
ListView1.Items.Clear;
|
|||
|
|
with adoqueryTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select fileName from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + ''' ');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
open;
|
|||
|
|
if not IsEmpty then
|
|||
|
|
begin
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
with ListView1 do
|
|||
|
|
begin
|
|||
|
|
LargeImages := ImageList1;
|
|||
|
|
Icon := TIcon.Create;
|
|||
|
|
ListItem := Items.Add;
|
|||
|
|
ListItem.Caption := trim(fieldbyname('fileName').AsString);
|
|||
|
|
Flag := (SHGFI_LARGEICON or SHGFI_ICON or SHGFI_USEFILEATTRIBUTES);
|
|||
|
|
SHGetFileInfo(Pchar(trim(fieldbyname('fileName').AsString)), 0, info, Sizeof(info), Flag);
|
|||
|
|
Icon.Handle := info.hIcon;
|
|||
|
|
ImageList1.AddIcon(Icon);
|
|||
|
|
ListItem.ImageIndex := ImageList1.Count - 1;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmLLRKList := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxgrid1.Align := alClient;
|
|||
|
|
canshu1 := Trim(DParameters1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>111', Tv1, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(',PJKG=cast((case when isnull(PS,0)<>0 then KgQty/PS else 0 end) as decimal(18,1))');
|
|||
|
|
SQL.Add(',KHNameQC=(select Top 1 B.KHName from KH_Main B ');
|
|||
|
|
sql.add(' where isnull(KHFlag,'''')=''KH'' and isnull(B.Valid,'''')=''Y'' and B.KHNameJC=A.KHName)');
|
|||
|
|
sql.add(',IFFZ=(select Count(B.WBID) from TP_File B where B.WBID=A.MYID and B.TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'')');
|
|||
|
|
sql.Add(' from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where 1=1 ');
|
|||
|
|
if CheckBox1.Checked = False then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', now)) + '''');
|
|||
|
|
sql.Add(' and A.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', now + 1)) + '''');
|
|||
|
|
BegDate.Visible := false;
|
|||
|
|
EndDate.Visible := false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|||
|
|
sql.Add(' and A.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|||
|
|
BegDate.Visible := true;
|
|||
|
|
EndDate.Visible := true;
|
|||
|
|
end;
|
|||
|
|
sql.Add(' and isnull(CRType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' order by A.CRTime');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
TBFind.Click;
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with ADOQuery2 do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.add(' select DISTINCT A.filler AS Name');
|
|||
|
|
sql.Add(' from CK_MYSC_CR A where 1=1 ');
|
|||
|
|
if CheckBox1.Checked = False then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', now)) + '''');
|
|||
|
|
sql.Add(' and A.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', now + 1)) + '''');
|
|||
|
|
BegDate.Visible := false;
|
|||
|
|
EndDate.Visible := false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|||
|
|
sql.Add(' and A.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|||
|
|
BegDate.Visible := true;
|
|||
|
|
EndDate.Visible := true;
|
|||
|
|
end;
|
|||
|
|
sql.Add(' and isnull(CRType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
// ShowMessage(SQL.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
filler.Items.Clear; //<2F><><EFBFBD><EFBFBD>
|
|||
|
|
filler.Items.Add(Trim(''));
|
|||
|
|
|
|||
|
|
while not ADOQuery2.eof do
|
|||
|
|
begin
|
|||
|
|
filler.Items.Add(ADOQuery2.fieldbyname('name').AsString);
|
|||
|
|
ADOQuery2.next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.InitForm();
|
|||
|
|
begin
|
|||
|
|
BegDate.Date := SGetServerDateMBeg(ADOQueryTemp);
|
|||
|
|
EndDate.Date := SGetServerDate(ADOQueryTemp);
|
|||
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>111', Tv1, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.TBFindClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmLLRKList.DelData(): Boolean;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Result := false;
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
Order_Main.DisableControls;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while Order_Main.Locate('SSel', True, []) do
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' insert into CK_MYSC_CR_Log ');
|
|||
|
|
sql.Add(' select * from CK_MYSC_CR where MYID=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_Log Set DelTime=getdate(),DelerCode=''' + Trim(DCode) + ''',Deler=''' + Trim(DName) + '''');
|
|||
|
|
sql.Add(' where MYID=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('Delete CK_MYSC_CR where MYId=''' + Trim(Order_Main.fieldbyname('MYId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Order_Main.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Main.EnableControls;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Result := False;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.TBExportClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
TcxGridToExcel(Self.Caption, cxGrid1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.TBAddClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitForm();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.CheckBox2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.ToolButton1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMYType: string;
|
|||
|
|
begin
|
|||
|
|
FFMYType := Trim(Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
if Trim(FFMYType) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
frmLLRKInPut.TBSave.Visible := False;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27>ײ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
frmLLRKInPut.TBSave.Visible := False;
|
|||
|
|
FML := '<27>ײ<EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
frmLLRKInPut.TBSave.Visible := False;
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27>IJ<DEB7>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
frmLLRKInPut.TBSave.Visible := False;
|
|||
|
|
FML := '<27>IJ<DEB7>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutX := TfrmLLRKInPutX.Create(Application);
|
|||
|
|
with frmLLRKInPutX do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
frmLLRKInPut.TBSave.Visible := False;
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutX.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.CustomerNoNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: integer;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR_MX where MYID=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Order_Main.DisableControls;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
i := 0;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if FieldByName('Ssel').AsBoolean = True then
|
|||
|
|
begin
|
|||
|
|
i := i + 1;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Main.EnableControls;
|
|||
|
|
if Application.MessageBox(PChar('ȷ<><C8B7>Ҫɾ<D2AA><C9BE>' + inttostr(i) + '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
if DelData() then
|
|||
|
|
begin
|
|||
|
|
//Order_Main.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMYType: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
FFMYType := Trim(Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
if Trim(FFMYType) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27>ײ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27>ײ<EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27>IJ<DEB7>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27>IJ<DEB7>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutX := TfrmLLRKInPutX.Create(Application);
|
|||
|
|
with frmLLRKInPutX do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutX.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.ZJStatusChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBFind.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Tv1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName = 'IFFZ' then
|
|||
|
|
begin
|
|||
|
|
cxGroupBox2.Visible := true;
|
|||
|
|
Initimage();
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
ToolButton1.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Image2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
FMYType := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FMYTypeFlag := 'LML';
|
|||
|
|
frmLLRKInPut.labMYType.Caption := '<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FML := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
FMYType := '<27>ײ<EFBFBD>';
|
|||
|
|
FMYTypeFlag := 'LDL';
|
|||
|
|
frmLLRKInPut.labMYType.Caption := '<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>ϵײ<CFB5>';
|
|||
|
|
FML := '<27>ײ<EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton4Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
FMYType := '<27><>';
|
|||
|
|
FMYTypeFlag := 'LMH';
|
|||
|
|
frmLLRKInPutMH.labMYType.Caption := '<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
FMYType := '<27>IJ<DEB7>';
|
|||
|
|
FMYTypeFlag := 'LWF';
|
|||
|
|
frmLLRKInPutMH.labMYType.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD>IJ<DEB7>';
|
|||
|
|
FML := '<27>IJ<DEB7>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutX := TfrmLLRKInPutX.Create(Application);
|
|||
|
|
with frmLLRKInPutX do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
FMYType := '<27><>';
|
|||
|
|
FMYTypeFlag := 'LX';
|
|||
|
|
frmLLRKInPutX.labMYType.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutX.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Image1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible := true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
MYType.Text := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
MYType.Text := '<27>ײ<EFBFBD>';
|
|||
|
|
panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton8Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
MYType.Text := '<27><>';
|
|||
|
|
panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton9Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
MYType.Text := '<27><>';
|
|||
|
|
panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.SpeedButton10Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
MYType.Text := '<27>IJ<DEB7>';
|
|||
|
|
panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKMXInPut := TfrmLLRKMXInPut.Create(Application);
|
|||
|
|
with frmLLRKMXInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
initgrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKMXInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMYType: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
FFMYType := Trim(Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
if Trim(FFMYType) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 2;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27>ײ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPut := TfrmLLRKInPut.Create(Application);
|
|||
|
|
with frmLLRKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 2;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27>ײ<EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 2;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27>IJ<DEB7>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutMH := TfrmLLRKInPutMH.Create(Application);
|
|||
|
|
with frmLLRKInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState := 2;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27>IJ<DEB7>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if Trim(FFMYType) = '<27><>' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmLLRKInPutX := TfrmLLRKInPutX.Create(Application);
|
|||
|
|
with frmLLRKInPutX do
|
|||
|
|
begin
|
|||
|
|
PState := 2;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|||
|
|
FMYType := Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|||
|
|
FMYTypeFlag := Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
FML := '<27><>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKInPutX.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Image3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxGroupBox2.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxGroupBox2.Visible := true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName: string;
|
|||
|
|
fFilePath: string;
|
|||
|
|
maxNo: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
adoqueryCmd.Connection.BeginTrans;
|
|||
|
|
begin
|
|||
|
|
fFilePath := WJPach.Text;
|
|||
|
|
fFileName := WJName.Text;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TFId from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add(' and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add(' and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><DEB8>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible := False;
|
|||
|
|
Panel4.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel4.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxNo, 'MD', 'TP_File', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value := trim(maxNo);
|
|||
|
|
fieldbyname('WBID').Value := trim(Order_Main.fieldbyname('MYID').AsString);
|
|||
|
|
fieldbyname('TFType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
fieldbyname('FileName').Value := trim(fFileName);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
if fFilePath <> '' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ', '127.0.0.1');
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27>ϴ<EFBFBD><CFB4>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Panel4.Visible := false;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
adoqueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
adoqueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button8Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName: string;
|
|||
|
|
begin
|
|||
|
|
fFileName := WJName.Hint;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate TP_File Set FileName=''' + Trim(WJName.Text) + '''');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible := False;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button7Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName: string;
|
|||
|
|
fFilePath: string;
|
|||
|
|
maxNo: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
adoqueryCmd.Connection.BeginTrans;
|
|||
|
|
fFilePath := WJPach.Text;
|
|||
|
|
fFileName := WJName.Hint;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TFId from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
if not adoqueryCmd.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><DEB8>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible := False;
|
|||
|
|
Panel4.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel4.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxNo, 'FJ', 'TP_File', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value := trim(maxNo);
|
|||
|
|
fieldbyname('WBID').Value := trim(Order_Main.fieldbyname('MYID').AsString);
|
|||
|
|
fieldbyname('TFType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
fieldbyname('FileName').Value := trim(fFileName);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
if fFilePath <> '' then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ', '127.0.0.1');
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27>ϴ<EFBFBD><CFB4>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Panel4.Visible := false;
|
|||
|
|
Initimage();
|
|||
|
|
adoqueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
adoqueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Image4Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel12.Visible := false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.MenuItem1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
OpenDiaLog: TOpenDialog;
|
|||
|
|
fFileName: string;
|
|||
|
|
fFilePath: string;
|
|||
|
|
begin
|
|||
|
|
OpenDiaLog := TOpenDialog.Create(Self);
|
|||
|
|
if OpenDiaLog.Execute then
|
|||
|
|
begin
|
|||
|
|
fFilePath := OpenDiaLog.FileName;
|
|||
|
|
fFileName := ExtractFileName(OpenDiaLog.FileName);
|
|||
|
|
Panel12.Visible := True;
|
|||
|
|
WJName.Text := Trim(fFileName);
|
|||
|
|
WJName.Hint := Trim(fFileName);
|
|||
|
|
WJPach.Text := fFilePath;
|
|||
|
|
Button8.Visible := False;
|
|||
|
|
Button4.Visible := True;
|
|||
|
|
Button7.Visible := True;
|
|||
|
|
Panel12.Refresh;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.MenuItem2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName: string;
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount < 1 then
|
|||
|
|
exit;
|
|||
|
|
fFileName := ListView1.Selected.Caption;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add('and TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName=' + quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.MenuItem3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount < 1 then
|
|||
|
|
exit;
|
|||
|
|
Panel12.Visible := True;
|
|||
|
|
Button4.Visible := False;
|
|||
|
|
Button7.Visible := False;
|
|||
|
|
Button8.Visible := True;
|
|||
|
|
Panel12.Refresh;
|
|||
|
|
WJName.Text := Trim(ListView1.Selected.Caption);
|
|||
|
|
WJName.Hint := Trim(ListView1.Selected.Caption);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.MenuItem4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
SaveDialog: TSaveDialog;
|
|||
|
|
fFileName: string;
|
|||
|
|
fFilePath: string;
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount < 1 then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
fFileName := ListView1.Selected.Caption;
|
|||
|
|
SaveDialog := TSaveDialog.Create(Self);
|
|||
|
|
SaveDialog.FileName := fFileName;
|
|||
|
|
if SaveDialog.Execute then
|
|||
|
|
begin
|
|||
|
|
Panel3.Caption := '<27><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel3.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
fFilePath := SaveDialog.FileName;
|
|||
|
|
try
|
|||
|
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', 'FTP<54><50>ַ', '127.0.0.1');
|
|||
|
|
;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
Panel3.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel3.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
try
|
|||
|
|
IdFTP1.Get('FJ\' + Trim(fFileName), fFilePath, false, true);
|
|||
|
|
except
|
|||
|
|
Panel3.Visible := false;
|
|||
|
|
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible := false;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel3.Visible := false;
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
end;
|
|||
|
|
except
|
|||
|
|
Panel3.Visible := false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.ListView1DblClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
sFieldName: string;
|
|||
|
|
fileName: string;
|
|||
|
|
begin
|
|||
|
|
if ListView1.Items.Count < 1 then
|
|||
|
|
EXIT;
|
|||
|
|
|
|||
|
|
if listView1.SelCount < 1 then
|
|||
|
|
exit;
|
|||
|
|
sFieldName := leftbstr(ExtractFilePath(Application.ExeName), 1) + ':\ͼƬ<CDBC>鿴';
|
|||
|
|
|
|||
|
|
if not DirectoryExists(pchar(sFieldName)) then
|
|||
|
|
CreateDirectory(pchar(sFieldName), nil);
|
|||
|
|
|
|||
|
|
fileName := ListView1.Selected.Caption;
|
|||
|
|
|
|||
|
|
sFieldName := sFieldName + '\' + trim(fileName);
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ', '127.0.0.1');
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Panel4.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel4.Visible := true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
try
|
|||
|
|
IdFTP1.Get('FJ\' + Trim(fileName), sFieldName, true, false);
|
|||
|
|
except
|
|||
|
|
Panel4.Visible := false;
|
|||
|
|
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel4.Visible := false;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel4.Visible := false;
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N6Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Order_Main.Locate('Ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥.rmf';
|
|||
|
|
RMXLSExport2 := TRMXLSExport.Create(RMXLSExport2);
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(',PJKG=cast((case when isnull(PS,0)<>0 then KgQty/PS else 0 end) as decimal(18,1))');
|
|||
|
|
SQL.Add(',KHNameQC=(select Top 1 B.KHName from KH_Main B ');
|
|||
|
|
sql.add(' where isnull(KHFlag,'''')=''KH'' and isnull(B.Valid,'''')=''Y'' and B.KHNameJC=A.KHName)');
|
|||
|
|
sql.add(',IFFZ=(select Count(B.WBID) from TP_File B where B.WBID=A.MYID and B.TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'')');
|
|||
|
|
sql.Add(' from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where MYId=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add(' and isnull(A.CRType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
|||
|
|
Order_Main.DisableControls;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if FieldByName('Ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
SSetEditDataCDSNew(Order_Main, CDS_PRT);
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Main.EnableControls;
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥.rmf'), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(Order_Main, true);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N8Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(Order_Main, false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmKHListSelJJ := TfrmKHListSelJJ.Create(Application);
|
|||
|
|
with frmKHListSelJJ do
|
|||
|
|
begin
|
|||
|
|
frmKHListSelJJ.canshu2 := '<27><>Ȩ<EFBFBD><C8A8>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.KHName.Text := Trim(frmKHListSelJJ.CDS_HZ.fieldbyname('KHNameJC').AsString);
|
|||
|
|
//TBFind.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmKHListSelJJ.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(self);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
Flag := 'LHJCDanWei' + trim(Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
flagName := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
|
|||
|
|
MainType := Trim(KHName.Text);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
JCDanWei.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(self);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
Flag := 'MLMYName' + trim(Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
flagName := '<27><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>';
|
|||
|
|
MainType := Trim(KHName.Text);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
MYName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.Button6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(self);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
Flag := 'MLMYColorNo' + trim(Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|||
|
|
flagName := 'ɫ<><C9AB><EFBFBD><EFBFBD>ɫ';
|
|||
|
|
fnote := true;
|
|||
|
|
V1Note.Caption := '<27><>ɫ';
|
|||
|
|
V1Name.Caption := 'ɫ<><C9AB>';
|
|||
|
|
MainType := Trim(KHName.Text);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
MYColor.Text := Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKList.N9Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Order_Main.Locate('Ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ.rmf';
|
|||
|
|
RMXLSExport2 := TRMXLSExport.Create(RMXLSExport2);
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select A.* ');
|
|||
|
|
sql.Add(',PJKG=cast((case when isnull(PS,0)<>0 then KgQty/PS else 0 end) as decimal(18,1))');
|
|||
|
|
SQL.Add(',KHNameQC=(select Top 1 B.KHName from KH_Main B ');
|
|||
|
|
sql.add(' where isnull(KHFlag,'''')=''KH'' and isnull(B.Valid,'''')=''Y'' and B.KHNameJC=A.KHName)');
|
|||
|
|
sql.add(',IFFZ=(select Count(B.WBID) from TP_File B where B.WBID=A.MYID and B.TFType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'')');
|
|||
|
|
sql.Add(' from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where MYId=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|||
|
|
sql.Add(' and isnull(A.CRType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
|||
|
|
Order_Main.DisableControls;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if FieldByName('Ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
SSetEditDataCDSNew(Order_Main, CDS_PRT);
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Main.EnableControls;
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ.rmf'), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|