903 lines
25 KiB
ObjectPascal
903 lines
25 KiB
ObjectPascal
|
|
unit U_TatWBPlanZJZK;
|
|||
|
|
|
|||
|
|
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, cxCalendar, cxButtonEdit, cxSplitter, RM_Common, RM_Class,
|
|||
|
|
RM_e_Xls, RM_Dataset, RM_System, RM_GridReport, cxTextEdit, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu, U_BaseList,
|
|||
|
|
cxPC, cxCheckBox, dxScrollbarAnnotations, Vcl.Menus, cxContainer,
|
|||
|
|
cxProgressBar, dxSkinsCore, dxSkinsDefaultPainters, dxSkinOffice2013White,
|
|||
|
|
dxSkinSharpPlus, dxSkinWXI, frxOLE, frxRich, frxBarcode, frxClass, frxDBSet,
|
|||
|
|
frxTableObject, frxExportPPTX, frxExportXLSX, frxExportBaseDialog,
|
|||
|
|
frxExportXLS;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmTatWBPlanZJZK = class(TfrmBaseList)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBFind: TToolButton;
|
|||
|
|
TBAdd: TToolButton;
|
|||
|
|
TBEdit: TToolButton;
|
|||
|
|
TBDel: TToolButton;
|
|||
|
|
TBPrint: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
GPM_1: TcxGridPopupMenu;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
DS_1: TDataSource;
|
|||
|
|
TBExport: TToolButton;
|
|||
|
|
CDS_1: TClientDataSet;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1Column2: TcxGridDBColumn;
|
|||
|
|
v1Column5: TcxGridDBColumn;
|
|||
|
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
v1Column6: TcxGridDBColumn;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
TBView: TToolButton;
|
|||
|
|
v1Column19: TcxGridDBColumn;
|
|||
|
|
v1Column21: TcxGridDBColumn;
|
|||
|
|
v1Column31: TcxGridDBColumn;
|
|||
|
|
CustName: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
|
TBEnd: TToolButton;
|
|||
|
|
TBNoEnd: TToolButton;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
btnChk: TToolButton;
|
|||
|
|
btnReChk: TToolButton;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
ToolBar2: TToolBar;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
DS_2: TDataSource;
|
|||
|
|
CDS_2: TClientDataSet;
|
|||
|
|
GPM_2: TcxGridPopupMenu;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
WB_Spec: TEdit;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
DS_3: TDataSource;
|
|||
|
|
CDS_3: TClientDataSet;
|
|||
|
|
GPM_3: TcxGridPopupMenu;
|
|||
|
|
ADO_2: TADOQuery;
|
|||
|
|
ADO_3: TADOQuery;
|
|||
|
|
PM_1: TPopupMenu;
|
|||
|
|
N5: TMenuItem;
|
|||
|
|
N6: TMenuItem;
|
|||
|
|
ToolButton5: TToolButton;
|
|||
|
|
frxXLSExport1: TfrxXLSExport;
|
|||
|
|
frxXLSXExport1: TfrxXLSXExport;
|
|||
|
|
frxPPTXExport1: TfrxPPTXExport;
|
|||
|
|
frxReportTableObject1: TfrxReportTableObject;
|
|||
|
|
frxReport1: TfrxReport;
|
|||
|
|
fRMDB_1: TfrxDBDataset;
|
|||
|
|
frxBarCodeObject1: TfrxBarCodeObject;
|
|||
|
|
frxRichObject1: TfrxRichObject;
|
|||
|
|
frxOLEObject1: TfrxOLEObject;
|
|||
|
|
cxGrid4: TcxGrid;
|
|||
|
|
Tv4: TcxGridDBTableView;
|
|||
|
|
Tv4Column1: TcxGridDBColumn;
|
|||
|
|
Tv4Column2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn34: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn36: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn37: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn38: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn39: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn40: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn41: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn42: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn43: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn44: TcxGridDBColumn;
|
|||
|
|
Tv4Column3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn35: TcxGridDBColumn;
|
|||
|
|
cxGridLevel4: TcxGridLevel;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn7: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn8: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn9: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn10: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn11: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn12: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn13: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn14: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
TbLogLook: TToolButton;
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure TBFindClick(Sender: TObject);
|
|||
|
|
procedure TBEditClick(Sender: TObject);
|
|||
|
|
procedure TBDelClick(Sender: TObject);
|
|||
|
|
procedure TBExportClick(Sender: TObject);
|
|||
|
|
procedure TBPrintClick(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure TBAddClick(Sender: TObject);
|
|||
|
|
procedure ConNoChange(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBViewClick(Sender: TObject);
|
|||
|
|
procedure OrdTypeChange(Sender: TObject);
|
|||
|
|
procedure C_CodeKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure BatchNoHZKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure CustNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure C_NameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure TBEndClick(Sender: TObject);
|
|||
|
|
procedure TBNoEndClick(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure btnChkClick(Sender: TObject);
|
|||
|
|
procedure btnReChkClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
|
procedure TV2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure N5Click(Sender: TObject);
|
|||
|
|
procedure N6Click(Sender: TObject);
|
|||
|
|
procedure ToolButton5Click(Sender: TObject);
|
|||
|
|
procedure TbLogLookClick(Sender: TObject);
|
|||
|
|
|
|||
|
|
private
|
|||
|
|
FInt, PFInt: Integer;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitCard();
|
|||
|
|
procedure InitCardYarn();
|
|||
|
|
procedure InitForm();
|
|||
|
|
// procedure PrintCar(MPCID: string);
|
|||
|
|
function DelData(): Boolean;
|
|||
|
|
procedure InitButton();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1, FCheJian: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_LabelPrint, U_TatWBPlanInPut,U_TatWBCardInPut,
|
|||
|
|
U_TatWBPlanZJZKInPut,U_TatWBPlanZJZKKaiKa ,
|
|||
|
|
U_TatWBCardInPut2, U_RPFun,U_LogInput; //U_TatWBPlanCardInPut
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.InitCard();
|
|||
|
|
begin
|
|||
|
|
with ADO_2 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.* ');
|
|||
|
|
sql.Add(' from Tat_WB_Card A ');
|
|||
|
|
sql.Add('where TWPId=' + quotedstr(trim(CDS_1.fieldbyname('TWPId').AsString)));
|
|||
|
|
sql.Add(' and WB_Type <> ''<27><><EFBFBD><EFBFBD>'' and WB_Type <> ''ϡ<><CFA1>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADO_2, CDS_2);
|
|||
|
|
SInitCDSData(ADO_2, CDS_2);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.InitCardYarn();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
with ADO_3 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.* ');
|
|||
|
|
sql.Add(' from Tat_WB_Card_Yarn A ');
|
|||
|
|
sql.Add('where WBCID=' + quotedstr(trim(CDS_2.fieldbyname('WBCID').AsString)));
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADO_3, CDS_3);
|
|||
|
|
SInitCDSData(ADO_3, CDS_3);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.InitButton();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
TBAdd.Enabled := False;
|
|||
|
|
TBEdit.Enabled := False;
|
|||
|
|
TBDel.Enabled := False;
|
|||
|
|
TBEnd.Enabled := False;
|
|||
|
|
TBNoEnd.Enabled := False;
|
|||
|
|
btnChk.Enabled := False;
|
|||
|
|
btnReChk.Enabled := False;
|
|||
|
|
if Trim(canshu1) = '¼<><C2BC>' then
|
|||
|
|
begin
|
|||
|
|
case cxTabControl1.TabIndex of
|
|||
|
|
0:
|
|||
|
|
begin
|
|||
|
|
TBAdd.Enabled := true;
|
|||
|
|
TBDel.Enabled := true;
|
|||
|
|
TBEdit.Enabled := true;
|
|||
|
|
btnChk.Enabled := true;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
1:
|
|||
|
|
begin
|
|||
|
|
TBAdd.Enabled := true;
|
|||
|
|
TBEnd.Enabled := true;
|
|||
|
|
TBEdit.Enabled := true;
|
|||
|
|
btnReChk.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
2:
|
|||
|
|
begin
|
|||
|
|
TBNoEnd.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Trim(canshu1) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
case cxTabControl1.TabIndex of
|
|||
|
|
0:
|
|||
|
|
begin
|
|||
|
|
TBAdd.Enabled := true;
|
|||
|
|
TBDel.Enabled := true;
|
|||
|
|
TBEdit.Enabled := true;
|
|||
|
|
btnChk.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
1:
|
|||
|
|
begin
|
|||
|
|
TBAdd.Enabled := true;
|
|||
|
|
TBEnd.Enabled := true;
|
|||
|
|
TBEdit.Enabled := true;
|
|||
|
|
btnReChk.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
2:
|
|||
|
|
begin
|
|||
|
|
TBNoEnd.Enabled := true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.* ');
|
|||
|
|
sql.Add(' from Tat_WB_Plan A ');
|
|||
|
|
sql.Add('where 1=1 ');
|
|||
|
|
sql.Add(' and EXISTS (SELECT * FROM Tat_WB_Spec X where X.WB_Code = A.WB_Code and X.WB_TYPE = ''<27><><EFBFBD><EFBFBD>'' )');
|
|||
|
|
case cxTabControl1.TabIndex of
|
|||
|
|
0:
|
|||
|
|
begin
|
|||
|
|
sql.Add('and isnull(Status,''0'') =''0'' ');
|
|||
|
|
end;
|
|||
|
|
1:
|
|||
|
|
begin
|
|||
|
|
sql.Add('and isnull(Status,''0'') =''9'' ');
|
|||
|
|
end;
|
|||
|
|
2:
|
|||
|
|
begin
|
|||
|
|
sql.Add('and isnull(Status,''0'') =''10'' ');
|
|||
|
|
sql.Add(' and A.FillTIme>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''');
|
|||
|
|
sql.Add(' and A.FillTIme<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
sql.add('order by A.FILLTIME DESC');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.N5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_2, True);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.N6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_2, False);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.InitForm();
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>Ῠ<EFBFBD><E1BFA8><EFBFBD><EFBFBD>');
|
|||
|
|
ReadCxGrid(trim(self.Caption) + 'Tv2', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD>Ῠ<EFBFBD><E1BFA8><EFBFBD><EFBFBD>');
|
|||
|
|
// ReadCxGrid(trim(self.Caption) + 'Tv3', Tv3, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
BegDate.DateTime := SGetServerDate(ADOQueryTemp) - 30;
|
|||
|
|
EndDate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
InitButton();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBFindClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TbLogLookClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmLogInput := TfrmLogInput.Create(Application);
|
|||
|
|
with frmLogInput do
|
|||
|
|
begin
|
|||
|
|
fWB_Code := Self.CDS_1.FieldByName('TWPId').AsString;
|
|||
|
|
fFlag := '<27>鿴';
|
|||
|
|
flogFlag := '<27><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>Ϣ<EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBNoEndClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Tat_WB_Plan SET status=''0'',Comper=null,Comptime=null ');
|
|||
|
|
sql.Add('where TWPId=' + quotedstr(trim(CDS_1.fieldbyname('TWPId').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><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_1.FieldByName('TWPId').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBEditClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
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><C6BB><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_1.FieldByName('TWPId').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTatWBPlanInPut := TfrmTatWBPlanInPut.Create(Application);
|
|||
|
|
with frmTatWBPlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FTWPId := Trim(Self.CDS_1.fieldbyname('TWPId').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
Self.CDS_1.Locate('TWPId', frmTatWBPlanInPut.FTWPId, []);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTatWBPlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBEndClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Tat_WB_Plan SET status=''10'' ,Comper=''' + trim(DName) + ''',Comptime=getdate() ');
|
|||
|
|
sql.Add('where TWPId=' + quotedstr(trim(CDS_1.fieldbyname('TWPId').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>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_1.FieldByName('TWPId').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBDelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select A.*');
|
|||
|
|
sql.Add('from Tat_WB_CARD A');
|
|||
|
|
sql.Add(' where A.WBCNO=''' + Trim(CDS_1.fieldbyname('TWPId').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD>ɾ<EFBFBD><C9BE>!', '<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
|
|||
|
|
CDS_1.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmTatWBPlanZJZK.DelData(): Boolean;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Result := false;
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete Tat_WB_Plan where TWPId=''' + Trim(CDS_1.fieldbyname('TWPId').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><C9BE>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_1.FieldByName('TWPId').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
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 TfrmTatWBPlanZJZK.TBExportClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
TcxGridToExcel('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', cxGrid1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBPrintClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
WSql: string;
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
WSql := Trim(CDS_1.fieldbyname('TWPId').AsString);
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
|||
|
|
with frmLabelPrint do
|
|||
|
|
begin
|
|||
|
|
FLMType := 'TatWBPlan';
|
|||
|
|
FFiltration1 := WSql;
|
|||
|
|
FFiltration2 := WSql;
|
|||
|
|
FFiltration3 := WSql;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
// Self.InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLabelPrint.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBAddClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmTatWBPlanZJZKInPut := TfrmTatWBPlanZJZKInPut.Create(Application);
|
|||
|
|
with frmTatWBPlanZJZKInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FTWPId := '';
|
|||
|
|
FSubId := '';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTatWBPlanZJZKInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.ConNoChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
canshu1 := Self.fParameters1;
|
|||
|
|
InitForm();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TBViewClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmTatWBPlanInPut := TfrmTatWBPlanInPut.Create(Application);
|
|||
|
|
with frmTatWBPlanInPut do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FTWPId := Trim(Self.CDS_1.fieldbyname('TWPId').AsString);
|
|||
|
|
TBSave.Visible := False;
|
|||
|
|
ToolBar3.Visible := False;
|
|||
|
|
ScrollBox1.Enabled := False;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTatWBPlanInPut.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>Ῠ<EFBFBD><E1BFA8><EFBFBD><EFBFBD>');
|
|||
|
|
WriteCxGrid(trim(self.Caption) + 'Tv2', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD>Ῠ<EFBFBD><E1BFA8><EFBFBD><EFBFBD>');
|
|||
|
|
// WriteCxGrid(trim(self.Caption) + 'Tv3', Tv3, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmTatWBPlanZJZKKaiKa := TfrmTatWBPlanZJZKKaiKa.Create(Application);
|
|||
|
|
with frmTatWBPlanZJZKKaiKa do
|
|||
|
|
begin
|
|||
|
|
FTWPId := Trim(self.CDS_1.fieldbyname('TWPId').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmTatWBPlanZJZKKaiKa.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.ToolButton3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
rtvalues: TArray<string>;
|
|||
|
|
begin
|
|||
|
|
if CDS_2.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
Tv2.OnFocusedRecordChanged := nil;
|
|||
|
|
if CDS_2.Locate('SSel', True, []) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
rtvalues := SelCDSKey(CDS_2, ['WBCID']);
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
Sql.Clear;
|
|||
|
|
Sql.Add('exec P_TatWB_Card_Del ');
|
|||
|
|
Sql.Add('@WBCIDS=' + quotedstr(Trim(rtvalues[0])));
|
|||
|
|
Sql.Add(',@DCode=' + Quotedstr(DCode));
|
|||
|
|
Sql.Add(',@DName=' + Quotedstr(DName));
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
InitCard();
|
|||
|
|
application.MessageBox('ɾ<><C9BE><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.ToolButton4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
RTValues: TArray<string>;
|
|||
|
|
begin
|
|||
|
|
if CDS_2.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
RTValues := SelCDSKey(CDS_2, ['WBCID']);
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
|||
|
|
with frmLabelPrint do
|
|||
|
|
begin
|
|||
|
|
FPreviewPrint := False;
|
|||
|
|
// case cxTabControl2.TabIndex of
|
|||
|
|
// 0:
|
|||
|
|
// begin
|
|||
|
|
// FLMType := 'TatWBCard1';
|
|||
|
|
// end;
|
|||
|
|
// 1:
|
|||
|
|
// begin
|
|||
|
|
// FLMType := 'TatWBCard2';
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
FFiltration1 := RTValues[0];
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
// Self.InitGrid();
|
|||
|
|
// with ADOQueryCmd do
|
|||
|
|
// begin
|
|||
|
|
// Close;
|
|||
|
|
// sql.Clear;
|
|||
|
|
// sql.Add('update Tat_WB_Card ');
|
|||
|
|
// sql.Add(' set PRTer=' + quotedstr(DName));
|
|||
|
|
// sql.Add(', PRTCount=PRTCount+1');
|
|||
|
|
// sql.Add(', PRTDate=getdate()');
|
|||
|
|
// sql.Add(' where WBCID in (' + WSql + ')');
|
|||
|
|
// ExecSQL;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLabelPrint.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.ToolButton5Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: integer;
|
|||
|
|
MPCID: string;
|
|||
|
|
MPrintJson: string;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if CDS_2.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if CDS_2.Locate('SSel', True, []) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
i := 0;
|
|||
|
|
with CDS_2 do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('Ssel').AsBoolean then
|
|||
|
|
begin
|
|||
|
|
if i = 0 then
|
|||
|
|
MPCID := trim(CDS_2.fieldbyname('WBCID').AsString);
|
|||
|
|
// PrintCar(trim(CDS_2.fieldbyname('PCID').AsString));
|
|||
|
|
MPrintJson := '{ "LBName": "<22>Ͻ<EFBFBD><CFBD>Ῠ","IsPreview": false, "PrtArgs": [ {"SqlStr": "EXEC P_TatWB_JZCard_Prt @Filtration=' + QuotedStr(MPCID) + ' " }, {"SqlStr": "EXEC P_TatWB_JZCard_Prt2 @Filtration=' + QuotedStr(MPCID) + '" } ] }';
|
|||
|
|
// ShowMessage(MPrintJson);
|
|||
|
|
FunPrintRmf(Application, PChar(DConString), PChar(MPrintJson));
|
|||
|
|
i := i + 1;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
SelOKNoFiler(Tv2, False);
|
|||
|
|
CDS_2.Locate('WBCID', MPCID, []);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
begin
|
|||
|
|
InitCard();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.TV2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
begin
|
|||
|
|
InitCardYarn();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.btnChkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Tat_WB_Plan SET status=''9'',chker=''' + trim(DName) + ''',Chktime=getdate() ');
|
|||
|
|
sql.Add('where TWPId=' + quotedstr(trim(CDS_1.fieldbyname('TWPId').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('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_1.FieldByName('TWPId').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
application.MessageBox('<27><>ʼ<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><>ʼʧ<CABC>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.btnReChkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_1.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Tat_WB_Plan SET status=''0'',chker=null,Chktime=null ');
|
|||
|
|
sql.Add('where TWPId=' + quotedstr(trim(CDS_1.fieldbyname('TWPId').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('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_1.FieldByName('TWPId').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼʧ<CABC>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.OrdTypeChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.C_CodeKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
TBRafresh.Click();
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.BatchNoHZKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
TBRafresh.Click();
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.CustNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
TBRafresh.Click();
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitButton();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.cxTabControl2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitCard();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmTatWBPlanZJZK.C_NameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
TBRafresh.Click();
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS(ADOQueryMain, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryMain, CDS_1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|