2025-01-20 13:04:03 +08:00
|
|
|
|
unit U_ZHCPDJList;
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
2025-09-20 10:39:47 +08:00
|
|
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
|
|
|
|
|
|
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|
|
|
|
|
cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
|
|
|
|
|
|
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, cxButtonEdit,
|
|
|
|
|
|
cxDropDownEdit, cxPC, Buttons, cxTextEdit, cxImage, StrUtils, cxLookAndFeels,
|
|
|
|
|
|
cxLookAndFeelPainters, cxNavigator, dxSkinsCore, dxSkinDarkRoom,
|
|
|
|
|
|
dxSkinOffice2013White, dxSkinSharpPlus, dxSkinSpringTime,
|
|
|
|
|
|
dxSkinsDefaultPainters, dxSkinscxPCPainter, dxSkinBlack, dxSkinBlue,
|
|
|
|
|
|
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkSide,
|
|
|
|
|
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|
|
|
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|
|
|
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|
|
|
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|
|
|
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|
|
|
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|
|
|
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|
|
|
|
|
dxSkinOffice2013LightGray, dxSkinPumpkin, dxSkinSeven,
|
|
|
|
|
|
dxSkinSevenClassic, dxSkinSharp, dxSkinSilver, dxSkinStardust,
|
|
|
|
|
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinValentine, dxSkinVS2010,
|
|
|
|
|
|
dxSkinWhiteprint, dxSkinXmas2008Blue;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmZHCPDJList = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBRafresh: TToolButton;
|
|
|
|
|
|
TBFind: TToolButton;
|
|
|
|
|
|
TBAdd: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
TBExport: TToolButton;
|
|
|
|
|
|
Order_Main: TClientDataSet;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
Panel11: TPanel;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
v1Column7: TcxGridDBColumn;
|
|
|
|
|
|
v1Column9: TcxGridDBColumn;
|
|
|
|
|
|
RM1: TRMGridReport;
|
|
|
|
|
|
RMDBMain: TRMDBDataSet;
|
|
|
|
|
|
RMXLSExport2: TRMXLSExport;
|
|
|
|
|
|
CDS_PRT: TClientDataSet;
|
|
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
|
v1Column6: TcxGridDBColumn;
|
|
|
|
|
|
v1ZICost: TcxGridDBColumn;
|
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
|
|
|
|
|
v1Column8: TcxGridDBColumn;
|
|
|
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
|
|
|
TBEdit: TMenuItem;
|
|
|
|
|
|
TBDel: TMenuItem;
|
|
|
|
|
|
Panel2: TPanel;
|
|
|
|
|
|
v1Column10: TcxGridDBColumn;
|
|
|
|
|
|
v1Column12: TcxGridDBColumn;
|
|
|
|
|
|
BJ: TMenuItem;
|
|
|
|
|
|
Panel5: TPanel;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
BegDate: TDateTimePicker;
|
|
|
|
|
|
EndDate: TDateTimePicker;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
KHName: TEdit;
|
|
|
|
|
|
GuoJia: TEdit;
|
|
|
|
|
|
YWY: TEdit;
|
|
|
|
|
|
Note: TEdit;
|
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
|
v1Column5: TcxGridDBColumn;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
LiDan: TEdit;
|
|
|
|
|
|
procedure FormDestroy(Sender: TObject);
|
|
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure TBFindClick(Sender: TObject);
|
|
|
|
|
|
procedure TBExportClick(Sender: TObject);
|
|
|
|
|
|
procedure TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
procedure TBAddClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure CheckBox1Click(Sender: TObject);
|
|
|
|
|
|
procedure CheckBox2Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure CustomerNoNameChange(Sender: TObject);
|
|
|
|
|
|
procedure TBDelClick(Sender: TObject);
|
|
|
|
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|
|
|
|
|
procedure ZJStatusChange(Sender: TObject);
|
|
|
|
|
|
procedure Tv1DblClick(Sender: TObject);
|
|
|
|
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|
|
|
|
|
procedure TBEditClick(Sender: TObject);
|
|
|
|
|
|
procedure BJClick(Sender: TObject);
|
|
|
|
|
|
procedure KHNameChange(Sender: TObject);
|
|
|
|
|
|
private
|
2025-09-20 10:39:47 +08:00
|
|
|
|
canshu1, canshu2: string;
|
|
|
|
|
|
DQdate: TDateTime;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure InitGrid();
|
|
|
|
|
|
procedure InitForm();
|
2025-09-20 10:39:47 +08:00
|
|
|
|
function DelData(): Boolean;
|
|
|
|
|
|
function StrFenHang(FStr: string; var FHStr: string): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
2025-09-20 10:39:47 +08:00
|
|
|
|
FFInt, FCloth: Integer;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
//var
|
|
|
|
|
|
//frmZHCPList: TfrmZHCPList;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
2025-09-20 10:39:47 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
uses
|
2025-09-20 10:39:47 +08:00
|
|
|
|
U_DataLink, U_RTFun, U_ZHDJInPut, U_KWView;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.FormDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
//frmZHCPList:=nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-09-20 10:39:47 +08:00
|
|
|
|
procedure TfrmZHCPDJList.FormClose(Sender: TObject; var Action: TCloseAction);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Action := caFree;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.FormCreate(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
cxgrid1.Align := alClient;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Trim(Self.Caption) = 'չ<><D5B9><EFBFBD>Ǽ<EFBFBD>*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
WriteCxGrid('չ<><D5B9><EFBFBD>Ǽ<EFBFBD>YX', Tv1, 'չ<><D5B9><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end
|
|
|
|
|
|
else if Trim(Self.Caption) = 'չ<>ᱨ<EFBFBD><E1B1A8>*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
WriteCxGrid('չ<>ᱨ<EFBFBD><E1B1A8>YX', Tv1, 'չ<><D5B9><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end
|
|
|
|
|
|
else if Trim(Self.Caption) = 'չ<><D5B9><EFBFBD>Ǽ<EFBFBD>(<28><>Ȩ<EFBFBD><C8A8>)*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
WriteCxGrid('չ<><D5B9><EFBFBD>Ǽ<EFBFBD>(<28><>Ȩ<EFBFBD><C8A8>)YX', Tv1, 'չ<><D5B9><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.InitGrid();
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Panel2.Visible := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Panel2.Refresh;
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryMain.DisableControls;
|
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Filtered := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select A.* ');
|
|
|
|
|
|
sql.Add(' from ZH_KH_DJ A ');
|
|
|
|
|
|
sql.Add(' where Valid=''Y'' ');
|
2025-09-20 10:39:47 +08:00
|
|
|
|
sql.Add(' and ZDDate>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|
|
|
|
|
sql.Add(' and ZDDate<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|
|
|
|
|
if Trim(canshu2) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
SQL.Add(' and (isnull(YWY,'''')=''' + Trim(DName) + ''' or isnull(LiDan,'''')=''' + Trim(DName) + ''' or isnull(Filler,'''')=''' + Trim(DName) + ''')');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryMain.EnableControls;
|
|
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Panel2.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.InitForm();
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
BegDate.Date := SGetServerDateMBeg(ADOQueryTemp);
|
|
|
|
|
|
EndDate.Date := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
if Trim(Self.Caption) = '<27><><EFBFBD>۵Ǽ<DBB5>*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
ReadCxGrid('չ<><D5B9><EFBFBD>Ǽ<EFBFBD>YX', Tv1, 'չ<><D5B9><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|
|
|
|
|
TBAdd.Visible := True;
|
|
|
|
|
|
TBEdit.Visible := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
// TBDel.Visible:=True;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
end
|
|
|
|
|
|
else if Trim(Self.Caption) = '<27><><EFBFBD>۹<EFBFBD><DBB9><EFBFBD>*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
ReadCxGrid('չ<>ᱨ<EFBFBD><E1B1A8>YX', Tv1, 'չ<><D5B9><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|
|
|
|
|
TBAdd.Visible := True;
|
|
|
|
|
|
TBEdit.Visible := True;
|
|
|
|
|
|
TBDel.Visible := True;
|
|
|
|
|
|
BJ.Visible := True;
|
|
|
|
|
|
canshu2 := '<27><>Ȩ<EFBFBD><C8A8>';
|
|
|
|
|
|
end
|
|
|
|
|
|
else if Trim(Self.Caption) = '<27><><EFBFBD>۵Ǽ<DBB5>(<28><>Ȩ<EFBFBD><C8A8>)*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
ReadCxGrid('չ<><D5B9><EFBFBD>Ǽ<EFBFBD>(<28><>Ȩ<EFBFBD><C8A8>)YX', Tv1, 'չ<><D5B9><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|
|
|
|
|
TBAdd.Visible := True;
|
|
|
|
|
|
TBEdit.Visible := True;
|
|
|
|
|
|
TBDel.Visible := True;
|
|
|
|
|
|
canshu2 := '<27><>Ȩ<EFBFBD><C8A8>';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
//InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.TBFindClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if ADOQueryMain.Active = False then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2025-09-20 10:39:47 +08:00
|
|
|
|
function TfrmZHCPDJList.DelData(): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Result := false;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
Order_Main.DisableControls;
|
|
|
|
|
|
with Order_Main do
|
|
|
|
|
|
begin
|
|
|
|
|
|
//First;
|
|
|
|
|
|
// while Order_Main.Locate('SSel',True,[]) do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
sql.Add(' UPdate ZH_KH_DJ Set DelTime=getdate(),DelerCode=''' + Trim(DCode) + ''',Deler=''' + Trim(DName) + ''', Valid=''N'' ');
|
|
|
|
|
|
sql.Add(' where ZDID=''' + Trim(Order_Main.fieldbyname('ZDID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Main.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Main.EnableControls;
|
|
|
|
|
|
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Result := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
except
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Result := False;
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
|
|
|
|
|
|
function TfrmZHCPDJList.StrFenHang(FStr: string; var FHStr: string): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
var
|
2025-09-20 10:39:47 +08:00
|
|
|
|
i, j: Integer;
|
|
|
|
|
|
LSStr: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Result := False;
|
|
|
|
|
|
FStr := Trim(FStr);
|
|
|
|
|
|
FHStr := '';
|
|
|
|
|
|
j := 1;
|
|
|
|
|
|
i := Pos(' ', FStr);
|
|
|
|
|
|
while i > 0 do
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if j = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
LSStr := Copy(FStr, 1, i - 1); //'1234 5678 456'
|
|
|
|
|
|
FHStr := '1:' + LSStr;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
LSStr := Copy(FStr, 1, i - 1);
|
|
|
|
|
|
if Trim(LSStr) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
FStr := Copy(FStr, i + 1, Length(FStr) - i);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
FHStr := FHStr + #13 + #10 + inttostr(j) + ':' + LSStr;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Trim(LSStr) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
j := j + 1;
|
|
|
|
|
|
FStr := Copy(FStr, i + 1, Length(FStr) - i);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
i := Pos(' ', FStr);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if j = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
FHStr := FStr;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Trim(FStr) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
FHStr := FHStr + #13 + #10 + inttostr(j) + ':' + FStr;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Result := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure TfrmZHCPDJList.TBExportClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if ADOQueryMain.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
TcxGridToExcel(Self.Caption, cxGrid1);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.TBAddClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-20 10:39:47 +08:00
|
|
|
|
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmZHDJInPut do
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
PState := 0;
|
|
|
|
|
|
FMainId := '';
|
|
|
|
|
|
frmZHDJInPut.canshu2 := Self.canshu2;
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZHDJInPut.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitForm();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.CheckBox1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.CheckBox2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBRafresh.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-20 10:39:47 +08:00
|
|
|
|
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmZHDJInPut do
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Order_Main.fieldbyname('ZDID').AsString);
|
|
|
|
|
|
TBSave.Visible := False;
|
|
|
|
|
|
if Trim(self.Caption) = 'չ<>ᱨ<EFBFBD><E1B1A8>*' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
frmZHDJInPut.canshu1 := '<27><><EFBFBD><EFBFBD>';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
//InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZHDJInPut.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.CustomerNoNameChange(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if ADOQueryMain.Active = False then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.TBDelClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
if DelData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
//Order_Main.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.cxTabControl1Change(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.ZJStatusChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBFind.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.Tv1DblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
ToolButton1.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.cxTabControl2Change(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.TBEditClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-20 10:39:47 +08:00
|
|
|
|
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmZHDJInPut do
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Order_Main.fieldbyname('ZDID').AsString);
|
|
|
|
|
|
frmZHDJInPut.canshu2 := Self.canshu2;
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Self.Order_Main.Locate('ZDID', FMainId, []);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZHDJInPut.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.BJClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-20 10:39:47 +08:00
|
|
|
|
frmZHDJInPut := TfrmZHDJInPut.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmZHDJInPut do
|
|
|
|
|
|
begin
|
2025-09-20 10:39:47 +08:00
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Order_Main.fieldbyname('ZDID').AsString);
|
|
|
|
|
|
frmZHDJInPut.canshu1 := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
2025-09-20 10:39:47 +08:00
|
|
|
|
Self.Order_Main.Locate('ZDID', FMainId, []);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZHDJInPut.Free;
|
2025-09-20 10:39:47 +08:00
|
|
|
|
end;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmZHCPDJList.KHNameChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBFind.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
2025-09-20 10:39:47 +08:00
|
|
|
|
|