926 lines
26 KiB
ObjectPascal
926 lines
26 KiB
ObjectPascal
![]() |
unit U_ContractListNX;
|
|||
|
|
|||
|
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, cxPC, cxButtonEdit;
|
|||
|
|
|||
|
type
|
|||
|
TfrmContractListNX = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBAdd: TToolButton;
|
|||
|
TBEdit: TToolButton;
|
|||
|
TBDel: TToolButton;
|
|||
|
TBPrint: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
TBExport: TToolButton;
|
|||
|
v1OrdDate: TcxGridDBColumn;
|
|||
|
v1DeliveryDate: TcxGridDBColumn;
|
|||
|
v1OrdPerson1: TcxGridDBColumn;
|
|||
|
v1ConNo: TcxGridDBColumn;
|
|||
|
v1PRTColor: TcxGridDBColumn;
|
|||
|
v1MPRTCF: TcxGridDBColumn;
|
|||
|
Order_Main: TClientDataSet;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDBDataSet1: TRMDBDataSet;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
v1CustomerNoName: TcxGridDBColumn;
|
|||
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
PopupMenu1: TPopupMenu;
|
|||
|
N2: TMenuItem;
|
|||
|
v1PRTPrice: TcxGridDBColumn;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
CDS_Print: TClientDataSet;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
v1Column4: TcxGridDBColumn;
|
|||
|
PopupMenu2: TPopupMenu;
|
|||
|
N11: TMenuItem;
|
|||
|
N21: TMenuItem;
|
|||
|
N31: TMenuItem;
|
|||
|
Panel1: TPanel;
|
|||
|
Label1: TLabel;
|
|||
|
Label4: TLabel;
|
|||
|
Label5: TLabel;
|
|||
|
Label8: TLabel;
|
|||
|
Label9: TLabel;
|
|||
|
Label12: TLabel;
|
|||
|
Label13: TLabel;
|
|||
|
BegDate: TDateTimePicker;
|
|||
|
EndDate: TDateTimePicker;
|
|||
|
CustomerNoName: TEdit;
|
|||
|
ConPerson1: TEdit;
|
|||
|
MPRTCodeName: TEdit;
|
|||
|
ConNo: TEdit;
|
|||
|
MPRTKZ: TEdit;
|
|||
|
MPRTMF: TEdit;
|
|||
|
v1Column2: TcxGridDBColumn;
|
|||
|
ComboBox1: TComboBox;
|
|||
|
ToolButton4: TToolButton;
|
|||
|
cxTabControl1: TcxTabControl;
|
|||
|
tchk: TToolButton;
|
|||
|
Tnochk: TToolButton;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
TV2: TcxGridDBTableView;
|
|||
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
v1Column5: TcxGridDBColumn;
|
|||
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
v1Column6: TcxGridDBColumn;
|
|||
|
v1Column7: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
v1OrderUnit: TcxGridDBColumn;
|
|||
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
v1PriceUnit: TcxGridDBColumn;
|
|||
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
cxSplitter1: TcxSplitter;
|
|||
|
ADOQuerySub: TADOQuery;
|
|||
|
DataSource2: TDataSource;
|
|||
|
v1Column8: TcxGridDBColumn;
|
|||
|
v1Column9: TcxGridDBColumn;
|
|||
|
Label2: TLabel;
|
|||
|
KHConNO: TEdit;
|
|||
|
Label3: TLabel;
|
|||
|
Tqx: TToolButton;
|
|||
|
Tnoqx: TToolButton;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure FormCreate(Sender: TObject);
|
|||
|
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 FormShow(Sender: TObject);
|
|||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure TBTPClick(Sender: TObject);
|
|||
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView;
|
|||
|
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
|
|||
|
out AStyle: TcxStyle);
|
|||
|
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
var ADone: Boolean);
|
|||
|
procedure N1Click(Sender: TObject);
|
|||
|
procedure N2Click(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
procedure CustomerNoNameChange(Sender: TObject);
|
|||
|
procedure ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
procedure tchkClick(Sender: TObject);
|
|||
|
procedure TnochkClick(Sender: TObject);
|
|||
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
|||
|
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
|||
|
ANewItemRecordFocusingChanged: Boolean);
|
|||
|
procedure TqxClick(Sender: TObject);
|
|||
|
procedure TnoqxClick(Sender: TObject);
|
|||
|
private
|
|||
|
DQdate:TDateTime;
|
|||
|
fuserName:string;
|
|||
|
procedure InitGrid();
|
|||
|
procedure InitForm();
|
|||
|
function DelData():Boolean;
|
|||
|
procedure InitGridFH();
|
|||
|
procedure SetStatus();
|
|||
|
procedure InitSub();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
FFInt,FCloth:Integer;
|
|||
|
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmContractListNX: TfrmContractListNX;
|
|||
|
|
|||
|
implementation
|
|||
|
uses
|
|||
|
U_DataLink,U_ConInPutNX,U_Fun,U_ZDYHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
procedure TfrmContractListNX.InitSub();
|
|||
|
begin
|
|||
|
ADOQuerySub.Close;
|
|||
|
IF Order_Main.IsEmpty then exit;
|
|||
|
with ADOQuerySub do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from JYOrderCon_sub ');
|
|||
|
sql.Add('where mainID ='+quotedstr((Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
open;
|
|||
|
end;
|
|||
|
end;
|
|||
|
procedure TfrmContractListNX.SetStatus();
|
|||
|
begin
|
|||
|
tchk.Visible:=false;
|
|||
|
tnochk.Visible:=false;
|
|||
|
tbedit.Visible:=false;
|
|||
|
tbdel.Visible:=false;
|
|||
|
Tqx.Visible:=false;
|
|||
|
TNoqx.Visible:=false;
|
|||
|
if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:begin
|
|||
|
IF trim(DCode)<>'A2' then
|
|||
|
begin
|
|||
|
tbedit.Visible:=true;
|
|||
|
tbdel.Visible:=true;
|
|||
|
end;
|
|||
|
Tqx.Visible:=true;
|
|||
|
end;
|
|||
|
1:begin
|
|||
|
Tqx.Visible:=true;
|
|||
|
end;
|
|||
|
2:begin
|
|||
|
TNoqx.Visible:=true;
|
|||
|
end;
|
|||
|
3:begin
|
|||
|
end;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:begin
|
|||
|
|
|||
|
tchk.Visible:=true;
|
|||
|
tbedit.Visible:=true;
|
|||
|
tbdel.Visible:=true;
|
|||
|
Tqx.Visible:=true;
|
|||
|
end;
|
|||
|
1:begin
|
|||
|
tnochk.Visible:=true;
|
|||
|
Tqx.Visible:=true;
|
|||
|
end;
|
|||
|
2:begin
|
|||
|
TNOqx.Visible:=true;
|
|||
|
end;
|
|||
|
3:begin
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
procedure TfrmContractListNX.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmContractListNX:=nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.FormClose(Sender: TObject;
|
|||
|
var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action:=caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
cxgrid1.Align:=alClient;
|
|||
|
DQdate:=SGetServerDate(ADOQueryTemp);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,A.ConNo ConNoM ');
|
|||
|
SQL.Add(',PRTOrderQty=(select Sum(PRTOrderQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',ConMoney=(select Sum(PRTOrderQty*PRTPrice) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',OrderUnit=(select top 1 OrderUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',PriceUnit=(select top 1 PriceUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',PRTPrice=(select top 1 PRTPrice from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',case when isnull((select top 1 X.conNO from Contract_Main X where X.conNo=A.conNO) ,'''')='''' then ''<27><>'' else ''<27><>'' end as IScg ');
|
|||
|
sql.Add(' from JYOrderCon_Main A ');
|
|||
|
SQL.Add('where A.fILLtIME>='''+FormatDateTime('yyyy-MM-dd',BegDate.DateTime)+'''');
|
|||
|
SQL.Add('and A.fILLtIME<'''+FormatDateTime('yyyy-MM-dd',enddate.DateTime+1)+'''');
|
|||
|
sql.Add(' and A.MPRTType=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
sql.Add('and A.Filler='''+Trim(fuserName)+'''');
|
|||
|
end;
|
|||
|
IF cxTabControl1.TabIndex<3 then
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''0'')='''+inttostr(cxTabControl1.TabIndex)+'''');
|
|||
|
end;
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.InitGridFH();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('exec Order_QryList :MainId,:WSql');
|
|||
|
Parameters.ParamByName('WSql').Value:=' and FillTime>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+''''
|
|||
|
+' and FillTime<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''';
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.InitForm();
|
|||
|
begin
|
|||
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
|||
|
if FCloth=1 then
|
|||
|
begin
|
|||
|
v1Column4.Visible:=True;
|
|||
|
v1PRTPrice.Visible:=False;
|
|||
|
v1PRTPrice.Hidden:=True;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
v1Column4.Visible:=False;
|
|||
|
v1PRTPrice.Visible:=True;
|
|||
|
v1PRTPrice.Hidden:=False;
|
|||
|
end;
|
|||
|
BegDate.DateTime:=SGetServerDate10(ADOQueryTemp)-15;
|
|||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
|||
|
InitGrid();
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select Top 10* from JYOrderCon_Main Order by FillTime desc');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
ComboBox1.Clear;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
ComboBox1.Items.Add(Trim(ADOQueryTemp.fieldbyname('ConNO').AsString));
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.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;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBEditClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
if Trim(Order_Main.fieldbyname('Filler').AsString)<>Trim(DName) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
try
|
|||
|
frmConInPutNX:=TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState:=1;
|
|||
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBDelClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
if Trim(Order_Main.fieldbyname('Filler').AsString)<>Trim(DName) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><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
|
|||
|
Order_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmContractListNX.DelData():Boolean;
|
|||
|
begin
|
|||
|
try
|
|||
|
Result:=false;
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrderCon_Sub where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrderCon_Main where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
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 TfrmContractListNX.TBExportClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then Exit;
|
|||
|
SelExportData(Tv1,ADOQueryMain,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBPrintClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile:string;
|
|||
|
EngMoney:string;
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ.rmf' ;
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.*,ConMoney=B.PRTOrderQty*B.PRTPrice,COL=''COL:'' ');
|
|||
|
sql.Add(' from JYOrderCon_Main A inner join JYOrderCon_Sub B on A.MainId=B.MainId ');
|
|||
|
sql.Add(' where A.MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint,CDS_Print);
|
|||
|
SInitCDSData20(ADOQueryPrint,CDS_Print);
|
|||
|
//
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select TolConMoney=Sum(PRTOrderQty*PRTPrice)');
|
|||
|
sql.Add(' from JYOrderCon_Main A inner join JYOrderCon_Sub B on A.MainId=B.MainId ');
|
|||
|
sql.Add(' where A.MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
EngMoney:=num2cengnum(ADOQueryTemp.fieldbyname('TolConMoney').AsString);
|
|||
|
EngMoney:=UpperCase(EngMoney);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['EngMoney']:=EngMoney;
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
//RMVariables['printer']:=Trim(gUserName);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\Ӣ<>ĺ<EFBFBD>ͬ.rmf'),'<27><>ʾ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select Top 10* from JYOrderCon_Main Order by FillTime desc ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
ComboBox1.Clear;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
ComboBox1.Items.Add(Trim(ADOQueryTemp.fieldbyname('ConNO').AsString));
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBAddClick(Sender: TObject);
|
|||
|
var
|
|||
|
maxno:string;
|
|||
|
begin
|
|||
|
try
|
|||
|
frmConInPutNX:=TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState:=0;
|
|||
|
FMainId:='';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
fuserName:=DCode;
|
|||
|
if (trim(DCode)='A1') or (trim(DCode)='A2') then
|
|||
|
begin
|
|||
|
fuserName:='A';
|
|||
|
end;
|
|||
|
InitForm();
|
|||
|
SetStatus();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Tv1CellDblClick(
|
|||
|
Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
if ToolButton1.Visible=False then Exit;
|
|||
|
ToolButton1.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBTPClick(Sender: TObject);
|
|||
|
var
|
|||
|
FQty,FQty1,FMxQty,FPQty,FMxQtyS,FPQtyS:String;
|
|||
|
begin
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.CheckBox1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.CheckBox2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
TBRafresh.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Tv1StylesGetContentStyle(
|
|||
|
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
|
|||
|
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
var
|
|||
|
id,id10:Integer;
|
|||
|
begin
|
|||
|
{try
|
|||
|
if Tv1.GroupedItemCount=0 then
|
|||
|
begin
|
|||
|
Id:=Tv1.GetColumnByFieldName('DeliveryDate').Index-tv1.GroupedItemCount;
|
|||
|
Id10:=Tv1.GetColumnByFieldName('SubStatus').Index-tv1.GroupedItemCount;
|
|||
|
if Trim(VarToStr(ARecord.Values[id]))='' then Exit;
|
|||
|
if Id<0 then Exit;
|
|||
|
if ARecord.Values[id10]='<27><><EFBFBD><EFBFBD>' then exit;
|
|||
|
if (ARecord.Values[id]-DQdate)>=4 then Exit;
|
|||
|
if ((ARecord.Values[id]-DQdate)>=0) and ((ARecord.Values[id]-DQdate)<4) then
|
|||
|
AStyle:=DataLink_.QHuangSe
|
|||
|
else
|
|||
|
if ARecord.Values[id]-DQdate<0 then
|
|||
|
begin
|
|||
|
AStyle:=DataLink_OrderManage.FenHongS;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
except
|
|||
|
end; }
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.v1DeliveryDateCustomDrawCell(
|
|||
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
begin
|
|||
|
{ Id:=TV1.GetColumnByFieldName('DeliveryDate').Index;//;-TV1.GroupedItemCount;
|
|||
|
Id10:=TV1.GetColumnByFieldName('SubStatus').Index;
|
|||
|
if Id<0 then Exit;
|
|||
|
if AViewInfo.GridRecord.Values[Id10]='<27><><EFBFBD><EFBFBD>' then Exit;
|
|||
|
if AViewInfo.GridRecord.Values[Id]-SGetServerDate(ADOQueryTemp)>=4 then Exit;
|
|||
|
if ((AViewInfo.GridRecord.Values[id]-SGetServerDate10(ADOQueryTemp))>=0) and ((AViewInfo.GridRecord.Values[id]-SGetServerDate(ADOQueryTemp))<4) then
|
|||
|
ACanvas.Brush.Color:=clYellow
|
|||
|
else
|
|||
|
if (AViewInfo.GridRecord.Values[id])-(SGetServerDate10(ADOQueryTemp)<0) then
|
|||
|
begin
|
|||
|
ACanvas.Brush.Color:=clRed;
|
|||
|
end;
|
|||
|
begin
|
|||
|
ACanvas.Brush.Color:=clRed;
|
|||
|
end else
|
|||
|
if AViewInfo.GridRecord.Values[Id]='Purple' then
|
|||
|
begin
|
|||
|
ACanvas.Brush.Color:=clPurple;
|
|||
|
end else
|
|||
|
if AViewInfo.GridRecord.Values[Id]='Olive' then
|
|||
|
begin
|
|||
|
ACanvas.Brush.Color:=clOlive;
|
|||
|
end else
|
|||
|
if AViewInfo.GridRecord.Values[Id]='Teal' then
|
|||
|
begin
|
|||
|
ACanvas.Brush.Color:=clTeal;
|
|||
|
end else
|
|||
|
if AViewInfo.GridRecord.Values[Id]='Background' then
|
|||
|
begin
|
|||
|
ACanvas.Brush.Color:=clBackground;
|
|||
|
end; }
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.N1Click(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile:string;
|
|||
|
Porderno:string;
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>10.rmf' ;
|
|||
|
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['begindate']:=begindate.DateTime;
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
//RMVariables['printer']:=Trim(gUserName);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>10.rmf'),'<27><>ʾ',0);
|
|||
|
end;
|
|||
|
SDofilter(ADOQueryMain,'');
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
Order_Main.Locate('ordernoM',Porderno,[]);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.N2Click(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile:string;
|
|||
|
Porderno:string;
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf' ;
|
|||
|
SDofilter(ADOQueryMain,' OrderNoM='''+Trim(Order_Main.fieldbyname('OrderNoM').AsString)+'''');
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
Porderno:=Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
//RMVariables['begindate']:=begindate.DateTime;
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
//RMVariables['printtime']:=Now;
|
|||
|
//RMVariables['printer']:=Trim(gUserName);
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf'),'<27><>ʾ',0);
|
|||
|
end;
|
|||
|
SDofilter(ADOQueryMain,'');
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
Order_Main.Locate('ordernoM',Porderno,[]);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
try
|
|||
|
frmConInPutNX:=TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState:=1;
|
|||
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
ToolBar2.Visible:=False;
|
|||
|
TBSave.Visible:=False;
|
|||
|
ScrollBox1.Enabled:=False;
|
|||
|
Tv1.OptionsSelection.CellSelect:=False;
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
try
|
|||
|
frmConInPutNX:=TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState:=1;
|
|||
|
CopyInt:=99;
|
|||
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
ModalResult:=1;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.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 TfrmContractListNX.ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key=#13 then
|
|||
|
begin
|
|||
|
if Length(Tedit(Sender).Text)<1 then Exit;
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select A.*,A.ConNo ConNoM ');
|
|||
|
SQL.Add(',PRTOrderQty=(select Sum(PRTOrderQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',ConMoney=(select Sum(PRTOrderQty*PRTPrice) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',OrderUnit=(select top 1 OrderUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',PriceUnit=(select top 1 PriceUnit from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
SQL.Add(',PRTPrice=(select top 1 PRTPrice from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
sql.Add(' from JYOrderCon_Main A ');
|
|||
|
SQL.Add('where OrdDate>='''+'1899-01-01'+'''');
|
|||
|
SQL.Add('and OrdDate<'''+'2050-01-01'+'''');
|
|||
|
sql.Add(' and MPRTType=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
sql.Add('and A.Filler='''+Trim(DName)+'''');
|
|||
|
end;
|
|||
|
// sql.Add(' and ConNo like '''+'%'+Trim(ConNoM.Text)+'%'+'''');
|
|||
|
sql.Add(' and '+Tedit(Sender).Name+' like '+quotedstr(trim('%'+trim(Tedit(Sender).Text)+'%')));
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='MPRTNameType';
|
|||
|
flagname:='<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
V1HelpType.Visible:=True;
|
|||
|
V1HelpType.Caption:='<27><>д<EFBFBD><D0B4>';
|
|||
|
fnote:=True;
|
|||
|
V1Name.Caption:='<27><><EFBFBD><EFBFBD>';
|
|||
|
V1Note.Caption:='Ӣ<><D3A2>';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.tchkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrdercon_Main SET status=''1'' ');
|
|||
|
sql.Add('where mainID='+quotedstr(trim(Order_Main.fieldbyname('mainID').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><CDAC><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(','+quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>'+trim(Order_Main.FieldByName('conNo').AsString))));
|
|||
|
sql.Add(','+quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
application.MessageBox('<27><><EFBFBD>˳ɹ<CBB3><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TnochkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrdercon_Main SET status=''0'' ');
|
|||
|
sql.Add('where mainID='+quotedstr(trim(Order_Main.fieldbyname('mainID').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><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(','+quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>'+trim(Order_Main.FieldByName('conNo').AsString))));
|
|||
|
sql.Add(','+quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳ɹ<CBB3><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 TfrmContractListNX.cxTabControl1Change(Sender: TObject);
|
|||
|
begin
|
|||
|
SetStatus();
|
|||
|
TBRafresh.Click;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Tv1FocusedRecordChanged(
|
|||
|
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
|||
|
AFocusedRecord: TcxCustomGridRecord;
|
|||
|
ANewItemRecordFocusingChanged: Boolean);
|
|||
|
begin
|
|||
|
InitSub();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TqxClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrdercon_Main SET status=''2'' ');
|
|||
|
sql.Add('where mainID='+quotedstr(trim(Order_Main.fieldbyname('mainID').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>ͬȡ<CDAC><C8A1>')));
|
|||
|
sql.Add(','+quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>'+trim(Order_Main.FieldByName('conNo').AsString))));
|
|||
|
sql.Add(','+quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
application.MessageBox('<27><>ͬȡ<CDAC><C8A1><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><>ͬȡ<CDAC><C8A1>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TnoqxClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrdercon_Main SET status=''0'' ');
|
|||
|
sql.Add('where mainID='+quotedstr(trim(Order_Main.fieldbyname('mainID').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><CDAC><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>')));
|
|||
|
sql.Add(','+quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>'+trim(Order_Main.FieldByName('conNo').AsString))));
|
|||
|
sql.Add(','+quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬȡ<CDAC><C8A1><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬȡ<CDAC><C8A1>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|