836 lines
24 KiB
ObjectPascal
836 lines
24 KiB
ObjectPascal
|
|
unit U_YGYPZZChkList_BGYPSQSS;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
|||
|
|
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
|
|||
|
|
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
|||
|
|
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
|
|||
|
|
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,
|
|||
|
|
Menus, cxButtonEdit, cxDropDownEdit, cxPC, ActnMan, ActnColorMaps;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmYGYPZZChkList_BGYPSQSS = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBFind: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
TBExport: TToolButton;
|
|||
|
|
Order_Main: TClientDataSet;
|
|||
|
|
TBView: TToolButton;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
TCXTJ: TToolButton;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
v1GangWei: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
v1BGUnit: TcxGridDBColumn;
|
|||
|
|
v1Dept: TcxGridDBColumn;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
order_Sub: TClientDataSet;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
v1SQDate: TcxGridDBColumn;
|
|||
|
|
v1BGQty: TcxGridDBColumn;
|
|||
|
|
TTiJiao: TToolButton;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
v1BGName: TcxGridDBColumn;
|
|||
|
|
v1BGNote: TcxGridDBColumn;
|
|||
|
|
v1SQStatus: TcxGridDBColumn;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
v1Ssel: TcxGridDBColumn;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
BGName: TEdit;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
V2Chker: TcxGridDBColumn;
|
|||
|
|
V2Chktime: TcxGridDBColumn;
|
|||
|
|
V2Chkstatus: TcxGridDBColumn;
|
|||
|
|
V2chkNote: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
v1SQType: TcxGridDBColumn;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
TAdd: TToolButton;
|
|||
|
|
TEdit: TToolButton;
|
|||
|
|
TDel: TToolButton;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
YGName: TEdit;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure TBFindClick(Sender: TObject);
|
|||
|
|
procedure TBExportClick(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
|
procedure TBViewClick(Sender: TObject);
|
|||
|
|
procedure CustomerNoNameChange(Sender: TObject);
|
|||
|
|
procedure TCXTJClick(Sender: TObject);
|
|||
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure TTiJiaoClick(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure BGNameChange(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure TAddClick(Sender: TObject);
|
|||
|
|
procedure TEditClick(Sender: TObject);
|
|||
|
|
procedure TDelClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
canshu1:string;
|
|||
|
|
DQdate:TDateTime;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitForm();
|
|||
|
|
function DelData():Boolean;
|
|||
|
|
procedure setstatus();
|
|||
|
|
procedure GengXinBMKC();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FFInt,FCloth:Integer;
|
|||
|
|
Ftype:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmYGYPZZChkList_BGYPSQSS: TfrmYGYPZZChkList_BGYPSQSS;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_RTFun,U_ZDYHelp, U_YGYPInPut,
|
|||
|
|
U_ZDYHelpSel,U_YGYPInput_BGYPSH;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.GengXinBMKC();
|
|||
|
|
var maxno: string;
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from OA_YG_DangAN_BGYPCK where BGSubID='''+Trim(Order_Main.fieldbyname('BGSubid').AsString)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.isempty then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxno,'CK','OA_YG_DangAN_BGYPCK',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno:=ADOQueryCmd.fieldbyname('CKID').asstring;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from OA_YG_DangAN_BGYPCK where CKID='''+Trim(maxno)+'''');
|
|||
|
|
Open;
|
|||
|
|
if isempty then
|
|||
|
|
begin
|
|||
|
|
append;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
edit;
|
|||
|
|
fieldbyname('CKID').Value:=trim(Maxno);
|
|||
|
|
fieldbyname('CKDate').AsDateTime:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
fieldbyname('CKQty').Value:=Order_Main.fieldbyname('BGQty').asfloat;
|
|||
|
|
fieldbyname('CKUnit').value:=Order_Main.fieldbyname('BGUnit').AsString;
|
|||
|
|
fieldbyname('BGSubID').value:=Order_Main.fieldbyname('BGSubID').AsString;
|
|||
|
|
fieldbyname('LYName').AsString:=Order_Main.fieldbyname('YGName').AsString;
|
|||
|
|
fieldbyname('DeptType').AsString:=Order_Main.fieldbyname('ZDept').AsString;
|
|||
|
|
fieldbyname('CKName').AsString:=Order_Main.fieldbyname('BGName').AsString;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.setstatus();
|
|||
|
|
begin
|
|||
|
|
TAdd.Visible:=False;
|
|||
|
|
TEdit.Visible:=False;
|
|||
|
|
TDel.Visible:=False;
|
|||
|
|
TTiJiao.Visible:=False;
|
|||
|
|
TCXTJ.Visible:=False;
|
|||
|
|
ToolButton1.visible:=False;
|
|||
|
|
Toolbutton2.Visible:=False;
|
|||
|
|
ToolButton3.Visible:=False;
|
|||
|
|
case cxTabControl1.TabIndex of
|
|||
|
|
0:begin
|
|||
|
|
ToolButton1.Visible:=true;
|
|||
|
|
Toolbutton2.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
1:begin
|
|||
|
|
ToolButton3.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
2:begin
|
|||
|
|
TTIJiao.Visible:=True;
|
|||
|
|
TAdd.Visible:=True;
|
|||
|
|
TEdit.Visible:=True;
|
|||
|
|
TDel.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
3:begin
|
|||
|
|
TCXTJ.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmYGYPZZChkList_BGYPSQSS:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
canshu1:=Trim(DParameters1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
WriteCxGrid('Ա<><D4B1><EFBFBD>칫<EFBFBD>б<EFBFBD>',Tv1,'OA<4F><41><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.InitGrid();
|
|||
|
|
var FDEPT,ZDept: string;
|
|||
|
|
Fint: Integer;
|
|||
|
|
begin
|
|||
|
|
//if trim(DParameters1)='<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
//begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.* from OA_YG_DangAn A ');
|
|||
|
|
sql.Add('inner join SY_Dept B on A.DPID=B.DPID');
|
|||
|
|
SQL.Add('where isnull(A.YGEName,YGName)='''+trim(DName)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FDEPT:=ADOQuery1.fieldbyname('DPParent').AsString;
|
|||
|
|
for Fint:=2 to ADOQuery1.fieldbyname('DPlevel').AsInteger-1 do
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from SY_Dept where DPID='''+trim(FDEPT)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FDEPT:=Trim(ADOQueryCmd.fieldbyname('DPParent').AsString);
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.IsEmpty=False then
|
|||
|
|
ZDept:=trim(ADOQueryCmd.fieldbyname('DPName').asstring);
|
|||
|
|
//end;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.*,C.* ');
|
|||
|
|
sql.Add(' from OA_YG_DangAN_BGYP A ');
|
|||
|
|
sql.add(' inner join OA_YG_DangAN_BGYP_Sub B on B.BGMainid=A.BGMainid ');
|
|||
|
|
sql.add(' inner join OA_YG_DangAN C on C.YGID=A.YGID ');
|
|||
|
|
sql.add(' where A.ZDept='''+Trim(ZDept)+'''');
|
|||
|
|
if (cxTabControl1.TabIndex<>0) and (cxTabControl1.TabIndex<>2) then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and A.SQDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
|||
|
|
sql.Add(' and A.SQDate<='''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex=0 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and isnull(B.SQStatus,'''')=''<27><><EFBFBD>ύ'' ');
|
|||
|
|
end else
|
|||
|
|
if cxTabControl1.TabIndex=1 then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and isnull(B.SQStatus,'''')=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'' ');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.tabIndex=2 then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and A.SQName='''+trim(DName)+'''');
|
|||
|
|
sql.add(' and (isnull(B.SQStatus,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' or isnull(B.SQStatus,'''')=''<27><>ͨ<EFBFBD><CDA8>'')');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.tabIndex=3 then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and A.SQName='''+trim(DName)+'''');
|
|||
|
|
sql.add(' and (isnull(B.SQStatus,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' or isnull(B.SQStatus,'''')=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'')');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.tabIndex=4 then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and A.SQName='''+trim(DName)+'''');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
TBFind.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.InitForm();
|
|||
|
|
begin
|
|||
|
|
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
BegDate.Date:=EndDate.Date-7;
|
|||
|
|
ReadCxGrid('Ա<><D4B1><EFBFBD>칫<EFBFBD>б<EFBFBD>',Tv1,'OA<4F><41><EFBFBD><EFBFBD>');
|
|||
|
|
setStatus();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TBFindClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active=False then Exit;
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmYGYPZZChkList_BGYPSQSS.DelData():Boolean;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Result:=false;
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Delete OA_YG_DangAn where YGId='''+Trim(Order_Main.fieldbyname('YGId').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Delete OA_YG_DangAn_Other where YGId='''+Trim(Order_Main.fieldbyname('YGId').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Delete TP_File where WBId='''+Trim(Order_Main.fieldbyname('YGId').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''YG'' ');
|
|||
|
|
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 TfrmYGYPZZChkList_BGYPSQSS.TBExportClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then Exit;
|
|||
|
|
TcxGridToExcel('Ա<><D4B1><EFBFBD><EFBFBD>н<EFBFBD>б<EFBFBD>',cxGrid1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitForm();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.CheckBox2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TBViewClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
frmYGYPInPut_BGYPSH:=TfrmYGYPInPut_BGYPSH.create(self);
|
|||
|
|
with frmYGYPInPut_BGYPSH do
|
|||
|
|
begin
|
|||
|
|
TBSave.Visible:=False;
|
|||
|
|
FBGMainID:=trim(Order_Main.fieldbyname('BGMainID').AsString);
|
|||
|
|
if showModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.CustomerNoNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active=False then Exit;
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TCXTJClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
if Order_Main.Locate('Ssel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if order_Main.FieldByName('SQStatus').AsString='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('Update OA_YG_DangAN_BGYP_Sub Set SQStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' where BGSubID='''+Order_Main.fieldbyname('BGSubID').AsString+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('delete from OA_Chk ');
|
|||
|
|
sql.Add(' where Mainid='''+Order_Main.fieldbyname('BGSubID').AsString+'''');
|
|||
|
|
sql.Add(' and isnull(OAType,'''')=''<27>칫<EFBFBD><ECB9AB><EFBFBD><EFBFBD>'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Exit;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
TBView.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
with ADOQuery2 do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.clear;
|
|||
|
|
sql.add('select A.* from OA_Chk A ');
|
|||
|
|
sql.add('where A.Mainid='''+trim(Order_Main.fieldbyname('BGSubid').AsString)+''' ');
|
|||
|
|
sql.Add('and isnull(OAType,'''')=''<27>칫<EFBFBD><ECB9AB><EFBFBD><EFBFBD>''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery2,Order_Sub);
|
|||
|
|
SInitCDSData20(ADOQuery2,Order_Sub);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TTiJiaoClick(Sender: TObject);
|
|||
|
|
var maxno: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then exit;
|
|||
|
|
if Order_Main.Locate('Ssel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
|||
|
|
with frmZDYHelpSel do
|
|||
|
|
begin
|
|||
|
|
flag:='SPR';
|
|||
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
MainType:=Trim(DName);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from SY_User where UserName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_Chk where MainId='''+Trim(Order_Main.fieldbyname('BGSubID').AsString)+'''');
|
|||
|
|
sql.Add(' and isnull(OAType,'''')=''<27>칫<EFBFBD><ECB9AB><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' and isnull(Chker,'''')='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxno,'BG','OA_Chk',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_Chk where 1=2 ');
|
|||
|
|
Open;
|
|||
|
|
append;
|
|||
|
|
FieldByName('CKID').Value:=Trim(maxno);
|
|||
|
|
FieldByName('Mainid').Value:=Trim(Order_Main.fieldbyname('BGSubID').AsString);
|
|||
|
|
FieldByName('OAType').value:='<27>칫<EFBFBD><ECB9AB><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('Chker').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update OA_YG_DangAN_BGYP_Sub set SQStatus=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add('where BGSubID='''+trim(Order_Main.fieldbyname('BGSubID').asstring)+''' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Free;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
if Order_Main.Locate('Ssel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('Update OA_YG_DangAN_BGYP_Sub Set SQStatus=''δ<>ύ'' ');
|
|||
|
|
sql.Add(' where BGSubID='''+trim(Order_Main.fieldbyname('BGSubID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from OA_YG_DangAN_BGYPCK ');
|
|||
|
|
sql.add('where BGSubID='''+trim(Order_Main.fieldbyname('BGSubid').AsString)+'''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Exit;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(Order_Main,True);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(Order_Main,False);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
setStatus();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.ToolButton2Click(Sender: TObject);
|
|||
|
|
var Fbgname:string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
if Order_Main.Locate('Ssel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>д˲<D0B4><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('SQType').AsString='<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD>벻<EFBFBD><EBB2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select AA.*,SumKCQty=(isnull(SumRKQty,0)-isnull(SumCKQty,0)) ');
|
|||
|
|
sql.add('from (select A.KCName,A.DeptType,A.KCUnit,Sum(A.KCQty) SumRKQty,');
|
|||
|
|
sql.add(' SumCKQty=(select Sum(B.CKQty) from OA_YG_DangAN_BGYPCK B where B.CKName=A.KCName and B.DeptType=A.DeptType and B.CKUnit=A.KCUnit)');
|
|||
|
|
sql.Add(' from OA_YG_DangAN_BGYPKC A ');
|
|||
|
|
sql.Add(' where A.DeptType='''+trim(Order_Main.fieldbyname('ZDept').AsString)+''' ');
|
|||
|
|
sql.add(' and A.KCName='''+trim(Order_Main.fieldbyname('BGName').AsString)+''' ');
|
|||
|
|
sql.add(' and A.RKStatus=''1'' ');
|
|||
|
|
sql.Add(' group by A.KCName,A.DeptType,A.KCUnit) AA');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
Fbgname:=trim(Order_Main.fieldbyname('BGName').AsString);
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
showMessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>'+Fbgname);
|
|||
|
|
exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.RecordCount>1 then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD>λ,<2C><><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryMain.FieldByName('SumKCQty').AsFloat<Order_Main.fieldbyname('BGQty').AsFloat then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('Update OA_Chk Set Chkstatus=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'',chker='''+trim(DName)+''',Chktime=getdate() ');
|
|||
|
|
sql.Add(' where Mainid='''+trim(Order_Main.fieldbyname('BGSubID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('Update OA_YG_DangAN_BGYP_Sub Set SQStatus=''<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>'' ');
|
|||
|
|
sql.Add(' where BGSubID='''+trim(Order_Main.fieldbyname('BGSubID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
GengXinBMKC();
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Exit;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.BGNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBFind.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then Exit;
|
|||
|
|
if Order_Main.Locate('Ssel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with Order_Main do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('Update OA_YG_DangAN_BGYP_Sub Set SQStatus=''<27><><EFBFBD>ύ'' ');
|
|||
|
|
sql.Add(' where BGSubID='''+trim(Order_Main.fieldbyname('BGSubID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from OA_YG_DangAN_BGYPCK ');
|
|||
|
|
sql.add('where BGSubID='''+trim(Order_Main.fieldbyname('BGSubid').AsString)+'''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Exit;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TAddClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmYGYPInPut_BGYPSH:=TfrmYGYPInPut_BGYPSH.create(self);
|
|||
|
|
with frmYGYPInPut_BGYPSH do
|
|||
|
|
begin
|
|||
|
|
FBGMainID:='';
|
|||
|
|
if showModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TEditClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then exit;
|
|||
|
|
frmYGYPInPut_BGYPSH:=TfrmYGYPInPut_BGYPSH.create(self);
|
|||
|
|
with frmYGYPInPut_BGYPSH do
|
|||
|
|
begin
|
|||
|
|
FBGMainID:=trim(Order_Main.fieldbyname('BGMainID').AsString);
|
|||
|
|
if showModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPZZChkList_BGYPSQSS.TDelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then exit;
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
if application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then exit;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from OA_YG_DangAN_BGYP where BGMainID='''+trim(Order_Main.fieldbyname('BGMainID').AsString)+'''');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|