1621 lines
45 KiB
ObjectPascal
1621 lines
45 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,
|
|||
|
cxTextEdit, cxDropDownEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
|||
|
dxBarBuiltInMenu;
|
|||
|
|
|||
|
type
|
|||
|
TfrmContractListNX = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBAdd: TToolButton;
|
|||
|
TBEdit: TToolButton;
|
|||
|
TBPrint: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DS_Main: TDataSource;
|
|||
|
v1OrdDate: TcxGridDBColumn;
|
|||
|
v1DeliveryDate: TcxGridDBColumn;
|
|||
|
v1OrdPerson1: TcxGridDBColumn;
|
|||
|
v1ConNo: TcxGridDBColumn;
|
|||
|
CDS_Sub: TClientDataSet;
|
|||
|
RM1: TRMGridReport;
|
|||
|
RMDBDataSet1: TRMDBDataSet;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
v1CustomerNoName: TcxGridDBColumn;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
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;
|
|||
|
BuyName: TEdit;
|
|||
|
Salesman: TEdit;
|
|||
|
MPRTCodeName: TEdit;
|
|||
|
ConNo: TEdit;
|
|||
|
MPRTKZ: TEdit;
|
|||
|
MPRTMF: TEdit;
|
|||
|
cxTabControl1: TcxTabControl;
|
|||
|
tchk: TToolButton;
|
|||
|
Tnochk: TToolButton;
|
|||
|
cxSplitter1: TcxSplitter;
|
|||
|
DS_Sub: TDataSource;
|
|||
|
v1Column8: TcxGridDBColumn;
|
|||
|
Label2: TLabel;
|
|||
|
Tqx: TToolButton;
|
|||
|
Tnoqx: TToolButton;
|
|||
|
ToolButton5: TToolButton;
|
|||
|
v1Column10: TcxGridDBColumn;
|
|||
|
v1Column12: TcxGridDBColumn;
|
|||
|
v1Column9: TcxGridDBColumn;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
CDS_Main: TClientDataSet;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
TV2: TcxGridDBTableView;
|
|||
|
v1XHNo: TcxGridDBColumn;
|
|||
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
v1Column5: TcxGridDBColumn;
|
|||
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
v1PRTColor: TcxGridDBColumn;
|
|||
|
v1Column11: TcxGridDBColumn;
|
|||
|
v1Column6: TcxGridDBColumn;
|
|||
|
v1Column7: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
v1OrderUnit: TcxGridDBColumn;
|
|||
|
v1PRTPrice: TcxGridDBColumn;
|
|||
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
v1Column2: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
btnTijiao: TToolButton;
|
|||
|
btnCXTijiao: TToolButton;
|
|||
|
V2Column1: TcxGridDBColumn;
|
|||
|
V2Column2: TcxGridDBColumn;
|
|||
|
v1Column13: TcxGridDBColumn;
|
|||
|
Label3: TLabel;
|
|||
|
Filler: TEdit;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
btnSXChk: TToolButton;
|
|||
|
btnSXChkCX: TToolButton;
|
|||
|
Panel3: TPanel;
|
|||
|
Label25: TLabel;
|
|||
|
btnChk: TButton;
|
|||
|
Button3: TButton;
|
|||
|
MMDZ: TMemo;
|
|||
|
edtOrderNo: TEdit;
|
|||
|
v1Column14: TcxGridDBColumn;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
btn1: TToolButton;
|
|||
|
btn2: TToolButton;
|
|||
|
cxTabControl2: TcxTabControl;
|
|||
|
TV2Column1: TcxGridDBColumn;
|
|||
|
Tv1Column3: TcxGridDBColumn;
|
|||
|
Tv1Column4: TcxGridDBColumn;
|
|||
|
Label22: TLabel;
|
|||
|
HTTYPE: TComboBox;
|
|||
|
Tv1Column5: TcxGridDBColumn;
|
|||
|
Tv1Column6: TcxGridDBColumn;
|
|||
|
CheckBox1: TCheckBox;
|
|||
|
ToolButton4: TToolButton;
|
|||
|
Panel2: TPanel;
|
|||
|
Label6: TLabel;
|
|||
|
Button1: TButton;
|
|||
|
Button2: TButton;
|
|||
|
Edit1: TEdit;
|
|||
|
Label7: TLabel;
|
|||
|
Edit2: TEdit;
|
|||
|
Label26: TLabel;
|
|||
|
ComboBox1: TComboBox;
|
|||
|
Button4: TButton;
|
|||
|
Label10: TLabel;
|
|||
|
jsfs: TComboBox;
|
|||
|
Tv1Column7: TcxGridDBColumn;
|
|||
|
Label11: TLabel;
|
|||
|
ComboBox2: TComboBox;
|
|||
|
Button5: TButton;
|
|||
|
Label14: TLabel;
|
|||
|
ComboBox3: TComboBox;
|
|||
|
Button6: TButton;
|
|||
|
Label15: TLabel;
|
|||
|
code: TEdit;
|
|||
|
ToolButton6: TToolButton;
|
|||
|
Panel4: TPanel;
|
|||
|
Label16: TLabel;
|
|||
|
Label17: TLabel;
|
|||
|
Button7: TButton;
|
|||
|
Button8: TButton;
|
|||
|
Edit3: TEdit;
|
|||
|
Edit4: TEdit;
|
|||
|
Label18: TLabel;
|
|||
|
Edit5: TEdit;
|
|||
|
Button9: TButton;
|
|||
|
Tv1Column8: TcxGridDBColumn;
|
|||
|
ToolButton7: TToolButton;
|
|||
|
ToolButton8: TToolButton;
|
|||
|
Tv1Column9: TcxGridDBColumn;
|
|||
|
Panel5: TPanel;
|
|||
|
Label19: TLabel;
|
|||
|
Button10: TButton;
|
|||
|
Button11: TButton;
|
|||
|
Memo1: TMemo;
|
|||
|
Edit6: TEdit;
|
|||
|
ToolButton9: TToolButton;
|
|||
|
Label20: TLabel;
|
|||
|
ComboBox4: TComboBox;
|
|||
|
TV2Column2: TcxGridDBColumn;
|
|||
|
Tv1Column10: TcxGridDBColumn;
|
|||
|
Tv1Column11: TcxGridDBColumn;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure TBFindClick(Sender: TObject);
|
|||
|
procedure TBEditClick(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 CheckBox1Click(Sender: TObject);
|
|||
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure BuyNameChange(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);
|
|||
|
procedure ToolButton5Click(Sender: TObject);
|
|||
|
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
procedure btnTijiaoClick(Sender: TObject);
|
|||
|
procedure btnCXTijiaoClick(Sender: TObject);
|
|||
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
procedure btnSXChkClick(Sender: TObject);
|
|||
|
procedure btnSXChkCXClick(Sender: TObject);
|
|||
|
procedure btnChkClick(Sender: TObject);
|
|||
|
procedure Button3Click(Sender: TObject);
|
|||
|
procedure btn1Click(Sender: TObject);
|
|||
|
procedure btn2Click(Sender: TObject);
|
|||
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
procedure Button2Click(Sender: TObject);
|
|||
|
procedure Button4Click(Sender: TObject);
|
|||
|
procedure Button5Click(Sender: TObject);
|
|||
|
procedure Button6Click(Sender: TObject);
|
|||
|
procedure Button7Click(Sender: TObject);
|
|||
|
procedure Button8Click(Sender: TObject);
|
|||
|
procedure ToolButton6Click(Sender: TObject);
|
|||
|
procedure Button9Click(Sender: TObject);
|
|||
|
procedure ToolButton7Click(Sender: TObject);
|
|||
|
procedure ToolButton8Click(Sender: TObject);
|
|||
|
procedure Button10Click(Sender: TObject);
|
|||
|
procedure Button11Click(Sender: TObject);
|
|||
|
procedure ToolButton9Click(Sender: TObject);
|
|||
|
procedure ComboBox4Change(Sender: TObject);
|
|||
|
private
|
|||
|
procedure InitGrid();
|
|||
|
procedure InitForm();
|
|||
|
procedure SetStatus();
|
|||
|
procedure InitSub();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
FFInt, FCloth: Integer;
|
|||
|
canshu1, FGSTT: string;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
//var
|
|||
|
// frmContractListNX: TfrmContractListNX;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_ConInPutNX, U_Fun, U_ZDYHelp, U_FjList_RZ, U_SysLogHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
procedure TfrmContractListNX.InitSub();
|
|||
|
begin
|
|||
|
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from SalesContract_sub ');
|
|||
|
sql.Add('where mainID =' + quotedstr((CDS_Main.fieldbyname('mainID').AsString)));
|
|||
|
open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryTemp, CDS_Sub);
|
|||
|
SInitCDSData20(ADOQueryTemp, CDS_Sub);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.SetStatus();
|
|||
|
begin
|
|||
|
TBAdd.Visible := false;
|
|||
|
tbedit.Visible := false;
|
|||
|
ToolButton2.Visible := false;
|
|||
|
tchk.Visible := false;
|
|||
|
tnochk.Visible := false;
|
|||
|
Tqx.Visible := false;
|
|||
|
TNoqx.Visible := false;
|
|||
|
TBPrint.Visible := False;
|
|||
|
btnTijiao.Visible := False;
|
|||
|
btnCXTijiao.Visible := False;
|
|||
|
btnSXChk.Visible := False;
|
|||
|
btnSXChkCX.Visible := False;
|
|||
|
|
|||
|
btn1.Visible := False;
|
|||
|
btn2.Visible := False;
|
|||
|
|
|||
|
v1PRTPrice.Visible := true;
|
|||
|
v1PRTPrice.hidden := false;
|
|||
|
ToolButton6.Visible := false;
|
|||
|
|
|||
|
ToolButton7.Visible := False;
|
|||
|
ToolButton8.Visible := False;
|
|||
|
ToolButton9.Visible := False;
|
|||
|
if Trim(canshu1) = '¼<><C2BC>' then
|
|||
|
begin
|
|||
|
ToolButton2.Visible := true;
|
|||
|
TBAdd.Visible := true;
|
|||
|
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
tbedit.Visible := true;
|
|||
|
Tqx.Visible := True;
|
|||
|
btnTijiao.Visible := True;
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
btnCXTijiao.Visible := True;
|
|||
|
end;
|
|||
|
2:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
3:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
4:
|
|||
|
begin
|
|||
|
|
|||
|
TBPrint.Visible := true;
|
|||
|
end;
|
|||
|
5:
|
|||
|
begin
|
|||
|
|
|||
|
TBPrint.Visible := true;
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
TNoqx.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(canshu1) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
v1PRTPrice.Visible := False;
|
|||
|
v1PRTPrice.hidden := true;
|
|||
|
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
|
|||
|
tchk.Visible := True;
|
|||
|
end;
|
|||
|
2:
|
|||
|
begin
|
|||
|
tnochk.Visible := True;
|
|||
|
|
|||
|
end;
|
|||
|
3:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
4:
|
|||
|
begin
|
|||
|
|
|||
|
TBPrint.Visible := true;
|
|||
|
end;
|
|||
|
5:
|
|||
|
begin
|
|||
|
|
|||
|
TBPrint.Visible := true;
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
TNoqx.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(canshu1) = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
TBAdd.Visible := true;
|
|||
|
ToolButton9.Visible := True;
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
2:
|
|||
|
begin
|
|||
|
ToolButton7.Visible := true;
|
|||
|
end;
|
|||
|
3:
|
|||
|
begin
|
|||
|
ToolButton8.Visible := true;
|
|||
|
end;
|
|||
|
4:
|
|||
|
begin
|
|||
|
TBPrint.Visible := true;
|
|||
|
btnSXChkCX.Visible := true;
|
|||
|
end;
|
|||
|
5:
|
|||
|
begin
|
|||
|
TBPrint.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
TNoqx.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(canshu1) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
TBAdd.Visible := true;
|
|||
|
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
2:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
3:
|
|||
|
begin
|
|||
|
btnSXChk.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
4:
|
|||
|
begin
|
|||
|
btnSXChkCX.Visible := true;
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
TNoqx.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if Trim(canshu1) = '<27><><EFBFBD>۾<EFBFBD><DBBE><EFBFBD>' then
|
|||
|
begin
|
|||
|
TBAdd.Visible := true;
|
|||
|
ToolButton6.Visible := True;
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
btnTijiao.Visible := True;
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
btnCXTijiao.Visible := True;
|
|||
|
tchk.Visible := True;
|
|||
|
end;
|
|||
|
2:
|
|||
|
begin
|
|||
|
Tnochk.Visible := True;
|
|||
|
ToolButton7.Visible := true;
|
|||
|
end;
|
|||
|
3:
|
|||
|
begin
|
|||
|
ToolButton8.Visible := true;
|
|||
|
btnSXChk.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
4:
|
|||
|
begin
|
|||
|
btnSXChkCX.Visible := true;
|
|||
|
btn1.Visible := true;
|
|||
|
end;
|
|||
|
5:
|
|||
|
begin
|
|||
|
btn2.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
TNoqx.Visible := true;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
|
|||
|
4:
|
|||
|
begin
|
|||
|
|
|||
|
TBPrint.Visible := True;
|
|||
|
end;
|
|||
|
5:
|
|||
|
begin
|
|||
|
TBPrint.Visible := True;
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
TNoqx.Visible := true;
|
|||
|
|
|||
|
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.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
writeCxGrid(self.Caption + tv1.Name, Tv1, '<27><><EFBFBD>ۺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
writeCxGrid(self.Caption + tv2.Name, Tv2, '<27><><EFBFBD>ۺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered := False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*');
|
|||
|
sql.Add(',ISSC=cast((case when isnull((select count(WBID) from TP_File X where X.WBID=A.maiNID and X.TFType=''<27><>ͬ''),0)>0 then 1 else 0 end) as bit)');
|
|||
|
SQL.Add(',STUFF(( SELECT '', '' +convert(VARCHAR, SCSCode) FROM SalesContract_sub b where b.mainid=a.mainid FOR XML PATH('''')), 1, 1, '''') AS code');
|
|||
|
sql.Add(' from SalesContract_Main A ');
|
|||
|
SQL.Add('where A.OrdDate>=''' + FormatDateTime('yyyy-MM-dd', BegDate.DateTime) + '''');
|
|||
|
SQL.Add('and A.OrdDate<''' + FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1) + '''');
|
|||
|
sql.Add(' and A.SCMType=''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
if CheckBox1.Checked = True then
|
|||
|
begin
|
|||
|
sql.Add('and sfdj=''<27><>''');
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(canshu1) = '¼<><C2BC>' then
|
|||
|
begin
|
|||
|
sql.Add('and ( A.Salesman=' + Quotedstr(Trim(DName)) + ' or A.XSZL=' + Quotedstr(Trim(DName)) + ' or A.FILLER=' + Quotedstr(Trim(DName)) + ') ');
|
|||
|
end;
|
|||
|
if trim(canshu1) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
sql.Add('and a.filler in (select username from SY_User S where S.UDEPT=(SELECT UDEPT FROM SY_User U WHERE U.USERNAME= ' + QUOTEDSTR(Trim(DName)));
|
|||
|
SQL.Add('))');
|
|||
|
end;
|
|||
|
if ComboBox4.Text = 'δ<>ŵ<EFBFBD>' then
|
|||
|
begin
|
|||
|
SQL.Add('AND NOT EXISTS ( select X.MainId from JYOrder_Main X where x.conno=a.conno) ');
|
|||
|
end;
|
|||
|
if ComboBox4.Text = '<27><><EFBFBD>ŵ<EFBFBD>' then
|
|||
|
begin
|
|||
|
SQL.Add('AND EXISTS ( select X.MainId from JYOrder_Main X where x.conno=a.conno) ');
|
|||
|
end;
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''-1''');
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''0''');
|
|||
|
end;
|
|||
|
2:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''1''');
|
|||
|
end;
|
|||
|
3:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''4''');
|
|||
|
end;
|
|||
|
4:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''2''');
|
|||
|
end;
|
|||
|
5:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''3''');
|
|||
|
end;
|
|||
|
6:
|
|||
|
begin
|
|||
|
sql.Add(' and isnull(A.status,''-1'')=''9''');
|
|||
|
end;
|
|||
|
end;
|
|||
|
// showmessage(sql.text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.InitForm();
|
|||
|
begin
|
|||
|
readCxGrid(self.Caption + tv1.Name, Tv1, '<27><><EFBFBD>ۺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
readCxGrid(self.Caption + tv2.Name, Tv2, '<27><><EFBFBD>ۺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>');
|
|||
|
if canshu1 = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
cxTabControl2.Visible := True;
|
|||
|
cxTabControl1.Visible := False;
|
|||
|
cxTabControl1.TabIndex := 1;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
cxTabControl2.Visible := false;
|
|||
|
cxTabControl1.Visible := True;
|
|||
|
end;
|
|||
|
if FCloth = 1 then
|
|||
|
begin
|
|||
|
v1Column4.Visible := True;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
v1Column4.Visible := False;
|
|||
|
end;
|
|||
|
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
|||
|
BegDate.DateTime := EndDate.DateTime - 90;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from SY_User where username=' + QuotedStr(Trim(DName)));
|
|||
|
Open;
|
|||
|
end;
|
|||
|
CheckBox1.Visible := False;
|
|||
|
Tv1Column6.Visible := False;
|
|||
|
Tv1Column6.Hidden := True;
|
|||
|
ToolButton4.Visible := False;
|
|||
|
if ADOQueryTemp.fieldbyname('udept').AsString = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
CheckBox1.Visible := True;
|
|||
|
Tv1Column6.Visible := True;
|
|||
|
Tv1Column6.Hidden := False;
|
|||
|
ToolButton4.Visible := True;
|
|||
|
end;
|
|||
|
InitGrid();
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBFindClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active = False then
|
|||
|
Exit;
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBEditClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
if Trim(CDS_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 := '<27><EFBFBD>';
|
|||
|
FMainId := Trim(Self.CDS_Main.fieldbyname('MainId').AsString);
|
|||
|
canshu1 := self.canshu1;
|
|||
|
FGSTT := self.FGSTT;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBPrintClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
EngMoney: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ.rmf';
|
|||
|
ExportFtErpFile('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ.rmf', ADOQueryTemp);
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.*,B.*,ISDJ=(CASE WHEN SFDJ=''<27><>'' then dingjing else '''' end) ');
|
|||
|
SQL.Add(',note1=(case when isnull(ZhiLiangNote,'''')<>'''' then ''<27><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>''+ZhiLiangNote else '''' end)');
|
|||
|
sql.Add('+'' ''+(case when isnull(YSBiaoZhunNote,'''')<>'''' then ''<27><><EFBFBD>ձ<EFBFBD><EFBFBD><D7BC>''+YSBiaoZhunNote else '''' end)');
|
|||
|
sql.Add('+'' ''+(case when isnull(PZFYNote,'''')<>'''' then ''<27><>װҪ<D7B0><EFBFBD><F3BCB0B7>ã<EFBFBD>''+PZFYNote else '''' end)');
|
|||
|
sql.Add('+'' ''+(case when isnull(Payment,'''')<>'''' then ''<27><><EFBFBD>ʽ<EEB7BD><CABD>''+Payment else '''' end)');
|
|||
|
SQL.Add('+'' ''+(case when isnull(JHNote,'''')<>'''' then ''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>''+JHNote else '''' end)');
|
|||
|
sql.Add('+'' ''+(case when isnull(ChuanYangNote,'''')<>'''' then ''<27><><EFBFBD>䷽ʽ<E4B7BD><CABD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD>''+ChuanYangNote else '''' end)');
|
|||
|
sql.Add('+'' ''+(case when isnull(YiYiNote,'''')<>'''' then ''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''+YiYiNote else '''' end)');
|
|||
|
// SQL.Add(',HXHZ=STUFF(( SELECT '';'' +convert(VARCHAR, SCSHX) FROM SalesContract_Sub C where C.MAINID=A.MAINID FOR XML PATH('''')), 1, 1, '''')') ;
|
|||
|
sql.Add(' from SalesContract_Main A inner join SalesContract_Sub B on A.MainId=B.MainId ');
|
|||
|
sql.Add(' where A.MainId=''' + Trim(CDS_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
sql.Add(' order by B.XHNo ');
|
|||
|
// ShowMessage(SQL.Text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
// RMVariables['EngMoney']:=EngMoney;
|
|||
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
|
|||
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
RM1.ShowReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + fPrintFile), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TBAddClick(Sender: TObject);
|
|||
|
var
|
|||
|
maxno: string;
|
|||
|
begin
|
|||
|
try
|
|||
|
frmConInPutNX := TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState := '<27><><EFBFBD><EFBFBD>';
|
|||
|
FMainId := '';
|
|||
|
canshu1 := self.canshu1;
|
|||
|
FGSTT := self.FGSTT;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
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.CheckBox1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.CheckBox2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
TBRafresh.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
frmConInPutNX := TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState := '<27>鿴';
|
|||
|
FMainId := Trim(Self.CDS_Main.fieldbyname('MainId').AsString);
|
|||
|
FGSTT := self.FGSTT;
|
|||
|
ToolBar2.Visible := False;
|
|||
|
TBSave.Visible := False;
|
|||
|
ScrollBox1.Enabled := False;
|
|||
|
Tv1.OptionsSelection.CellSelect := False;
|
|||
|
canshu1 := self.canshu1;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
frmConInPutNX := TfrmConInPutNX.Create(Application);
|
|||
|
with frmConInPutNX do
|
|||
|
begin
|
|||
|
PState := '<27><><EFBFBD><EFBFBD>';
|
|||
|
FMainId := Trim(Self.CDS_Main.fieldbyname('MainId').AsString);
|
|||
|
canshu1 := self.canshu1;
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmConInPutNX.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.BuyNameChange(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active = False then
|
|||
|
Exit;
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.tchkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
edtOrderNo.Text := trim(CDS_Main.FieldByName('conno').AsString);
|
|||
|
MMDZ.Text := trim(CDS_Main.FieldByName('chkNote').AsString);
|
|||
|
|
|||
|
Panel3.Visible := True;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.TnochkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
if CDS_Main.fieldbyname('SFXP').AsString = '<27><>' then
|
|||
|
begin
|
|||
|
sql.Add('update SalesContract_Main SET status=''-1'',Chktime=null,Chker=null ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_Main.fieldbyname('mainID').AsString)));
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
sql.Add('update SalesContract_Main SET status=''0'',Chktime=null,Chker=null ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_Main.fieldbyname('mainID').AsString)));
|
|||
|
end;
|
|||
|
|
|||
|
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(CDS_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 CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''9'' ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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(CDS_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 CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''-1'' ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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(CDS_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;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton5Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
Exit;
|
|||
|
try
|
|||
|
frmFjList_RZ := TfrmFjList_RZ.Create(Application);
|
|||
|
with frmFjList_RZ do
|
|||
|
begin
|
|||
|
fkeyNO := Trim(Self.CDS_Main.fieldbyname('MainId').AsString);
|
|||
|
fType := '<27><>ͬ';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmFjList_RZ.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Tv1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
begin
|
|||
|
if AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('status').Index] = '9' then
|
|||
|
ACanvas.Brush.Color := clLime;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.btnTijiaoClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
if CDS_Main.fieldbyname('SFXP').AsString = '<27><>' then
|
|||
|
begin
|
|||
|
|
|||
|
sql.Add('update SalesContract_Main SET status=''1'',Chktime=getdate(),Chker=''<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_Main.fieldbyname('mainID').AsString)));
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
sql.Add('update SalesContract_Main SET status=''0'' ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_Main.fieldbyname('mainID').AsString)));
|
|||
|
end;
|
|||
|
|
|||
|
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>ύ')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').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>ύʧ<E1BDBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.btnCXTijiaoClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''-1'' ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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>ύ')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString))));
|
|||
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ύʧ<E1BDBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
frmSysLogHelp := TfrmSysLogHelp.create(self);
|
|||
|
with frmSysLogHelp do
|
|||
|
begin
|
|||
|
fModel := self.caption;
|
|||
|
showmodal;
|
|||
|
free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.btnSXChkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear; //(CASE WHEN SALESCLASS in (''<27><><EFBFBD><EFBFBD>6'') then ''3'' else ''2'' end )
|
|||
|
sql.Add('update SalesContract_Main SET status=''2'',Chktime2=getdate(),Chker2=' + quotedstr(trim(DName)));
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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(CDS_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.btnSXChkCXClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''-1'',Chktime2=null,Chker2=null,Chktime=null,Chker=null,Chktime4=null,Chker4=null ');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><DBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_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.btnChkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
if CDS_Main.Locate('conno', Trim(edtOrderNo.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''1'',Chktime=getdate(),Chker=' + quotedstr(trim(DName)));
|
|||
|
sql.Add(',ChkNote=' + quotedstr(trim(MMDZ.Text)));
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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(CDS_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;
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.btn1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''3'',Chktime3=getdate(),Chker3=' + quotedstr(trim(DName)));
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><DBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_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.btn2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''2'',Chktime3=NULL,Chker3=NULL');
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><DBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').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 TfrmContractListNX.cxTabControl2Change(Sender: TObject);
|
|||
|
begin
|
|||
|
cxTabControl1.TabIndex := cxTabControl2.TabIndex + 1;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel2.Visible := True;
|
|||
|
Edit1.Text := CDS_Main.fieldbyname('conno').AsString;
|
|||
|
edit2.Text := CDS_Main.fieldbyname('dingjing').AsString;
|
|||
|
ComboBox1.Text := CDS_Main.fieldbyname('HTTYPE').AsString;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button1Click(Sender: TObject);
|
|||
|
var
|
|||
|
freal: Double;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
if TryStrToFloat(edit2.Text, freal) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('ʵ<>ս<EFBFBD><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if CDS_Main.Locate('conno', Trim(edit1.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET ssdj=' + (trim(edit2.Text)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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('ʵ<>ն<EFBFBD><D5B6><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString) + '<27><><EFBFBD><EFBFBD>:' + trim(Edit2.Text))));
|
|||
|
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;
|
|||
|
Panel2.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel2.Visible := False;
|
|||
|
TBRafresh.Click
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button4Click(Sender: TObject);
|
|||
|
var
|
|||
|
freal: Double;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
if CDS_Main.Locate('conno', Trim(edit1.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET httype=' + QuotedStr(trim(ComboBox1.Text)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><CDAC><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString) + '<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>:' + trim(ComboBox1.Text))));
|
|||
|
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;
|
|||
|
Panel2.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button5Click(Sender: TObject);
|
|||
|
var
|
|||
|
freal: Double;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
if CDS_Main.Locate('conno', Trim(edit1.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET SFDJ=' + QuotedStr(trim(ComboBox2.Text)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><CDAC><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString) + '<27>Ƿ<C7B7>:' + trim(ComboBox2.Text))));
|
|||
|
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;
|
|||
|
Panel2.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button6Click(Sender: TObject);
|
|||
|
var
|
|||
|
freal: Double;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
if CDS_Main.Locate('conno', Trim(edit1.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET JSFS=' + QuotedStr(trim(ComboBox3.Text)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><CDAC><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString) + '<27><><EFBFBD>㷽ʽ:' + trim(ComboBox3.Text))));
|
|||
|
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;
|
|||
|
Panel2.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button7Click(Sender: TObject);
|
|||
|
var
|
|||
|
freal: Double;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
if Trim(Edit4.Text) = '' then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if CDS_Main.Locate('conno', Trim(edit3.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET note=' + QuotedStr(trim(edit4.Text)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><>ע')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString) + '<27><>ע:' + trim(Edit4.Text))));
|
|||
|
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;
|
|||
|
Panel2.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button8Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel4.Visible := False;
|
|||
|
TBRafresh.Click
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton6Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel4.Visible := True;
|
|||
|
Edit3.Text := CDS_Main.fieldbyname('conno').AsString;
|
|||
|
edit4.Text := CDS_Main.fieldbyname('note').AsString;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button9Click(Sender: TObject);
|
|||
|
var
|
|||
|
freal: Double;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
|
|||
|
if Trim(Edit5.Text) = '' then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if CDS_Main.Locate('conno', Trim(edit3.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET zjlnote=' + QuotedStr(trim(edit5.Text)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><DCBE><EFBFBD><EFBFBD><EFBFBD>ע')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').AsString) + '<27><>ע:' + trim(edit5.Text))));
|
|||
|
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;
|
|||
|
Panel2.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton7Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=(CASE WHEN SALESCLASS in (''<27><><EFBFBD><EFBFBD>1'',''<27><><EFBFBD><EFBFBD>6'') then ''2'' else ''4'' end ),Chktime4=getdate(),chker4=' + quotedstr(trim(DName)));
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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(CDS_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.ToolButton8Click(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET status=''-1'',Chktime2=null,Chker2=null,Chktime=null,Chker=null,Chktime4=null,Chker4=null ');
|
|||
|
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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><C8B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_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.Button10Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
if CDS_Main.Locate('conno', Trim(Edit6.Text), []) = False then
|
|||
|
begin
|
|||
|
application.MessageBox('<27><>ͬ<EFBFBD><CDAC>λʧ<CEBB>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update SalesContract_Main SET ');
|
|||
|
sql.Add('DDNOTE=' + quotedstr(trim(Memo1.Text)));
|
|||
|
sql.Add('where mainID=' + quotedstr(trim(CDS_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>ע')));
|
|||
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(CDS_Main.FieldByName('conNo').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><>עʧ<D7A2>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
Panel5.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.Button11Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel5.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ToolButton9Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
edit6.Text := trim(CDS_Main.FieldByName('conno').AsString);
|
|||
|
memo1.Text := trim(CDS_Main.FieldByName('ddnote').AsString);
|
|||
|
|
|||
|
Panel5.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListNX.ComboBox4Change(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|