933 lines
27 KiB
ObjectPascal
933 lines
27 KiB
ObjectPascal
|
|
unit U_ContractListXF;
|
|||
|
|
|
|||
|
|
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, cxCurrencyEdit, RM_e_Graphic, RM_e_Jpeg, cxLookAndFeels,
|
|||
|
|
cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, dxSkinsCore, dxSkinBlack,
|
|||
|
|
dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom,
|
|||
|
|
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|||
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|||
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
|||
|
|
dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
|||
|
|
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
|
|||
|
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
|
|||
|
|
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
|
|||
|
|
dxSkinscxPCPainter;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmContractList_XF = 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;
|
|||
|
|
v1YWY: TcxGridDBColumn;
|
|||
|
|
v1ConNo: TcxGridDBColumn;
|
|||
|
|
Order_Main: TClientDataSet;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDBDataSet1: TRMDBDataSet;
|
|||
|
|
RMXLSExport1: TRMXLSExport;
|
|||
|
|
v1CustomerNoName: TcxGridDBColumn;
|
|||
|
|
v1FLZQty: TcxGridDBColumn;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
Tcopy: TToolButton;
|
|||
|
|
ADOQueryPrint: TADOQuery;
|
|||
|
|
CDS_Print: TClientDataSet;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
N11: TMenuItem;
|
|||
|
|
N21: TMenuItem;
|
|||
|
|
N31: TMenuItem;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
YWY: TEdit;
|
|||
|
|
MPRTCodeName: TEdit;
|
|||
|
|
ConNo: TEdit;
|
|||
|
|
MPRTKZ: TEdit;
|
|||
|
|
MPRTMF: TEdit;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
TTJ: TToolButton;
|
|||
|
|
TnoTJ: TToolButton;
|
|||
|
|
cxSplitter1: TcxSplitter;
|
|||
|
|
ADOQuerySub: TADOQuery;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
Panel10: TPanel;
|
|||
|
|
Image2: TImage;
|
|||
|
|
Button1: TButton;
|
|||
|
|
RadioGroup1: TRadioGroup;
|
|||
|
|
RMJPEGExport1: TRMJPEGExport;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
CustomerNoName: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
GCName: TEdit;
|
|||
|
|
v1GCName: TcxGridDBColumn;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
order_Sub: TClientDataSet;
|
|||
|
|
TFJ: TToolButton;
|
|||
|
|
v1GLQty: TcxGridDBColumn;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
v1ConType: TcxGridDBColumn;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
HTDJ: TEdit;
|
|||
|
|
v1HTDJ: TcxGridDBColumn;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
v1BNo: TcxGridDBColumn;
|
|||
|
|
v1XFBFB: TcxGridDBColumn;
|
|||
|
|
v1FLQty: TcxGridDBColumn;
|
|||
|
|
v1JSMoney: TcxGridDBColumn;
|
|||
|
|
v1Note: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
ConType: TComboBox;
|
|||
|
|
v1FKType: TcxGridDBColumn;
|
|||
|
|
V2KSFee: TcxGridDBColumn;
|
|||
|
|
v1WTRTel: TcxGridDBColumn;
|
|||
|
|
v1QDDate: TcxGridDBColumn;
|
|||
|
|
FKType: TComboBox;
|
|||
|
|
cxTabControl2: TcxTabControl;
|
|||
|
|
V2Column1: TcxGridDBColumn;
|
|||
|
|
V2Column2: TcxGridDBColumn;
|
|||
|
|
V2Column3: TcxGridDBColumn;
|
|||
|
|
V2Column4: TcxGridDBColumn;
|
|||
|
|
TChk: TToolButton;
|
|||
|
|
Tnochk: TToolButton;
|
|||
|
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
|
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 TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure TBAddClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure TBTPClick(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
|
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure TcopyClick(Sender: TObject);
|
|||
|
|
procedure CustomerNoChange(Sender: TObject);
|
|||
|
|
procedure ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure TTJClick(Sender: TObject);
|
|||
|
|
procedure TnoTJClick(Sender: TObject);
|
|||
|
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
procedure Image2Click(Sender: TObject);
|
|||
|
|
procedure TBPrintClick(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure TFJClick(Sender: TObject);
|
|||
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
|
procedure GCNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure TChkClick(Sender: TObject);
|
|||
|
|
procedure TnochkClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
DQdate: TDateTime;
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure InitForm();
|
|||
|
|
function DelData(): Boolean;
|
|||
|
|
procedure InitGridFH();
|
|||
|
|
procedure SetStatus();
|
|||
|
|
procedure InitSub();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FFInt, FCloth: Integer;
|
|||
|
|
canshu1: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmContractList_XF: TfrmContractList_XF;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_ConInPutXF, U_Fun, U_ZDYHelp, U_SKCR_CX, U_FjList_RZ;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmContractList_XF.InitSub();
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
with ADOQuerySub do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from JYOrderCon_sub ');
|
|||
|
|
sql.Add('where mainID =' + quotedstr((Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuerySub, Order_Sub);
|
|||
|
|
SInitCDSData20(ADOQuerySub, Order_Sub);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.SetStatus();
|
|||
|
|
begin
|
|||
|
|
tTJ.Visible := false;
|
|||
|
|
tnoTJ.Visible := false;
|
|||
|
|
tbedit.Visible := false;
|
|||
|
|
tbdel.Visible := false;
|
|||
|
|
TBAdd.Visible := false;
|
|||
|
|
Tcopy.Visible := false;
|
|||
|
|
Tchk.Visible := false;
|
|||
|
|
Tnochk.Visible := false;
|
|||
|
|
if canshu1 <> '<27><>ѯ' then
|
|||
|
|
begin
|
|||
|
|
TBAdd.Visible := true;
|
|||
|
|
Tcopy.Visible := true;
|
|||
|
|
case cxTabControl1.TabIndex of
|
|||
|
|
0:
|
|||
|
|
begin
|
|||
|
|
tbedit.Visible := true;
|
|||
|
|
tbdel.Visible := true;
|
|||
|
|
tTJ.Visible := true;
|
|||
|
|
end;
|
|||
|
|
1:
|
|||
|
|
begin
|
|||
|
|
TnoTJ.Visible := True;
|
|||
|
|
Tchk.Visible := True;
|
|||
|
|
end;
|
|||
|
|
2:
|
|||
|
|
begin
|
|||
|
|
Tnochk.Visible := True;
|
|||
|
|
end;
|
|||
|
|
3:
|
|||
|
|
begin
|
|||
|
|
Tnochk.Visible := True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmContractList_XF := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxgrid1.Align := alClient;
|
|||
|
|
//BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp)-7;
|
|||
|
|
//EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
|||
|
|
DQdate := SGetServerDate(ADOQueryTemp);
|
|||
|
|
cxTabControl1.TabIndex := 0;
|
|||
|
|
canshu1 := trim(DParameters1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
if FCloth <> 1 then
|
|||
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>б<EFBFBD>SF1', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1')
|
|||
|
|
else
|
|||
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1>SF1', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*');
|
|||
|
|
SQL.Add(',FLZQty=(select Sum(FLQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
|
sql.Add(' from JYOrderCon_Main A ');
|
|||
|
|
SQL.Add('where A.OrdDate>=''' + FormatDateTime('yyyy-MM-dd', BegDate.Date) + '''');
|
|||
|
|
SQL.Add(' and A.OrdDate<''' + FormatDateTime('yyyy-MM-dd', enddate.Date + 1) + '''');
|
|||
|
|
{if Trim(canshu1)<>'<27><>ѯ' then
|
|||
|
|
begin
|
|||
|
|
sql.Add('and (A.YWY='''+Trim(DName)+''' or A.Filler='''+trim(DName)+''')');
|
|||
|
|
end;}
|
|||
|
|
if cxTabControl1.TabIndex < 4 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and isnull(A.status,''0'')=''' + inttostr(cxTabControl1.TabIndex) + '''');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl2.TabIndex <> 4 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and isnull(A.ConType,'''')=''' + Trim(cxTabControl2.Tabs[cxTabControl2.TabIndex].Caption) + '''');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
finally
|
|||
|
|
;
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.InitGridFH();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec Order_QryList :MainId,:WSql');
|
|||
|
|
Parameters.ParamByName('WSql').Value := ' and FillTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''' + ' and FillTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.DateTime + 1)) + '''';
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.InitForm();
|
|||
|
|
begin
|
|||
|
|
if FCloth <> 1 then
|
|||
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>б<EFBFBD>SF1', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1')
|
|||
|
|
else
|
|||
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD>б<EFBFBD>ѡ<EFBFBD><D1A1>SF1', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
BegDate.DateTime := SGetServerDate10(ADOQueryTemp) - 30;
|
|||
|
|
EndDate.DateTime := SGetServerDate10(ADOQueryTemp);
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.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 TfrmContractList_XF.TBEditClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
{if Trim(Order_Main.fieldbyname('filler').AsString)<>Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;}
|
|||
|
|
try
|
|||
|
|
frmConInPutXF := TfrmConInPutXF.Create(Application);
|
|||
|
|
with frmConInPutXF do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmConInPutXF.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBDelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(Order_Main.fieldbyname('filler').AsString) <> Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.add('select * from JYOrder_Main where ConNo=''' + trim(Order_Main.fieldbyname('ConNo').AsString) + ''' ');
|
|||
|
|
open;
|
|||
|
|
if not isempty then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>', '<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
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 TfrmContractList_XF.DelData(): Boolean;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Result := false;
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete JYOrderCon_Sub where MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
sql.Add('delete JYOrderCon_Main where MainId=''' + 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><C9BE>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27><>ͬ<EFBFBD>ţ<EFBFBD>' + trim(Order_Main.FieldByName('conNo').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Result := False;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBExportClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
SelExportData(Tv1, ADOQueryMain, '<27><>ͬ<EFBFBD>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBAddClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
maxno: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmConInPutXF := TfrmConInPutXF.Create(Application);
|
|||
|
|
with frmConInPutXF do
|
|||
|
|
begin
|
|||
|
|
PState := 0;
|
|||
|
|
FMainId := '';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmConInPutXF.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SetStatus();
|
|||
|
|
InitForm();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
if ToolButton1.Visible = False then
|
|||
|
|
Exit;
|
|||
|
|
ToolButton1.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBTPClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FQty, FQty1, FMxQty, FPQty, FMxQtyS, FPQtyS: string;
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.CheckBox2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
var
|
|||
|
|
id, id10: Integer;
|
|||
|
|
begin
|
|||
|
|
{try
|
|||
|
|
if Tv1.GroupedItemCount=0 then
|
|||
|
|
begin
|
|||
|
|
Id:=Tv1.GetColumnByFieldName('DeliveryDate').Index-tv1.GroupedItemCount;
|
|||
|
|
Id10:=Tv1.GetColumnByFieldName('SubStatus').Index-tv1.GroupedItemCount;
|
|||
|
|
if Trim(VarToStr(ARecord.Values[id]))='' then Exit;
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
if ARecord.Values[id10]='<27><><EFBFBD><EFBFBD>' then exit;
|
|||
|
|
if (ARecord.Values[id]-DQdate)>=4 then Exit;
|
|||
|
|
if ((ARecord.Values[id]-DQdate)>=0) and ((ARecord.Values[id]-DQdate)<4) then
|
|||
|
|
AStyle:=DataLink_.QHuangSe
|
|||
|
|
else
|
|||
|
|
if ARecord.Values[id]-DQdate<0 then
|
|||
|
|
begin
|
|||
|
|
AStyle:=DataLink_OrderManage.FenHongS;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
except
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
begin
|
|||
|
|
{ Id:=TV1.GetColumnByFieldName('DeliveryDate').Index;//;-TV1.GroupedItemCount;
|
|||
|
|
Id10:=TV1.GetColumnByFieldName('SubStatus').Index;
|
|||
|
|
if Id<0 then Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[Id10]='<27><><EFBFBD><EFBFBD>' then Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]-SGetServerDate(ADOQueryTemp)>=4 then Exit;
|
|||
|
|
if ((AViewInfo.GridRecord.Values[id]-SGetServerDate10(ADOQueryTemp))>=0) and ((AViewInfo.GridRecord.Values[id]-SGetServerDate(ADOQueryTemp))<4) then
|
|||
|
|
ACanvas.Brush.Color:=clYellow
|
|||
|
|
else
|
|||
|
|
if (AViewInfo.GridRecord.Values[id])-(SGetServerDate10(ADOQueryTemp)<0) then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clRed;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Purple' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clPurple;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Olive' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clOlive;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Teal' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clTeal;
|
|||
|
|
end else
|
|||
|
|
if AViewInfo.GridRecord.Values[Id]='Background' then
|
|||
|
|
begin
|
|||
|
|
ACanvas.Brush.Color:=clBackground;
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.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 TfrmContractList_XF.N2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
Porderno: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf';
|
|||
|
|
SDofilter(ADOQueryMain, ' OrderNoM=''' + Trim(Order_Main.fieldbyname('OrderNoM').AsString) + '''');
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
Porderno := Trim(Order_Main.fieldbyname('OrderNoM').AsString);
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
//RMVariables['begindate']:=begindate.DateTime;
|
|||
|
|
//RMVariables['enddate']:=enddate.DateTime;
|
|||
|
|
//RMVariables['printtime']:=Now;
|
|||
|
|
//RMVariables['printer']:=Trim(gUserName);
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE>.rmf'), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
SDofilter(ADOQueryMain, '');
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
Order_Main.Locate('ordernoM', Porderno, []);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
frmConInPutXF := TfrmConInPutXF.Create(Application);
|
|||
|
|
with frmConInPutXF 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
|
|||
|
|
frmConInPutXF.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TcopyClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
frmConInPutXF := TfrmConInPutXF.Create(Application);
|
|||
|
|
with frmConInPutXF do
|
|||
|
|
begin
|
|||
|
|
PState := 1;
|
|||
|
|
CopyInt := 99;
|
|||
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmConInPutXF.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.CustomerNoChange(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 TfrmContractList_XF.ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
if Length(conno.Text) < 3 then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select A.*');
|
|||
|
|
SQL.Add(',FLZQty=(select Sum(FLQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
|
sql.Add(' from JYOrderCon_Main A ');
|
|||
|
|
SQL.Add('where 1=1 ');
|
|||
|
|
if Trim(canshu1) <> '<27><>ѯ' then
|
|||
|
|
begin
|
|||
|
|
sql.Add('and A.YWY=''' + Trim(DName) + '''');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex < 3 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and isnull(A.status,''0'')=''' + inttostr(cxTabControl1.TabIndex) + '''');
|
|||
|
|
end;
|
|||
|
|
sql.Add(' and ConNo like ''' + '%' + Trim(ConNo.Text) + '%' + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SetStatus();
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TTJClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
{if Trim(Order_Main.fieldbyname('filler').AsString)<>Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;}
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update JYOrdercon_Main SET status=''1''');
|
|||
|
|
sql.Add(' ,Chker=' + quotedstr(trim(DName)));
|
|||
|
|
sql.Add(' ,Chkdate=getdate() ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
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 TfrmContractList_XF.TnoTJClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
{if Trim(Order_Main.fieldbyname('filler').AsString)<>Trim(DName) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;}
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update JYOrdercon_Main SET status=''0''');
|
|||
|
|
sql.Add(' ,Chker='''',Chkdate=NULL ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
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 TfrmContractList_XF.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|||
|
|
begin
|
|||
|
|
InitSub();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.Image2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel4.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TBPrintClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
EngMoney: string;
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
Button1.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.Button1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
EngMoney: string;
|
|||
|
|
FimageFile: string;
|
|||
|
|
begin
|
|||
|
|
FimageFile := '';
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if radiogroup1.ItemIndex = 0 then
|
|||
|
|
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(',SumFLQty=(select Sum(C.FLQty) from JYOrderCon_Sub C where C.Mainid=A.Mainid)');
|
|||
|
|
sql.Add(' from JYOrderCon_Main A inner join JYOrderCon_Sub B on A.MainId=B.MainId ');
|
|||
|
|
sql.Add(' where A.MainId=''' + Trim(Order_Main.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryPrint, CDS_Print);
|
|||
|
|
SInitCDSData20(ADOQueryPrint, CDS_Print);
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RMVariables['ImageFile'] := trim(FimageFile);
|
|||
|
|
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 TfrmContractList_XF.TFJClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
try
|
|||
|
|
frmFjList_RZ := TfrmFjList_RZ.Create(Application);
|
|||
|
|
with frmFjList_RZ do
|
|||
|
|
begin
|
|||
|
|
fkeyNO := Trim(Self.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
fType := '<27><>ͬ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmFjList_RZ.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.cxTabControl2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SetStatus();
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.GCNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*');
|
|||
|
|
SQL.Add(',FLZQty=(select Sum(FLQty) from JYOrderCon_Sub B where B.MainId=A.MainId)');
|
|||
|
|
sql.Add(' from JYOrderCon_Main A ');
|
|||
|
|
SQL.Add('where A.GCName like ''' + '%' + trim(GCName.Text) + '%' + '''');
|
|||
|
|
if cxTabControl1.TabIndex < 4 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and isnull(A.status,''0'')=''' + inttostr(cxTabControl1.TabIndex) + '''');
|
|||
|
|
end;
|
|||
|
|
if cxTabControl2.TabIndex <> 4 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and isnull(A.ConType,'''')=''' + Trim(cxTabControl2.Tabs[cxTabControl2.TabIndex].Caption) + '''');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|||
|
|
finally
|
|||
|
|
;
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmContractList_XF.TChkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update JYOrdercon_Main SET status=''2''');
|
|||
|
|
sql.Add(' ,chker=' + quotedstr(trim(DName)));
|
|||
|
|
sql.Add(' ,ChkDate=getdate() ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
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 TfrmContractList_XF.TnochkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Main.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
try
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update JYOrdercon_Main SET status=''0''');
|
|||
|
|
sql.Add(' ,chker=' + quotedstr(trim(DName)));
|
|||
|
|
sql.Add(' ,ChkDate=getdate() ');
|
|||
|
|
sql.Add('where mainID=' + quotedstr(trim(Order_Main.fieldbyname('mainID').AsString)));
|
|||
|
|
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;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|