1931 lines
56 KiB
ObjectPascal
1931 lines
56 KiB
ObjectPascal
![]() |
unit U_BaoGuanList;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|||
|
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
|||
|
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
|
|||
|
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
|
|||
|
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
|
|||
|
cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
|
|||
|
RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit, cxPC,
|
|||
|
BtnEdit, cxSplitter, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
|||
|
dxBarBuiltInMenu, MovePanel, Registry, dxSkinsCore,
|
|||
|
dxSkinsDefaultPainters, dxSkinscxPCPainter;
|
|||
|
|
|||
|
type
|
|||
|
TfrmBaoGuanList = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBExport: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
Label1: TLabel;
|
|||
|
BegDate: TDateTimePicker;
|
|||
|
EndDate: TDateTimePicker;
|
|||
|
CDS_Main: TClientDataSet;
|
|||
|
TBDel: TToolButton;
|
|||
|
PopupMenu1: TPopupMenu;
|
|||
|
N1: TMenuItem;
|
|||
|
N2: TMenuItem;
|
|||
|
TBAdd: TToolButton;
|
|||
|
TBEdit: TToolButton;
|
|||
|
ClientDataSet1: TClientDataSet;
|
|||
|
Label6: TLabel;
|
|||
|
A4FPNO: TEdit;
|
|||
|
cxTabControl1: TcxTabControl;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
DataSource2: TDataSource;
|
|||
|
ClientDataSet2: TClientDataSet;
|
|||
|
Label5: TLabel;
|
|||
|
zGCNAME: TEdit;
|
|||
|
Label8: TLabel;
|
|||
|
KHName: TEdit;
|
|||
|
Label3: TLabel;
|
|||
|
ZBGCODENAME: TEdit;
|
|||
|
TBCopy: TToolButton;
|
|||
|
TBBGZL: TToolButton;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
CDS_Print: TClientDataSet;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDBDataSet1: TRMDBDataSet;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
TBHT: TToolButton;
|
|||
|
TBFP: TToolButton;
|
|||
|
TBZXD: TToolButton;
|
|||
|
TBBGD: TToolButton;
|
|||
|
TBView: TToolButton;
|
|||
|
TBSBYS: TToolButton;
|
|||
|
TBSS: TToolButton;
|
|||
|
TBSSCX: TToolButton;
|
|||
|
TBSH: TToolButton;
|
|||
|
TBSHCX: TToolButton;
|
|||
|
TBAll: TToolButton;
|
|||
|
Label2: TLabel;
|
|||
|
ZC3BGNameEng: TEdit;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
TV1: TcxGridDBTableView;
|
|||
|
cxGridDBColumn14: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
tv2Column1: TcxGridDBColumn;
|
|||
|
tv2Column2: TcxGridDBColumn;
|
|||
|
tv2Column3: TcxGridDBColumn;
|
|||
|
tv2Column4: TcxGridDBColumn;
|
|||
|
tv2Column5: TcxGridDBColumn;
|
|||
|
tv2Column6: TcxGridDBColumn;
|
|||
|
TV1Column7: TcxGridDBColumn;
|
|||
|
TV1Column8: TcxGridDBColumn;
|
|||
|
TV1Column9: TcxGridDBColumn;
|
|||
|
TV1Column10: TcxGridDBColumn;
|
|||
|
TV1Column11: TcxGridDBColumn;
|
|||
|
TV1Column12: TcxGridDBColumn;
|
|||
|
TV1Column13: TcxGridDBColumn;
|
|||
|
TV1Column14: TcxGridDBColumn;
|
|||
|
Label4: TLabel;
|
|||
|
Zorderno: TEdit;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
MovePanel1: TMovePanel;
|
|||
|
Label7: TLabel;
|
|||
|
Label9: TLabel;
|
|||
|
Edit2: TEdit;
|
|||
|
Label10: TLabel;
|
|||
|
Label11: TLabel;
|
|||
|
bgdate: TDateTimePicker;
|
|||
|
B7DaoHuoGang: TBtnEditA;
|
|||
|
htdate: TDateTimePicker;
|
|||
|
Label12: TLabel;
|
|||
|
chuandate: TDateTimePicker;
|
|||
|
Label13: TLabel;
|
|||
|
guixing: TEdit;
|
|||
|
Label14: TLabel;
|
|||
|
huodai: TBtnEditA;
|
|||
|
Label15: TLabel;
|
|||
|
tdno: TEdit;
|
|||
|
Button1: TButton;
|
|||
|
Button2: TButton;
|
|||
|
Panel3: TPanel;
|
|||
|
Label19: TLabel;
|
|||
|
Panel6: TPanel;
|
|||
|
Image1: TImage;
|
|||
|
Button7: TButton;
|
|||
|
RadioGroup2: TRadioGroup;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
TV1Column16: TcxGridDBColumn;
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
TV1Column4: TcxGridDBColumn;
|
|||
|
btn1: TToolButton;
|
|||
|
btn2: TToolButton;
|
|||
|
Label16: TLabel;
|
|||
|
Filler: TEdit;
|
|||
|
TV1Column18: TcxGridDBColumn;
|
|||
|
TV1Column19: TcxGridDBColumn;
|
|||
|
Panel2: TPanel;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
TV2: TcxGridDBTableView;
|
|||
|
cxGridDBColumn32: TcxGridDBColumn;
|
|||
|
cxGridDBColumn33: TcxGridDBColumn;
|
|||
|
cxGridDBColumn34: TcxGridDBColumn;
|
|||
|
cxGridDBColumn35: TcxGridDBColumn;
|
|||
|
cxGridDBColumn36: TcxGridDBColumn;
|
|||
|
cxGridDBColumn37: TcxGridDBColumn;
|
|||
|
cxGridDBColumn38: TcxGridDBColumn;
|
|||
|
cxGridDBColumn39: TcxGridDBColumn;
|
|||
|
cxGridDBColumn40: TcxGridDBColumn;
|
|||
|
cxGridDBColumn41: TcxGridDBColumn;
|
|||
|
cxGridDBColumn42: TcxGridDBColumn;
|
|||
|
cxGridDBColumn43: TcxGridDBColumn;
|
|||
|
cxGridDBColumn44: TcxGridDBColumn;
|
|||
|
cxGridDBColumn45: TcxGridDBColumn;
|
|||
|
cxGridDBColumn46: TcxGridDBColumn;
|
|||
|
cxGridDBColumn47: TcxGridDBColumn;
|
|||
|
cxGridDBColumn48: TcxGridDBColumn;
|
|||
|
cxGridDBColumn50: TcxGridDBColumn;
|
|||
|
cxGridDBColumn51: TcxGridDBColumn;
|
|||
|
cxGridDBColumn52: TcxGridDBColumn;
|
|||
|
cxGridDBColumn53: TcxGridDBColumn;
|
|||
|
cxGridLevel2: TcxGridLevel;
|
|||
|
Label17: TLabel;
|
|||
|
A6PONO: TEdit;
|
|||
|
TV1Column1: TcxGridDBColumn;
|
|||
|
TV1Column2: TcxGridDBColumn;
|
|||
|
Label18: TLabel;
|
|||
|
DCNO: TEdit;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure FormCreate(Sender: TObject);
|
|||
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
procedure ConNoMChange(Sender: TObject);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure TBExportClick(Sender: TObject);
|
|||
|
procedure TBFindClick(Sender: TObject);
|
|||
|
procedure N1Click(Sender: TObject);
|
|||
|
procedure N2Click(Sender: TObject);
|
|||
|
procedure TBDelClick(Sender: TObject);
|
|||
|
procedure TBAddClick(Sender: TObject);
|
|||
|
procedure TBEditClick(Sender: TObject);
|
|||
|
procedure FactoryNameChange(Sender: TObject);
|
|||
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
procedure CRTypeChange(Sender: TObject);
|
|||
|
procedure A4FPNOKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure zGCNAMEKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure KHNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure TBCopyClick(Sender: TObject);
|
|||
|
procedure TBBGZLClick(Sender: TObject);
|
|||
|
procedure TBHTClick(Sender: TObject);
|
|||
|
procedure TBFPClick(Sender: TObject);
|
|||
|
procedure TBZXDClick(Sender: TObject);
|
|||
|
procedure TBBGDClick(Sender: TObject);
|
|||
|
procedure TBViewClick(Sender: TObject);
|
|||
|
procedure TBSBYSClick(Sender: TObject);
|
|||
|
procedure TBSSClick(Sender: TObject);
|
|||
|
procedure TBSSCXClick(Sender: TObject);
|
|||
|
procedure TBHDClick(Sender: TObject);
|
|||
|
procedure TBHDCXClick(Sender: TObject);
|
|||
|
procedure TBSHClick(Sender: TObject);
|
|||
|
procedure TBSHCXClick(Sender: TObject);
|
|||
|
procedure TBAllClick(Sender: TObject);
|
|||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
procedure Button2Click(Sender: TObject);
|
|||
|
procedure huodaiBtnClick(Sender: TObject);
|
|||
|
procedure B7DaoHuoGangBtnClick(Sender: TObject);
|
|||
|
procedure BtnEditA1BtnClick(Sender: TObject);
|
|||
|
procedure Button7Click(Sender: TObject);
|
|||
|
procedure Image1Click(Sender: TObject);
|
|||
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
procedure TV1DblClick(Sender: TObject);
|
|||
|
procedure btn1Click(Sender: TObject);
|
|||
|
procedure btn2Click(Sender: TObject);
|
|||
|
procedure ZordernoChange(Sender: TObject);
|
|||
|
procedure ZordernoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
|||
|
|
|||
|
// procedure img1Click(Sender: TObject);
|
|||
|
private
|
|||
|
canshu2: string;
|
|||
|
FDate: TDateTime;
|
|||
|
procedure InitGrid();
|
|||
|
function DelData(): Boolean;
|
|||
|
function GetShellFolders(strDir: string): string;
|
|||
|
procedure InitSubGrid();
|
|||
|
procedure InitGridSql(var fsj: string);
|
|||
|
procedure InitButton();
|
|||
|
procedure InitPrtData();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
canshu1, canshu3: string;
|
|||
|
FDY: string;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
//var
|
|||
|
//frmBaoGuanList: TfrmBaoGuanList;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_RTFun, U_ZDYHelp, U_BaoGuanInPut, U_Fun;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
//frmBaoGuanList:=nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.InitButton();
|
|||
|
begin
|
|||
|
TBAdd.Visible := False;
|
|||
|
TBEdit.Visible := False;
|
|||
|
TBDel.Visible := False;
|
|||
|
// TBCopy.Visible := False;
|
|||
|
TBSS.Visible := False;
|
|||
|
TBSSCX.Visible := False;
|
|||
|
// TBHD.Visible := False;
|
|||
|
// TBHDcx.Visible := False;
|
|||
|
TBSH.Visible := False;
|
|||
|
TBSHCX.Visible := False;
|
|||
|
ToolButton2.Visible := False;
|
|||
|
ToolButton3.Visible := False;
|
|||
|
btn1.Visible := false;
|
|||
|
ToolButton1.Visible := False;
|
|||
|
TBExport.Visible := False;
|
|||
|
|
|||
|
if canshu3 = 'ҵ<><D2B5>Ա' then
|
|||
|
begin
|
|||
|
btn1.Visible := True;
|
|||
|
TBExport.Visible := False;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
TBExport.Visible := true;
|
|||
|
ToolButton1.Visible := true;
|
|||
|
end;
|
|||
|
if cxTabControl1.TabIndex = 2 then
|
|||
|
begin
|
|||
|
// ToolButton3.Visible := True;
|
|||
|
// ToolButton2.Visible := True;
|
|||
|
TBEdit.Visible := True;
|
|||
|
end;
|
|||
|
if Trim(Self.Caption) = '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>' then //<2F><><EFBFBD><EFBFBD>
|
|||
|
begin
|
|||
|
// TBAdd.Visible:=True;TBEdit.Visible:=True;TBDel.Visible:=True;TBCopy.Visible:=True;
|
|||
|
// TBSS.Visible:=False; TBSSCX.Visible:=False;TBAll.Visible:=True;
|
|||
|
// TBBGZL.Visible:=True;TBHT.Visible:=True;TBFP.Visible:=True;
|
|||
|
// TBZXD.Visible:=True;TBBGD.Visible:=True;TBSBYS.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=0;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
// v1Column31.Visible:=False;
|
|||
|
// v1Column31.Hidden:=True;
|
|||
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
begin
|
|||
|
TBAdd.Visible := True;
|
|||
|
TBEdit.Visible := True;
|
|||
|
TBDel.Visible := True;
|
|||
|
TBCopy.Visible := True;
|
|||
|
TBSS.Visible := True
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 1 then
|
|||
|
begin
|
|||
|
TBSSCX.Visible := True;
|
|||
|
TBEdit.Visible := true;
|
|||
|
// TBHD.Visible := True;
|
|||
|
TBSH.Visible := True;
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 2 then
|
|||
|
begin
|
|||
|
// TBHDcx.Visible := True;
|
|||
|
TBSHCX.Visible := True;
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 3 then
|
|||
|
begin
|
|||
|
// TBHDcx.Visible := True;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>' then
|
|||
|
begin
|
|||
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
begin
|
|||
|
TBAdd.Visible := True;
|
|||
|
TBEdit.Visible := True;
|
|||
|
TBDel.Visible := True;
|
|||
|
TBCopy.Visible := True;
|
|||
|
TBSS.Visible := True
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 1 then
|
|||
|
begin
|
|||
|
TBSSCX.Visible := True;
|
|||
|
TBEdit.Visible := true;
|
|||
|
// TBHD.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
// TBSS.Visible:=True; TBSSCX.Visible:=True;TBAll.Visible:=True;
|
|||
|
// TBBGZL.Visible:=True;TBHT.Visible:=True;TBFP.Visible:=True;
|
|||
|
// TBZXD.Visible:=True;TBBGD.Visible:=True;TBSBYS.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=0;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>(<28><>Ȩ<EFBFBD><C8A8>)' then
|
|||
|
begin
|
|||
|
// TBAdd.Visible:=True;TBEdit.Visible:=True;TBDel.Visible:=True;TBCopy.Visible:=True;
|
|||
|
// TBSS.Visible:=True; TBSSCX.Visible:=True;TBAll.Visible:=True;
|
|||
|
// TBBGZL.Visible:=True;TBHT.Visible:=True;TBFP.Visible:=True;
|
|||
|
// TBZXD.Visible:=True;TBBGD.Visible:=True;TBSBYS.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=0;
|
|||
|
|
|||
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
begin
|
|||
|
TBAdd.Visible := True;
|
|||
|
TBEdit.Visible := True;
|
|||
|
TBDel.Visible := True;
|
|||
|
TBCopy.Visible := True;
|
|||
|
TBSS.Visible := True
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 1 then
|
|||
|
begin
|
|||
|
TBSSCX.Visible := True;
|
|||
|
TBEdit.Visible := true;
|
|||
|
// TBHD.Visible := True;
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 2 then
|
|||
|
begin
|
|||
|
// TBHDcx.Visible := True;
|
|||
|
end;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD>ѯ(<28><>Ȩ<EFBFBD><C8A8>)' then
|
|||
|
begin
|
|||
|
// TBBGZL.Visible:=True;TBHT.Visible:=True;TBFP.Visible:=True;
|
|||
|
// TBZXD.Visible:=True;TBBGD.Visible:=True;TBSBYS.Visible:=True; TBAll.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>ӡ<EFBFBD><D3A1>ѯ' then
|
|||
|
begin
|
|||
|
// TBBGZL.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD>غ<EFBFBD>ͬ<EFBFBD><CDAC>ӡ<EFBFBD><D3A1>ѯ' then
|
|||
|
begin
|
|||
|
// TBHT.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD>ط<EFBFBD>Ʊ<EFBFBD><C6B1>ӡ<EFBFBD><D3A1>ѯ' then
|
|||
|
begin
|
|||
|
// TBFP.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD>װ<EFBFBD>䵥<EFBFBD><E4B5A5>ӡ<EFBFBD><D3A1>ѯ' then
|
|||
|
begin
|
|||
|
// TBZXD.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>ӡ<EFBFBD><D3A1>ѯ' then
|
|||
|
begin
|
|||
|
// TBBGD.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27>걨Ҫ<EAB1A8>ش<EFBFBD>ӡ<EFBFBD><D3A1>ѯ' then
|
|||
|
begin
|
|||
|
// TBSBYS.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=4;
|
|||
|
// cxTabControl1.Visible:=False;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϻ˶<CFBA>' then
|
|||
|
begin
|
|||
|
// TBHD.Visible:=True; TBHDCX.Visible:=True; TBAll.Visible:=True;
|
|||
|
// TBBGZL.Visible:=True;TBHT.Visible:=True;TBFP.Visible:=True;
|
|||
|
// TBZXD.Visible:=True;TBBGD.Visible:=True;TBSBYS.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=1;
|
|||
|
end
|
|||
|
else if Trim(Self.Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
// TBSH.Visible:=True; TBSHCX.Visible:=True; TBAll.Visible:=True;
|
|||
|
// TBBGZL.Visible:=True;TBHT.Visible:=True;TBFP.Visible:=True;
|
|||
|
// TBZXD.Visible:=True;TBBGD.Visible:=True;TBSBYS.Visible:=True;
|
|||
|
// cxTabControl1.TabIndex:=2;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Application := MainApplication;
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
//cxGrid1.Align:=alClient;
|
|||
|
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
|||
|
BegDate.DateTime := EndDate.DateTime - 90;
|
|||
|
canshu1 := Trim(DParameters1);
|
|||
|
canshu2 := Trim(DParameters2);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.InitGrid();
|
|||
|
var
|
|||
|
fwhere, Pwhere: string;
|
|||
|
begin
|
|||
|
Pwhere := SGetFilters(Panel1, 1, 2);
|
|||
|
|
|||
|
begin
|
|||
|
if trim(Pwhere) <> '' then
|
|||
|
fwhere := fwhere + ' and ' + trim(Pwhere);
|
|||
|
end;
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered := False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from (');
|
|||
|
sql.Add('select A.* ');
|
|||
|
SQL.Add(',ZORDERNO=cast((select B.ORDERNO+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
SQL.Add(',ZGCNAME=cast((select B.GCNAME+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
SQL.Add(',ZC3BGNameEng=cast((select B.C3BGNameEng+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
SQL.Add(',ZBGCODENAME=cast((select B.BGCODENAME+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
|
|||
|
sql.Add(' from JYOrder_BaoGuan_Main A ');
|
|||
|
sql.Add(' where A.Valid=''Y'' ');
|
|||
|
// sql.Add(fwhere);
|
|||
|
|
|||
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(SChker,'''')='''' ');
|
|||
|
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 1 then
|
|||
|
begin //and isnull(OKPerson,'''')<>''''
|
|||
|
sql.Add(' and isnull(Status,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 2 then
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(Status,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
sql.Add(')AA WHERE 1=1');
|
|||
|
sql.Add(fwhere);
|
|||
|
if Caption = '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>' then
|
|||
|
begin
|
|||
|
sql.Add(' and HTDATE>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|||
|
sql.Add(' and HTDATE<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|||
|
SQL.Add('ORDER BY htdate DESC');
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
sql.Add(' and filltime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|||
|
sql.Add(' and filltime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|||
|
SQL.Add('ORDER BY FILLTIME DESC');
|
|||
|
end;
|
|||
|
// ShowMessage(sql.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
BegDate.SetFocus;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.ConNoMChange(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + self.Caption, Tv1, '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>7');
|
|||
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ' + self.Caption, Tv2, '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>8');
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + self.Caption, Tv1, '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>7');
|
|||
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ' + self.Caption, Tv2, '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>8');
|
|||
|
canshu1 := Trim(DParameters1);
|
|||
|
// ShowMessage(canshu1);
|
|||
|
InitButton();
|
|||
|
InitGrid();
|
|||
|
RM1.CanExport := true;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBExportClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile, FTaiTou: string;
|
|||
|
EngMoney, LBName, fImagePath2: string;
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then
|
|||
|
exit;
|
|||
|
// SelExportData(Tv1, ADOQueryMain, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
|
|||
|
// TcxGridToExcel(Trim(CDS_Main.fieldbyname('A4FPNO').AsString) + Trim(CDS_Main.fieldbyname('A5ConNO').AsString), cxGrid1);
|
|||
|
|
|||
|
FDY := '1';
|
|||
|
LBName := RadioGroup2.Items.Strings[RadioGroup2.ItemIndex];
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>.rmf';
|
|||
|
ExportFtErpFile('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>.rmf', ADOQueryPrint);
|
|||
|
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Filtered := False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' exec P_Print_DCBGD @begdate=' + quotedstr(Trim(FormatDateTime('yyyy-MM-dd', begdate.DateTime))) + ',@Enddate=' + quotedstr(Trim(FormatDateTime('yyyy-MM-dd', Enddate.DateTime + 1))));
|
|||
|
SQL.Add(',@STATUS=' + QUOTEDSTR(Trim(IntToStr(cxTabControl1.TabIndex))));
|
|||
|
// sql.Add('select A.* ');
|
|||
|
// SQL.Add(',ZORDERNO=cast((select B.ORDERNO+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
// SQL.Add(',ZGCNAME=cast((select B.GCNAME+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
// SQL.Add(',ZC3BGNameEng=cast((select B.C3BGNameEng+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
// SQL.Add(',ZBGCODENAME=cast((select B.BGCODENAME+'';'' from JYOrder_BaoGuan_SUB B where B.BGID=A.BGID AND SVALID=''Y'' for xml path('''')) as varchar(200))');
|
|||
|
// sql.Add(' from JYOrder_BaoGuan_Main A inner join JYOrder_BaoGuan_SUB B ON A.BGID=B.BGID ');
|
|||
|
// sql.Add(' where A.Valid=''Y'' AND B.SVALID=''Y'' ');
|
|||
|
// sql.Add(' and filltime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|||
|
// sql.Add(' and filltime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|||
|
// if Caption = '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>' then
|
|||
|
// begin
|
|||
|
// SQL.Add('ORDER BY htdate DESC');
|
|||
|
// end
|
|||
|
// else
|
|||
|
// begin
|
|||
|
// SQL.Add('ORDER BY FILLTIME DESC');
|
|||
|
// end;
|
|||
|
// ShowMessage(sql.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint, CDS_Print);
|
|||
|
SInitCDSData20(ADOQueryPrint, CDS_Print);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
if FDY = '0' then
|
|||
|
begin
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
Sleep(1000);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else if FDY = '1' then
|
|||
|
begin
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
fImagePath2 := ExtractFilePath(Application.ExeName) + 'image\label0001.xls';
|
|||
|
if FileExists(fImagePath2) then
|
|||
|
DeleteFile(fImagePath2); //label.xls
|
|||
|
// fImagePath2 := ExtractFilePath(Application.ExeName) + 'image\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>.xls';
|
|||
|
fImagePath2 := GetShellFolders('Desktop') + '\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>.xls';
|
|||
|
RM1.PrepareReport;
|
|||
|
Sleep(1000);
|
|||
|
RM1.ExportTo(RMXLSExport1, fImagePath2);
|
|||
|
end;
|
|||
|
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
// Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ص<EFBFBD>.rmf'), '<27><>ʾ', 0);
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + trim(fPrintFile)), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
Panel3.Visible := False;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmBaoGuanList.GetShellFolders(strDir: string): string;
|
|||
|
const
|
|||
|
regPath = '\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders';
|
|||
|
var
|
|||
|
Reg: TRegistry;
|
|||
|
strFolders: string;
|
|||
|
begin
|
|||
|
Reg := TRegistry.Create;
|
|||
|
try
|
|||
|
Reg.RootKey := HKEY_CURRENT_USER;
|
|||
|
if Reg.OpenKey(regPath, false) then
|
|||
|
begin
|
|||
|
strFolders := Reg.ReadString(strDir);
|
|||
|
end;
|
|||
|
finally
|
|||
|
Reg.Free;
|
|||
|
end;
|
|||
|
result := strFolders;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBFindClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.N1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main, True);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.N2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main, False);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.InitSubGrid();
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty = False then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_BaoGuan_Sub where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
sql.Add(' and SValid=''Y'' ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_BaoGuan_Sub where 1=2');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
SCreateCDS20(ADOQueryTemp, ClientDataSet2);
|
|||
|
SInitCDSData20(ADOQueryTemp, ClientDataSet2);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBDelClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
|
|||
|
if cxTabControl1.TabIndex <> 0 then
|
|||
|
Exit;
|
|||
|
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
if DelData() then
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmBaoGuanList.DelData(): Boolean;
|
|||
|
begin
|
|||
|
try
|
|||
|
Result := false;
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while CDS_Main.Locate('SSel', True, []) do
|
|||
|
begin
|
|||
|
if trim(cds_Main.fieldbyname('filler').AsString) <> Trim(DName) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>DZ<EFBFBD><C7B1>˽<EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
exit;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Valid=''N'',C7BGMoneyHZ=Null,E1BZQtyHZ=Null, E2ChiMaQtyHZ=Null,E3MaoZHZ=Null,E4JingZHZ=Null');
|
|||
|
sql.Add(',Editer=''' + Trim(DName) + ''',EditTime=getdate()');
|
|||
|
sql.Add(' where BGId=''' + Trim(CDS_Main.fieldbyname('BGId').AsString) + '''');
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Sub Set SValid=''N'',SEditer=''' + Trim(DName) + ''',SEditTime=getdate() where BGId=''' + Trim(CDS_Main.fieldbyname('BGId').AsString) + '''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
Result := True;
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Result := False;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBAddClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmBaoGuanInPut := TfrmBaoGuanInPut.Create(Application);
|
|||
|
with frmBaoGuanInPut do
|
|||
|
begin
|
|||
|
FBCId := '';
|
|||
|
canshu3 := self.canshu3;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmBaoGuanInPut.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBEditClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
// if CANSHU3 = 'ҵ<><D2B5>Ա' then
|
|||
|
// begin
|
|||
|
// if trim(cds_Main.fieldbyname('filler').AsString) <> Trim(DName) then
|
|||
|
// begin
|
|||
|
// Application.MessageBox('<27>DZ<EFBFBD><C7B1>˽<EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
// exit;
|
|||
|
// end;
|
|||
|
// end;
|
|||
|
if CDS_Main.fieldbyname('BGSTATUS').AsString = '<27><>' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ѱ<EFBFBD><D1B1>ز<EFBFBD><D8B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
frmBaoGuanInPut := TfrmBaoGuanInPut.Create(Application);
|
|||
|
with frmBaoGuanInPut do
|
|||
|
begin
|
|||
|
FBCId := Trim(CDS_Main.fieldbyname('BGID').AsString);
|
|||
|
if (Trim(Self.Caption) = '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>') and (cxTabControl1.TabIndex = 1) then
|
|||
|
begin
|
|||
|
ToolButton4.Visible := True;
|
|||
|
end;
|
|||
|
//TBDel.Visible:=False;
|
|||
|
//TBAdd.Visible:=False;
|
|||
|
canshu3 := self.canshu3;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmBaoGuanInPut.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.FactoryNameChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.cxTabControl1Change(Sender: TObject);
|
|||
|
begin
|
|||
|
InitButton();
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.CRTypeChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.A4FPNOKeyPress(Sender: TObject; var Key: Char);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
if Trim(A4FPNO.Text) = '' then
|
|||
|
Exit;
|
|||
|
fsj := ' and isnull(A.A4FPNO,'''') like ''' + '%' + Trim(A4FPNO.Text) + '%' + '''';
|
|||
|
InitGridSql(fsj);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.InitGridSql(var fsj: string);
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered := False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.* ');
|
|||
|
sql.Add(' from JYOrder_BaoGuan_Main A ');
|
|||
|
sql.Add(' where 1=1 ');
|
|||
|
if Trim(canshu1) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
SQL.Add(' and FillerCode=''' + Trim(DCode) + '''');
|
|||
|
end;
|
|||
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(SChker,'''')='''' ');
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
if cxTabControl1.TabIndex = 1 then
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(SChker,'''')<>'''' and isnull(Chker,'''')='''' ');
|
|||
|
end
|
|||
|
else if cxTabControl1.TabIndex = 2 then
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(Chker,'''')<>'''' ');
|
|||
|
end;
|
|||
|
end;
|
|||
|
sql.Add(fsj);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
InitSubGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.zGCNAMEKeyPress(Sender: TObject; var Key: Char);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.KHNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
// if Key = #13 then
|
|||
|
// begin
|
|||
|
// if Trim(A5ConNO.Text) = '' then
|
|||
|
// Exit;
|
|||
|
// fsj := ' and isnull(A.A5ConNO,'''') like ''' + '%' + Trim(A5ConNO.Text) + '%' + '''';
|
|||
|
// InitGridSql(fsj);
|
|||
|
// end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBCopyClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
// if cxTabControl1.TabIndex<>0 then Exit;
|
|||
|
try
|
|||
|
frmBaoGuanInPut := TfrmBaoGuanInPut.Create(Application);
|
|||
|
with frmBaoGuanInPut do
|
|||
|
begin
|
|||
|
FBCId := Trim(CDS_Main.fieldbyname('BGID').AsString);
|
|||
|
CopyStr := '99';
|
|||
|
//TBDel.Visible:=False;
|
|||
|
//TBAdd.Visible:=False;
|
|||
|
canshu3 := self.canshu3;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmBaoGuanInPut.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.InitPrtData();
|
|||
|
begin
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' exec P_View_BaoGuanData :BGID ');
|
|||
|
Parameters.ParamByName('BGID').Value := Trim(CDS_Main.fieldbyname('BGId').AsString);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint, CDS_Print);
|
|||
|
SInitCDSData20(ADOQueryPrint, CDS_Print);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBBGZLClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
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>.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBHTClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>غ<EFBFBD>ͬ.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>غ<EFBFBD>ͬ.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBFPClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ط<EFBFBD>Ʊ.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ط<EFBFBD>Ʊ.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBZXDClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>װ<EFBFBD>䵥.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>װ<EFBFBD>䵥.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBBGDClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ص<EFBFBD>.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ص<EFBFBD>.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBViewClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
//if cxTabControl1.TabIndex<>0 then Exit;
|
|||
|
try
|
|||
|
frmBaoGuanInPut := TfrmBaoGuanInPut.Create(Application);
|
|||
|
with frmBaoGuanInPut do
|
|||
|
begin
|
|||
|
FBCId := Trim(CDS_Main.fieldbyname('BGID').AsString);
|
|||
|
TBSave.Visible := False;
|
|||
|
ToolBar2.Visible := False;
|
|||
|
Panel1.Enabled := False;
|
|||
|
Tv1.OptionsData.Editing := False;
|
|||
|
canshu3 := self.canshu3;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmBaoGuanInPut.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBSBYSClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C>걨Ҫ<EAB1A8><D2AA>.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C>걨Ҫ<EAB1A8><D2AA>.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBSSClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 0 then
|
|||
|
Exit;
|
|||
|
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
if CANSHU3 = 'ҵ<><D2B5>Ա' then
|
|||
|
begin
|
|||
|
if trim(cds_Main.fieldbyname('filler').AsString) <> Trim(DName) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>DZ<EFBFBD><C7B1>˽<EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Status=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',SStime=getdate(),SChker=''' + Trim(DName) + '''');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('BGID<49><44>' + trim(CDS_Main.FieldByName('BGID').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBSSCXClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 1 then
|
|||
|
Exit;
|
|||
|
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if CDS_Main.FieldByName('SSel').AsBoolean = True then
|
|||
|
begin
|
|||
|
if trim(cds_Main.fieldbyname('filler').AsString) <> Trim(DName) then
|
|||
|
begin
|
|||
|
CDS_Main.EnableControls;
|
|||
|
Application.MessageBox('<27>DZ<EFBFBD><C7B1>˽<EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
// ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
exit;
|
|||
|
end;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_BaoGuan_Main ');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if Trim(ADOQueryTemp.fieldbyname('OKPerson').AsString) <> '' then
|
|||
|
begin
|
|||
|
CDS_Main.EnableControls;
|
|||
|
Application.MessageBox('<27>Ѻ˶Բ<CBB6><D4B2>ܳ<EFBFBD><DCB3><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA><D6B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
if CANSHU3 = 'ҵ<><D2B5>Ա' then
|
|||
|
begin
|
|||
|
if trim(cds_Main.fieldbyname('filler').AsString) <> Trim(DName) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>DZ<EFBFBD><C7B1>˽<EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Status=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',SStime=Null,SChker=Null');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('BGID<49><44>' + trim(CDS_Main.FieldByName('BGID').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBHDClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 1 then
|
|||
|
Exit;
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>к˶Բ<CBB6><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Status=''<27>Ѻ˶<D1BA>'',OKTime=getdate(),OKPerson=''' + Trim(DName) + '''');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBHDCXClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 2 then
|
|||
|
Exit;
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if CDS_Main.FieldByName('SSel').AsBoolean = True then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrder_BaoGuan_Main ');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if Trim(ADOQueryTemp.fieldbyname('Chker').AsString) <> '' then
|
|||
|
begin
|
|||
|
CDS_Main.EnableControls;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>ܳ<EFBFBD><DCB3><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>к˶Գ<CBB6><D4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Status=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',OKtime=Null,OKPerson=Null');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBSHClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 1 then
|
|||
|
Exit;
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA><D6B4><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Status=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',ChkTime=getdate(),Chker=''' + Trim(DName) + '''');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('BGID<49><44>' + trim(CDS_Main.FieldByName('BGID').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBSHCXClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 2 then
|
|||
|
Exit;
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA><D6B4><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set Status=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',ChkTime=Null,Chker=Null');
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD>س<EFBFBD><D8B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('BGID<49><44>' + trim(CDS_Main.FieldByName('BGID').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TBAllClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney, BZZH, FimageFile, FZMFile: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.rmf';
|
|||
|
InitPrtData();
|
|||
|
FimageFile := ExtractFilePath(Application.ExeName) + 'Image\' + Trim(CDS_Print.FieldByName('A1ChuKouShang').AsString) + '.jpg';
|
|||
|
//RMXLSExport1:= TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
if RM1.CanExport = true then
|
|||
|
begin
|
|||
|
FZMFile := 'C:\Users\Administrator\Desktop';
|
|||
|
if not DirectoryExists(FZMFile) then
|
|||
|
begin
|
|||
|
FZMFile := 'C:\Documents and Settings\Administrator\<5C><><EFBFBD><EFBFBD>\' + trim(CDS_Main.fieldbyname('A4FPNO').AsString) + ' ' + trim(CDS_Main.fieldbyname('A5ConNO').AsString) + '.xls';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FZMFile := 'C:\Users\Administrator\Desktop\' + trim(CDS_Main.fieldbyname('A4FPNO').AsString) + ' ' + trim(CDS_Main.fieldbyname('A5ConNO').AsString) + '.XLS';
|
|||
|
end;
|
|||
|
RM1.ExportTo(RMXLSExport1, FZMFile);
|
|||
|
end;
|
|||
|
RM1.CanExport := true;
|
|||
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
RM1.CanExport := False;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\ȫ<><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
begin
|
|||
|
InitSubGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
FDY := '0';
|
|||
|
panel3.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 2 then
|
|||
|
Exit;
|
|||
|
// if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
// begin
|
|||
|
// Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
// Exit;
|
|||
|
// end;
|
|||
|
MovePanel1.Visible := True;
|
|||
|
|
|||
|
B7DaoHuoGang.Text := Trim(CDS_Main.fieldbyname('B7DaoHuoGang').AsString);
|
|||
|
Edit2.Text := Trim(CDS_Main.fieldbyname('A4FPNO').AsString);
|
|||
|
if CDS_Main.fieldbyname('bgdate').AsString = '' then
|
|||
|
begin
|
|||
|
bgdate.DateTime := SGetServerDateTime(ADOQueryTemp);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
bgdate.DateTime := CDS_Main.fieldbyname('bgdate').asdatetime;
|
|||
|
end;
|
|||
|
htdate.DateTime := CDS_Main.fieldbyname('htdate').asdatetime;
|
|||
|
chuandate.DateTime := CDS_Main.fieldbyname('chuandate').asdatetime;
|
|||
|
// if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA><D6B4><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
// Exit;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.Button1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set bgStatus=''<27><>''');
|
|||
|
sql.Add(',bgdate=' + quotedstr(FormatDateTime('yyyy-MM-dd', bgdate.DateTime)));
|
|||
|
sql.add(',htdate=' + quotedstr(FormatDateTime('yyyy-MM-dd', htdate.DateTime)));
|
|||
|
sql.Add(',A4FPNO=' + quotedstr(Trim(Edit2.Text)));
|
|||
|
sql.Add(',B7DaoHuoGang=' + quotedstr(Trim(B7DaoHuoGang.Text)));
|
|||
|
sql.add(',chuandate=' + quotedstr(FormatDateTime('yyyy-MM-dd', chuandate.DateTime)));
|
|||
|
sql.Add(',guixing=' + quotedstr(Trim(guixing.Text)));
|
|||
|
sql.Add(',huodai=' + quotedstr(Trim(huodai.Text)));
|
|||
|
sql.Add(',tdno=' + quotedstr(Trim(tdno.Text)));
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>')));
|
|||
|
sql.Add(',' + quotedstr(trim('BGID<49><44>' + trim(CDS_Main.FieldByName('BGID').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.Button2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
MovePanel1.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.huodaiBtnClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
FWZ: Integer;
|
|||
|
begin
|
|||
|
fsj := Trim(TEdit(Sender).Hint);
|
|||
|
FWZ := Pos('/', fsj);
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := Copy(fsj, 1, FWZ - 1);
|
|||
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.B7DaoHuoGangBtnClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
FWZ: Integer;
|
|||
|
begin
|
|||
|
fsj := Trim(TEdit(Sender).Hint);
|
|||
|
FWZ := Pos('/', fsj);
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := Copy(fsj, 1, FWZ - 1);
|
|||
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.BtnEditA1BtnClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
FWZ: Integer;
|
|||
|
begin
|
|||
|
fsj := Trim(TEdit(Sender).Hint);
|
|||
|
FWZ := Pos('/', fsj);
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := Copy(fsj, 1, FWZ - 1);
|
|||
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.Button7Click(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile, FTaiTou: string;
|
|||
|
EngMoney, LBName, fImagePath2: string;
|
|||
|
begin
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
LBName := RadioGroup2.Items.Strings[RadioGroup2.ItemIndex];
|
|||
|
if canshu3 = 'ҵ<><D2B5>Ա' then
|
|||
|
begin
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '(ҵ<><D2B5>).rmf';
|
|||
|
ExportFtErpFile(Trim(LBName) + '(ҵ<><D2B5>).rmf', ADOQueryPrint);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '.rmf';
|
|||
|
ExportFtErpFile(Trim(LBName) + '.rmf', ADOQueryPrint);
|
|||
|
end;
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete TBSubID where DName=''' + Trim(DCode) + '''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('SELECT * FROM TBSubID where 1=2 ');
|
|||
|
open;
|
|||
|
end;
|
|||
|
|
|||
|
CDS_Main.DisableControls;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Fieldbyname('Ssel').AsBoolean then
|
|||
|
begin
|
|||
|
|
|||
|
ADOQueryCmd.append;
|
|||
|
ADOQueryCmd.fieldbyname('SubId').Value := Trim(CDS_Main.fieldbyname('bgid').AsString);
|
|||
|
ADOQueryCmd.fieldbyname('Dname').Value := Trim(DCode);
|
|||
|
ADOQueryCmd.post;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
except
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
if LBName = '<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec P_Print_BGD4 ');
|
|||
|
|
|||
|
SQL.ADD('@DCODE=''' + Trim(DCode) + '''');
|
|||
|
// ShowMessage(SQL.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint, CDS_Print);
|
|||
|
SInitCDSData20(ADOQueryPrint, CDS_Print);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec P_Print_BGD2 ');
|
|||
|
|
|||
|
SQL.ADD('@DCODE=''' + Trim(DCode) + '''');
|
|||
|
// ShowMessage(SQL.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint, CDS_Print);
|
|||
|
SInitCDSData20(ADOQueryPrint, CDS_Print);
|
|||
|
end;
|
|||
|
|
|||
|
RMXLSExport1 := TRMXLSExport.Create(RMXLSExport1);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
if FDY = '0' then
|
|||
|
begin
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
Sleep(1000);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else if FDY = '1' then
|
|||
|
begin
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
fImagePath2 := ExtractFilePath(Application.ExeName) + 'image\label0001.xls';
|
|||
|
if FileExists(fImagePath2) then
|
|||
|
DeleteFile(fImagePath2); //label.xls
|
|||
|
fImagePath2 := ExtractFilePath(Application.ExeName) + 'image\' + Trim(CDS_Main.fieldbyname('orderno').AsString) + '.xls';
|
|||
|
ShowMessage(fImagePath2);
|
|||
|
RM1.PrepareReport;
|
|||
|
Sleep(1000);
|
|||
|
RM1.ExportTo(RMXLSExport1, fImagePath2);
|
|||
|
end;
|
|||
|
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
// Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ص<EFBFBD>.rmf'), '<27><>ʾ', 0);
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + trim(fPrintFile)), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.Image1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
panel3.Visible := false;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.ToolButton3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if cxTabControl1.TabIndex <> 2 then
|
|||
|
Exit;
|
|||
|
if CDS_Main.Locate('SSel', True, []) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
CDS_Main.DisableControls;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while Locate('SSel', True, []) = True do
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate JYOrder_BaoGuan_Main Set bgStatus=NULL');
|
|||
|
|
|||
|
sql.Add(' where BGID=''' + Trim(CDS_Main.fieldbyname('BGID').AsString) + '''');
|
|||
|
|
|||
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',getdate() ');
|
|||
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ȷ<EFBFBD><C8B7>')));
|
|||
|
sql.Add(',' + quotedstr(trim('BGID<49><44>' + trim(CDS_Main.FieldByName('BGID').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
CDS_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
InitGrid();
|
|||
|
except
|
|||
|
CDS_Main.EnableControls;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.TV1DblClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if (cxTabControl1.TabIndex <> 0) and (cxTabControl1.TabIndex <> 1) then
|
|||
|
Exit;
|
|||
|
|
|||
|
try
|
|||
|
frmBaoGuanInPut := TfrmBaoGuanInPut.Create(Application);
|
|||
|
with frmBaoGuanInPut do
|
|||
|
begin
|
|||
|
FBCId := Trim(CDS_Main.fieldbyname('BGID').AsString);
|
|||
|
if (Trim(Self.Caption) = '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>') and (cxTabControl1.TabIndex = 1) then
|
|||
|
begin
|
|||
|
ToolButton4.Visible := True;
|
|||
|
end;
|
|||
|
//TBDel.Visible:=False;
|
|||
|
//TBAdd.Visible:=False;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmBaoGuanInPut.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.btn1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
RadioGroup2.Items.Clear;
|
|||
|
RadioGroup2.Items.Add('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
RadioGroup2.Items.Add('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
FDY := '0';
|
|||
|
panel3.Visible := True;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.btn2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
FDY := '1';
|
|||
|
panel3.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.ZordernoChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmBaoGuanList.ZordernoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
// 2123
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|