1114 lines
31 KiB
ObjectPascal
1114 lines
31 KiB
ObjectPascal
![]() |
unit U_ContractListPB;
|
|||
|
|
|||
|
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, RM_E_llPDF, cxDropDownEdit, cxTextEdit,
|
|||
|
cxContainer, cxCurrencyEdit;
|
|||
|
|
|||
|
type
|
|||
|
TfrmContractListPB = 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;
|
|||
|
v1MPRTCF: TcxGridDBColumn;
|
|||
|
Order_Main: TClientDataSet;
|
|||
|
RMDBDataSet1: TRMDBDataSet;
|
|||
|
RMXLSExport1: TRMXLSExport;
|
|||
|
v1CustomerNoName: TcxGridDBColumn;
|
|||
|
v1PRTOrderQty: TcxGridDBColumn;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
TBCopy: TToolButton;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
CDS_Print: TClientDataSet;
|
|||
|
v1Column4: TcxGridDBColumn;
|
|||
|
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;
|
|||
|
cxTabControl1: TcxTabControl;
|
|||
|
tchk: TToolButton;
|
|||
|
Tnochk: TToolButton;
|
|||
|
cxSplitter1: TcxSplitter;
|
|||
|
ADOQuerySub: TADOQuery;
|
|||
|
DataSource2: TDataSource;
|
|||
|
v1Column8: TcxGridDBColumn;
|
|||
|
Label2: TLabel;
|
|||
|
KHConNO: TEdit;
|
|||
|
Label3: TLabel;
|
|||
|
Tqx: TToolButton;
|
|||
|
Tnoqx: TToolButton;
|
|||
|
ToolButton5: TToolButton;
|
|||
|
v1Column10: TcxGridDBColumn;
|
|||
|
v1Column11: TcxGridDBColumn;
|
|||
|
v1Column12: TcxGridDBColumn;
|
|||
|
//RMllPDFExport1: TRMllPDFExport;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv2: TcxGridDBTableView;
|
|||
|
v1XHNo: TcxGridDBColumn;
|
|||
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
v1Column5: TcxGridDBColumn;
|
|||
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
v1Column6: TcxGridDBColumn;
|
|||
|
v1Column7: TcxGridDBColumn;
|
|||
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
v1OrderUnit: TcxGridDBColumn;
|
|||
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
cxGridDBColumn10: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
ClientDataSet2: TClientDataSet;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
CDS_Note: TClientDataSet;
|
|||
|
v2Column2: TcxGridDBColumn;
|
|||
|
RM1: TRMGridReport;
|
|||
|
v1Column22: TcxGridDBColumn;
|
|||
|
Label6: TLabel;
|
|||
|
XSType: TComboBox;
|
|||
|
RMDBDataSet2: TRMDBDataSet;
|
|||
|
v2Column3: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
v1Column9: TcxGridDBColumn;
|
|||
|
v1Column13: TcxGridDBColumn;
|
|||
|
Label7: TLabel;
|
|||
|
Label10: TLabel;
|
|||
|
PrtCode: TEdit;
|
|||
|
PrtCodeName: TEdit;
|
|||
|
v2Column4: TcxGridDBColumn;
|
|||
|
v2Column5: TcxGridDBColumn;
|
|||
|
v1Column15: TcxGridDBColumn;
|
|||
|
twc: TToolButton;
|
|||
|
tnowc: TToolButton;
|
|||
|
tnochkkf: TToolButton;
|
|||
|
tchkkf: TToolButton;
|
|||
|
v1Column16: TcxGridDBColumn;
|
|||
|
v1Column17: TcxGridDBColumn;
|
|||
|
v2Column6: TcxGridDBColumn;
|
|||
|
v1Column18: TcxGridDBColumn;
|
|||
|
v1Column19: TcxGridDBColumn;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
v1Column20: TcxGridDBColumn;
|
|||
|
v1Column21: TcxGridDBColumn;
|
|||
|
v1Column23: TcxGridDBColumn;
|
|||
|
Panel5: TPanel;
|
|||
|
Label28: TLabel;
|
|||
|
Button5: TButton;
|
|||
|
Button6: TButton;
|
|||
|
edtjdps: TcxCurrencyEdit;
|
|||
|
Label11: TLabel;
|
|||
|
edtjdQty: TcxCurrencyEdit;
|
|||
|
Label14: TLabel;
|
|||
|
edtjdreason: TEdit;
|
|||
|
lblConno: TLabel;
|
|||
|
Label15: TLabel;
|
|||
|
//RMllPDFExport1: TRMllPDFExport;
|
|||
|
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 CheckBox1Click(Sender: TObject);
|
|||
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
procedure N1Click(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure TBCopyClick(Sender: TObject);
|
|||
|
procedure CustomerNoNameChange(Sender: TObject);
|
|||
|
procedure tchkClick(Sender: TObject);
|
|||
|
procedure TnochkClick(Sender: TObject);
|
|||
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
procedure TqxClick(Sender: TObject);
|
|||
|
procedure TnoqxClick(Sender: TObject);
|
|||
|
procedure ToolButton5Click(Sender: TObject);
|
|||
|
procedure Tv1CustomDrawCell(Sender: TcxCustomGridTableView;
|
|||
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|||
|
var ADone: Boolean);
|
|||
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
|||
|
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
|||
|
ANewItemRecordFocusingChanged: Boolean);
|
|||
|
procedure twcClick(Sender: TObject);
|
|||
|
procedure tnowcClick(Sender: TObject);
|
|||
|
procedure tchkkfClick(Sender: TObject);
|
|||
|
procedure tnochkkfClick(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
procedure Button5Click(Sender: TObject);
|
|||
|
procedure Button6Click(Sender: TObject);
|
|||
|
private
|
|||
|
DQdate:TDateTime;
|
|||
|
fuserName,canshu2:string;
|
|||
|
procedure InitGrid();
|
|||
|
procedure InitForm();
|
|||
|
function DelData():Boolean;
|
|||
|
procedure SetStatus();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
FFInt,FCloth:Integer;
|
|||
|
canshu1:string;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
//var
|
|||
|
//frmContractListNX: TfrmContractListNX;
|
|||
|
|
|||
|
implementation
|
|||
|
uses
|
|||
|
U_DataLink,U_ConInPutNX,U_Fun,U_ZDYHelp, U_FjList_RZ;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmContractListPB.SetStatus();
|
|||
|
begin
|
|||
|
tchk.Visible:=false;
|
|||
|
tnochk.Visible:=false;
|
|||
|
tchkkf.Visible:=false;
|
|||
|
tnochkkf.Visible:=false;
|
|||
|
TBAdd.Visible:=false;
|
|||
|
TBCopy.Visible:=false;
|
|||
|
tbedit.Visible:=false;
|
|||
|
tbdel.Visible:=false;
|
|||
|
Tqx.Visible:=false;
|
|||
|
TNoqx.Visible:=false;
|
|||
|
twc.Visible:=false;
|
|||
|
tnowc.Visible:=false;
|
|||
|
if Trim(canshu1)='<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
TBAdd.Visible:=true;
|
|||
|
TBCopy.Visible:=true;
|
|||
|
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
|
|||
|
twc.Visible:=true;
|
|||
|
end;
|
|||
|
3:begin
|
|||
|
TNOqx.Visible:=true;
|
|||
|
end;
|
|||
|
4:begin
|
|||
|
tnowc.Visible:=true;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end
|
|||
|
else if Trim(canshu1)='¼<><C2BC>' then
|
|||
|
begin
|
|||
|
TBAdd.Visible:=true;
|
|||
|
TBCopy.Visible:=true;
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:begin
|
|||
|
tbedit.Visible:=true;
|
|||
|
tbdel.Visible:=true;
|
|||
|
Tqx.Visible:=true;
|
|||
|
end;
|
|||
|
1:begin
|
|||
|
|
|||
|
end;
|
|||
|
2:begin
|
|||
|
twc.Visible:=true;
|
|||
|
end;
|
|||
|
3:begin
|
|||
|
TNOqx.Visible:=true;
|
|||
|
end;
|
|||
|
4:begin
|
|||
|
tnowc.Visible:=true;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end
|
|||
|
else if Trim(canshu1)='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:begin
|
|||
|
|
|||
|
end;
|
|||
|
1:begin
|
|||
|
tchkkf.Visible:=true;
|
|||
|
end;
|
|||
|
2:begin
|
|||
|
tnochkkf.Visible:=true;
|
|||
|
end;
|
|||
|
3:begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
procedure TfrmContractListPB.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
//frmContractListNX:=nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.FormClose(Sender: TObject;
|
|||
|
var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action:=caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
cxgrid1.Align:=alClient;
|
|||
|
DQdate:=SGetServerDate(ADOQueryTemp);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
Close;
|
|||
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ11',Tv2,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' select A.* ');
|
|||
|
sql.Add(',FHPS=(select sum(X.FHPSHZ) from FHSQ_Main X where X.ConMainId=A.MainId ) ');
|
|||
|
sql.Add(',Case when isnull((select count(*) from TP_File where WBID=A.MainID and TFType=''<27><>ͬ'' ),0)>0 ');
|
|||
|
sql.Add('then Cast(1 as bit) else Cast(0 as bit) end as FJFlag');
|
|||
|
sql.Add(',PrtCode=cast((select distinct '' ''+JCS.PrtCode from JYOrderCon_Sub_PB JCS where JCS.MainId=A.MainId for xml path('''')) as varchar(150))');
|
|||
|
sql.Add(',PrtCodeName=cast((select distinct '' ''+JCS.PrtCodeName from JYOrderCon_Sub_PB JCS where JCS.MainId=A.MainId for xml path('''')) as varchar(150))');
|
|||
|
sql.Add(',Case when isnull((select count(*) from Cloth_Main where ConMainId=A.MainID ),0)>0 ');
|
|||
|
sql.Add('then Cast(1 as bit) else Cast(0 as bit) end as JHDFlag');
|
|||
|
sql.Add(',ConPiShu=(select Sum(PiShu) from JYOrderCon_Sub_PB X where X.MainId=A.MainId)');
|
|||
|
sql.Add(' from JYOrderCon_Main_PB A where 1=1');
|
|||
|
sql.Add(' and A.FillTIme>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.DateTime))+'''');
|
|||
|
sql.Add(' and A.FillTIme<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.DateTime+1))+'''');
|
|||
|
{ if Trim(canshu1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
SQL.Add(' and A.FillerCode='''+Trim(DCode)+'''');
|
|||
|
end; }
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:begin
|
|||
|
SQL.Add(' and isnull(A.status,''0'')=''0''');
|
|||
|
end;
|
|||
|
1:begin
|
|||
|
SQL.Add(' and isnull(A.status,''0'')=''1''');
|
|||
|
end;
|
|||
|
2:begin
|
|||
|
SQL.Add(' and isnull(A.status,''0'')=''4''');
|
|||
|
end;
|
|||
|
3:begin
|
|||
|
SQL.Add(' and isnull(A.status,''0'')=''2''');
|
|||
|
end;
|
|||
|
4:begin
|
|||
|
SQL.Add(' and isnull(A.status,''0'')=''3''');
|
|||
|
end;
|
|||
|
end;
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
procedure TfrmContractListPB.InitForm();
|
|||
|
begin
|
|||
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ11',Tv2,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
|||
|
|
|||
|
EndDate.DateTime:=SGetServerDate10(ADOQueryTemp);
|
|||
|
BegDate.DateTime:=EndDate.DateTime-60;
|
|||
|
//InitGrid();
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.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 TfrmContractListPB.TBEditClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
if Trim(canshu1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
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;
|
|||
|
end;
|
|||
|
if Trim(canshu1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
if cxTabControl1.TabIndex<>0 then 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 TfrmContractListPB.TBDelClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
if cxTabControl1.TabIndex<>0 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;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from Cloth_Main where ConMainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryTemp.IsEmpty=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from FHSQ_Main where ConMainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOQueryTemp.IsEmpty=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
if DelData() then
|
|||
|
begin
|
|||
|
Order_Main.Delete;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmContractListPB.DelData():Boolean;
|
|||
|
begin
|
|||
|
try
|
|||
|
Result:=false;
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrderCon_Sub_PB where MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete JYOrderCon_Main_PB 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 TfrmContractListPB.TBExportClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then Exit;
|
|||
|
SelExportData(Tv1,ADOQueryMain,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD>б<EFBFBD>');
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.TBPrintClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile,FeeStr:string;
|
|||
|
EngMoney:string;
|
|||
|
Fint,i,j:Integer;
|
|||
|
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.* ');
|
|||
|
sql.Add(' from JYOrderCon_Main_PB A inner join JYOrderCon_Sub_PB 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 ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select MNote=RTrim(B.MNote),XHInt=Cast(XHNo as int),XHStr=Cast(Null as varchar(20)),B.MNID ');
|
|||
|
sql.Add(',A.SYRAddress,A.TelNo,A.FaxNo,A.BankName,A.BankNo,A.CTMAddress,A.CTMTelNo,A.CTMFaxNo');
|
|||
|
sql.Add(' from JYOrderCon_Main_PB A left join JYOrderCon_Main_Note_PB B on A.MainId=B.MainId ');
|
|||
|
sql.Add(' where A.MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryPrint,CDS_Note);
|
|||
|
SInitCDSData20(ADOQueryPrint,CDS_Note);
|
|||
|
if (CDS_Note.RecordCount=1) and (Trim(CDS_Note.fieldbyname('MNID').AsString)='') then
|
|||
|
begin
|
|||
|
begin
|
|||
|
with CDS_Note do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('XHInt').Value:=Null;
|
|||
|
FieldByName('XHStr').Value:=Null;
|
|||
|
FieldByName('MNote').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>˫<EFBFBD><CBAB><EFBFBD>Ѻ<EFBFBD>Э<EFBFBD>̣<EFBFBD>Э<EFBFBD>̲<EFBFBD><CCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>ط<EFBFBD>Ժ<EFBFBD><D4BA>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD><EFBFBD>ɿ<F2B2BBBF><C9BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>ΥԼ<CEA5><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD>̣<EFBFBD>';
|
|||
|
Post;
|
|||
|
end;
|
|||
|
CopyAddRowCDS(CDS_Note);
|
|||
|
with CDS_Note do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('XHInt').Value:=Null;
|
|||
|
FieldByName('XHStr').Value:=Null;
|
|||
|
FieldByName('MNote').Value:='<27><><EFBFBD><EFBFBD>ͬһʽ<D2BB><CABD><EFBFBD><EFBFBD>,˫<><CBAB><EFBFBD><EFBFBD>ִһ<D6B4><D2BB>,<2C><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ʽͬΪ<CDAC><CEAA>Ч,˫<><CBAB>ǩ<EFBFBD><C7A9>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
CopyAddRowCDS(CDS_Note);
|
|||
|
|
|||
|
with CDS_Note do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('XHInt').Value:=Null;
|
|||
|
FieldByName('XHStr').Value:=Null;
|
|||
|
FieldByName('MNote').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>˫<EFBFBD><CBAB><EFBFBD>Ѻ<EFBFBD>Э<EFBFBD>̣<EFBFBD>Э<EFBFBD>̲<EFBFBD><CCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><CBBF>ŵ<EFBFBD><C5B5>ط<EFBFBD>Ժ<EFBFBD><D4BA>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD><EFBFBD>ɿ<F2B2BBBF><C9BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɺ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>ΥԼ<CEA5><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD>̣<EFBFBD>';
|
|||
|
Post;
|
|||
|
end;
|
|||
|
CopyAddRowCDS(CDS_Note);
|
|||
|
with CDS_Note do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('XHInt').Value:=Null;
|
|||
|
FieldByName('XHStr').Value:=Null;
|
|||
|
FieldByName('MNote').Value:='<27><><EFBFBD><EFBFBD>ͬһʽ<D2BB><CABD><EFBFBD><EFBFBD>,˫<><CBAB><EFBFBD><EFBFBD>ִһ<D6B4><D2BB>,<2C><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ʽͬΪ<CDAC><CEAA>Ч,˫<><CBAB>ǩ<EFBFBD><C7A9>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Fint:=CDS_Note.RecordCount;
|
|||
|
i:=7;
|
|||
|
if Fint=2 then
|
|||
|
begin
|
|||
|
with CDS_Note do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
i:=i+1;
|
|||
|
Edit;
|
|||
|
if i=8 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='<27>ˡ<EFBFBD>';
|
|||
|
end else
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='<27>š<EFBFBD>';
|
|||
|
end;
|
|||
|
Post;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end else
|
|||
|
begin
|
|||
|
with CDS_Note do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
i:=i+1;
|
|||
|
Edit;
|
|||
|
if i=8 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='<27>ˡ<EFBFBD>';
|
|||
|
end else
|
|||
|
if i=9 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='<27>š<EFBFBD>';
|
|||
|
end else
|
|||
|
if i=10 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮ<><CAAE>';
|
|||
|
end else
|
|||
|
if i=11 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮһ<CAAE><D2BB>';
|
|||
|
end else
|
|||
|
if i=12 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮ<><CAAE><EFBFBD><EFBFBD>';
|
|||
|
end else
|
|||
|
if i=13 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮ<><CAAE><EFBFBD><EFBFBD>';
|
|||
|
end else
|
|||
|
if i=14 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮ<>ġ<EFBFBD>';
|
|||
|
end else
|
|||
|
if i=15 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮ<>塢';
|
|||
|
end else
|
|||
|
if i=16 then
|
|||
|
begin
|
|||
|
FieldByName('XHStr').Value:='ʮ<><CAAE><EFBFBD><EFBFBD>';
|
|||
|
end;
|
|||
|
Post;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['EngMoney']:=EngMoney;
|
|||
|
//RMVariables['FeeStr']:=FeeStr;
|
|||
|
//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><EFBFBD><EFBFBD>ͬ.rmf'),'<27><>ʾ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.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 TfrmContractListPB.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
fuserName:=DCode;
|
|||
|
InitForm();
|
|||
|
SetStatus();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.CheckBox1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.CheckBox2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
TBRafresh.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.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 TfrmContractListPB.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 TfrmContractListPB.TBCopyClick(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 TfrmContractListPB.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 TfrmContractListPB.tchkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB 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 TfrmContractListPB.TnochkClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB 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 TfrmContractListPB.cxTabControl1Change(Sender: TObject);
|
|||
|
begin
|
|||
|
SetStatus();
|
|||
|
TBRafresh.Click;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.TqxClick(Sender: TObject);
|
|||
|
var
|
|||
|
str: string;
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
if InputQuery('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1>ԭ<EFBFBD><D4AD>', '<27><><EFBFBD><EFBFBD>', str) then
|
|||
|
begin
|
|||
|
if trim(str)<>'' then
|
|||
|
begin
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB SET status=''2'',qxdate=getdate() ');
|
|||
|
sql.Add(',qxnote='+quotedstr(trim(str)));
|
|||
|
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
|
|||
|
else
|
|||
|
begin
|
|||
|
application.MessageBox('δ<><CEB4><EFBFBD>뱸ע<EBB1B8><D7A2>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.TnoqxClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB 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;
|
|||
|
|
|||
|
procedure TfrmContractListPB.ToolButton5Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then Exit;
|
|||
|
try
|
|||
|
frmFjList_RZ:=TfrmFjList_RZ.Create(Application);
|
|||
|
with frmFjList_RZ do
|
|||
|
begin
|
|||
|
// PState:=1;
|
|||
|
//if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then cxButton1.Visible:=false;
|
|||
|
if Self.cxTabControl1.TabIndex<>0 then cxButton1.Visible:=false;
|
|||
|
fkeyNO:=Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
fType:='<27><>ͬ';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmFjList_RZ.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.Tv1CustomDrawCell(
|
|||
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|||
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
begin
|
|||
|
IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('status').Index]='2' then
|
|||
|
ACanvas.Brush.Color:=clLime;
|
|||
|
IF AViewInfo.GridRecord.Values[tv1.GetColumnByFieldName('status').Index]='3' then
|
|||
|
ACanvas.Brush.Color:=clYellow;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.Tv1FocusedRecordChanged(
|
|||
|
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
|||
|
AFocusedRecord: TcxCustomGridRecord;
|
|||
|
ANewItemRecordFocusingChanged: Boolean);
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
if Order_Main.IsEmpty=False then
|
|||
|
sql.Add('select * from JYOrderCon_Sub_PB A where A.MainId='''+Trim(Order_Main.fieldbyname('MainId').AsString)+'''')
|
|||
|
else
|
|||
|
sql.Add('select * from JYOrderCon_Sub_PB A where 1=2');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryTemp,ClientDataSet2);
|
|||
|
SInitCDSData20(ADOQueryTemp,ClientDataSet2);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.twcClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB SET status=''3'' ');
|
|||
|
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>ɳɹ<C9B3><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.tnowcClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB 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><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>ɳɹ<C9B3><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 TfrmContractListPB.tchkkfClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB SET status=''4'' ');
|
|||
|
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><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><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 TfrmContractListPB.tnochkkfClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB 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><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳ɹ<CBB3><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.ToolButton2Click(Sender: TObject);
|
|||
|
|
|||
|
begin
|
|||
|
if Order_Main.IsEmpty then exit;
|
|||
|
Panel5.Left:=(self.Width-Panel5.Width) div 2;
|
|||
|
lblConno.Caption:=Trim(Order_Main.fieldbyname('Conno').AsString);
|
|||
|
Panel5.Visible:=true;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.Button5Click(Sender: TObject);
|
|||
|
var
|
|||
|
str: string;
|
|||
|
MjdQty:double;
|
|||
|
begin
|
|||
|
try
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update JYOrderCon_Main_PB SET jdQty='+trim(edtjdQty.Text));
|
|||
|
sql.Add(', jdps='+trim(edtjdps.Text));
|
|||
|
sql.Add(', jdreason='+quotedstr(trim(edtjdreason.Text)));
|
|||
|
sql.Add('where Conno='+quotedstr(trim(lblConno.Caption)));
|
|||
|
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>ļ<DEB8><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ'+str)));
|
|||
|
sql.Add(','+quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>'+trim(lblConno.Caption))));
|
|||
|
sql.Add(','+quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
sql.Add(')');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
Panel5.Visible:=true;
|
|||
|
TBRafresh.Click;
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
Panel5.Visible:=true;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmContractListPB.Button6Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel5.Visible:=false;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|