2025-01-20 13:04:03 +08:00
|
|
|
|
unit U_CPXiaoShouList;
|
|
|
|
|
|
|
|
|
|
|
|
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-30 15:36:41 +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, 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
|
|
|
|
|
|
TfrmCPXiaoShouList = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBRafresh: TToolButton;
|
|
|
|
|
|
TBFind: TToolButton;
|
|
|
|
|
|
TBAdd: TToolButton;
|
|
|
|
|
|
TBEdit: TToolButton;
|
|
|
|
|
|
TBDel: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
TBExport: TToolButton;
|
|
|
|
|
|
Order_Main: TClientDataSet;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
Label34: TLabel;
|
|
|
|
|
|
FactoryName: TEdit;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
BegDate: TDateTimePicker;
|
|
|
|
|
|
EndDate: TDateTimePicker;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
RM1: TRMGridReport;
|
|
|
|
|
|
RMDBMain: TRMDBDataSet;
|
|
|
|
|
|
RMXLSExport2: TRMXLSExport;
|
|
|
|
|
|
CDS_PRT: TClientDataSet;
|
|
|
|
|
|
labMYType: TLabel;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
v1Column17: TcxGridDBColumn;
|
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
|
|
|
v1Column12: TcxGridDBColumn;
|
|
|
|
|
|
v1Column13: TcxGridDBColumn;
|
|
|
|
|
|
v1Column16: TcxGridDBColumn;
|
|
|
|
|
|
v1Column18: TcxGridDBColumn;
|
|
|
|
|
|
v1Column19: TcxGridDBColumn;
|
|
|
|
|
|
v1Column20: TcxGridDBColumn;
|
|
|
|
|
|
v1Column21: TcxGridDBColumn;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
YWY: TEdit;
|
|
|
|
|
|
v1Column23: TcxGridDBColumn;
|
|
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
|
Tv2: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
DataSource2: TDataSource;
|
|
|
|
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|
|
|
|
|
ClientDataSet2: TClientDataSet;
|
|
|
|
|
|
Panel2: TPanel;
|
|
|
|
|
|
SpeedButton1: TSpeedButton;
|
|
|
|
|
|
Image2: TImage;
|
|
|
|
|
|
SpeedButton2: TSpeedButton;
|
|
|
|
|
|
SpeedButton3: TSpeedButton;
|
|
|
|
|
|
CheckBox1: TCheckBox;
|
|
|
|
|
|
Panel3: TPanel;
|
|
|
|
|
|
Image1: TImage;
|
|
|
|
|
|
SpeedButton8: TSpeedButton;
|
|
|
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
|
|
|
N1: TMenuItem;
|
|
|
|
|
|
v1Ssel: TcxGridDBColumn;
|
|
|
|
|
|
ADOQuery1: TADOQuery;
|
|
|
|
|
|
SpeedButton4: TSpeedButton;
|
|
|
|
|
|
v1Column2: 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 TBDelClick(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 N2Click(Sender: TObject);
|
|
|
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
|
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|
|
|
|
|
procedure ZJStatusChange(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
procedure Tv1DblClick(Sender: TObject);
|
|
|
|
|
|
procedure TBEditClick(Sender: TObject);
|
|
|
|
|
|
procedure Image2Click(Sender: TObject);
|
|
|
|
|
|
procedure SpeedButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure SpeedButton2Click(Sender: TObject);
|
|
|
|
|
|
procedure SpeedButton3Click(Sender: TObject);
|
2025-09-30 15:36:41 +08:00
|
|
|
|
procedure Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure Image1Click(Sender: TObject);
|
|
|
|
|
|
procedure SpeedButton8Click(Sender: TObject);
|
|
|
|
|
|
procedure SpeedButton4Click(Sender: TObject);
|
|
|
|
|
|
private
|
2025-09-30 15:36:41 +08:00
|
|
|
|
canshu1: string;
|
|
|
|
|
|
DQdate: TDateTime;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure InitGrid();
|
|
|
|
|
|
procedure InitGridKH();
|
|
|
|
|
|
procedure InitGridSub();
|
|
|
|
|
|
procedure InitForm();
|
2025-09-30 15:36:41 +08:00
|
|
|
|
function DelData(): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
2025-09-30 15:36:41 +08:00
|
|
|
|
FFInt, FCloth: Integer;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmCPXiaoShouList: TfrmCPXiaoShouList;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
2025-09-30 15:36:41 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
uses
|
2025-09-30 15:36:41 +08:00
|
|
|
|
U_DataLink, U_RTFun, U_XiShouInPut, U_ZDYHelp, U_XiShouInPutWKC,
|
|
|
|
|
|
U_XiaoShouDataOldListQB, U_CKProductBCPOutList, U_XiaoShouDataNewListQB;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.FormDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmCPXiaoShouList := nil;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2025-09-30 15:36:41 +08:00
|
|
|
|
procedure TfrmCPXiaoShouList.FormClose(Sender: TObject; var Action: TCloseAction);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Action := caFree;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.FormCreate(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
cxgrid1.Align := alClient;
|
|
|
|
|
|
canshu1 := Trim(DParameters1);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD>Ǽ<EFBFBD>YXMX', Tv1, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD>Ǽ<EFBFBD>YXZY', Tv2, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.InitGrid();
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.DisableControls;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Filtered := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select AA.*,B.* ');
|
|
|
|
|
|
sql.Add(',KHNameJC=(select KHNameJC from KH_Main KM where KM.KHNO=B.FactoryNo)');
|
|
|
|
|
|
sql.Add(' from(');
|
|
|
|
|
|
sql.Add(' select A.SMID,BZType,JQty=sum(JQty),HSQty=sum(HSQty),HZFee=sum(HZFee),Money=sum(Money)');
|
|
|
|
|
|
sql.Add(' from CK_YCL_CR A ');
|
|
|
|
|
|
sql.Add(' inner join CK_YCL_CR_Main B on A.SMID=B.SMID ');
|
|
|
|
|
|
sql.add(' where 1=1');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if CheckBox1.Checked = True then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SQL.Add(' and B.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''');
|
|
|
|
|
|
sql.Add(' and B.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
|
|
|
|
|
|
BegDate.Visible := True;
|
|
|
|
|
|
EndDate.Visible := true;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SQL.Add(' and B.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', now)) + '''');
|
|
|
|
|
|
sql.Add(' and B.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', now + 1)) + '''');
|
|
|
|
|
|
BegDate.Visible := false;
|
|
|
|
|
|
EndDate.Visible := false;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
sql.Add(' and isnull(B.CKName,'''')=''<27><><EFBFBD>۳<EFBFBD><DBB3><EFBFBD>'' ');
|
|
|
|
|
|
sql.Add(' Group by A.SMID,BZType )AA');
|
|
|
|
|
|
sql.Add(' inner join CK_YCL_CR_Main B on AA.SMID=B.SMID ');
|
|
|
|
|
|
SQL.Add(' order by B.CRTime desc');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SCreateCDS20(ADOQueryCmd, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryCmd, Order_Main);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryCmd.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.InitGridSub();
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryTemp.DisableControls;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Filtered := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select AA.*,B.* ');
|
|
|
|
|
|
sql.Add(',KHNameJC=(select KHNameJC from KH_Main KM where KM.KHNO=B.FactoryNo)');
|
|
|
|
|
|
sql.Add(' from(');
|
|
|
|
|
|
sql.Add(' select A.SMID,BZType,JQty=sum(JQty),HSQty=sum(HSQty),HZFee=sum(HZFee),Money=sum(Money)');
|
|
|
|
|
|
sql.Add(' from CK_YCL_CR A ');
|
|
|
|
|
|
sql.Add(' inner join CK_YCL_CR_Main B on A.SMID=B.SMID ');
|
|
|
|
|
|
sql.Add(' where 1=1');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if CheckBox1.Checked = true then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.add(' and B.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + '''');
|
|
|
|
|
|
sql.Add(' and B.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.add(' and B.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', Now)) + '''');
|
|
|
|
|
|
sql.Add(' and B.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', Now + 1)) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
sql.Add(' and isnull(B.CKName,'''')=''<27><><EFBFBD>۳<EFBFBD><DBB3><EFBFBD>'' ');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add(' and isnull(B.FactoryNo,'''')=''' + Trim(ClientDataSet2.fieldbyname('FactoryNo').AsString) + '''');
|
|
|
|
|
|
sql.Add(' and isnull(B.CRType,'''')=''' + Trim(ClientDataSet2.fieldbyname('CRType').AsString) + '''');
|
|
|
|
|
|
sql.Add(' and isnull(B.YWY,'''')=''' + Trim(ClientDataSet2.fieldbyname('YWY').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
if ClientDataSet2.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
sql.Add(' and 1=2');
|
|
|
|
|
|
end;
|
|
|
|
|
|
sql.Add(' Group by A.SMID,BZType )AA');
|
|
|
|
|
|
sql.Add(' inner join CK_YCL_CR_Main B on AA.SMID=B.SMID ');
|
|
|
|
|
|
SQL.Add(' order by B.CRTime desc');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SCreateCDS20(ADOQueryTemp, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryTemp, Order_Main);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryTemp.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.InitGridKH();
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryMain.DisableControls;
|
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Filtered := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select B.CRType,B.FactoryNo,B.YWY,FactoryName=KHNameJC ');
|
|
|
|
|
|
sql.Add(' from CK_YCL_CR_Main B ');
|
|
|
|
|
|
sql.Add(' inner join KH_Main A on B.FactoryNo=A.KHNO');
|
|
|
|
|
|
sql.Add(' where isnull(B.CKName,'''')=''<27><><EFBFBD>۳<EFBFBD><DBB3><EFBFBD>'' ');
|
|
|
|
|
|
sql.Add(' Group by B.CRType,B.FactoryNo,B.YWY,A.KHNameJC');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet2);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryMain.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.InitForm();
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
BegDate.Date := StrToDate(FormatDateTime('yyyy-MM', SGetServerDate(ADOQueryTemp)) + '-01');
|
|
|
|
|
|
EndDate.Date := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD>Ǽ<EFBFBD>YXMX', Tv1, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD>Ǽ<EFBFBD>YXZY', Tv2, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
InitGridKH();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBFindClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ADOQueryCmd.Active = False then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
SDofilter(ADOQueryCmd, SGetFilters(Panel1, 1, 2));
|
|
|
|
|
|
SCreateCDS20(ADOQueryCmd, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryCmd, Order_Main);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBDelClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from YS_Money_CR where YFTypeId in');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add('(select SPID from CK_YCL_CR where SMID=''' + Trim(Order_Main.fieldbyname('SMID').AsString) + ''')');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
sql.Add(' and (isnull(ChkerP,'''')<>'''' ');
|
|
|
|
|
|
sql.Add(' or isnull(ChkerQ,'''')<>'''') ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ADOQueryTemp.IsEmpty = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ۻ<EFBFBD><DBBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD>ɾ<EFBFBD><C9BE>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
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
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' delete YS_Money_CR where YFTypeId in');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add('(select SPID from CK_YCL_CR where SMID=''' + Trim(Order_Main.fieldbyname('SMID').AsString) + ''')');
|
|
|
|
|
|
sql.Add(' delete CK_YCL_CR where SMID=''' + Trim(Order_Main.fieldbyname('SMID').AsString) + '''');
|
|
|
|
|
|
sql.Add(' delete CK_YCL_CR_Main where SMID=''' + Trim(Order_Main.fieldbyname('SMID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
Order_Main.Delete;
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Application.MessageBox('ɾ<><C9BE><EFBFBD>쳣!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-09-30 15:36:41 +08:00
|
|
|
|
function TfrmCPXiaoShouList.DelData(): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-30 15:36:41 +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;
|
|
|
|
|
|
sql.Add(' insert into CK_MYSC_CR_Log ');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add(' select * from CK_MYSC_CR where MYID=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|
|
|
|
|
sql.Add(' UPdate CK_MYSC_CR_Log Set DelTime=getdate(),DelerCode=''' + Trim(DCode) + ''',Deler=''' + Trim(DName) + '''');
|
|
|
|
|
|
sql.Add(' where MYID=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|
|
|
|
|
sql.Add('Delete CK_MYSC_CR where MYId=''' + Trim(Order_Main.fieldbyname('MYId').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Main.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Main.EnableControls;
|
|
|
|
|
|
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Result := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
except
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
2025-09-30 15:36:41 +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;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBExportClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ADOQueryMain.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
TcxGridToExcel(Self.Caption, cxGrid1);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGridKH();
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBAddClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Panel2.Visible := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitForm();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.CheckBox1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.CheckBox2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBRafresh.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-09-30 15:36:41 +08:00
|
|
|
|
FFMYType: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
FFMYType := Trim(Order_Main.fieldbyname('CRType').AsString);
|
|
|
|
|
|
if Trim(FFMYType) = '<27><>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiShouInPut := TfrmXiShouInPut.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiShouInPut do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
TBSave.Visible := False;
|
|
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('SMID').AsString);
|
|
|
|
|
|
Label21.Caption := FFMYType;
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiShouInPut.Free;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiShouInPutWKC := TfrmXiShouInPutWKC.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiShouInPutWKC do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
TBSave.Visible := False;
|
|
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('SMID').AsString);
|
|
|
|
|
|
Label21.Caption := FFMYType;
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiShouInPutWKC.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.CustomerNoNameChange(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ADOQueryMain.Active = False then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|
|
|
|
|
SCreateCDS20(ADOQueryMain, ClientDataSet2);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, ClientDataSet2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.N2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SelOKNo(Order_Main, True);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.N1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
speedbutton8.click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.cxTabControl1Change(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.ZJStatusChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBFind.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-09-30 15:36:41 +08:00
|
|
|
|
fPrintFile: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(Order_Main.fieldbyname('Chker').AsString) = '' then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ⱨ<EFBFBD><E2B1A8>.rmf';
|
|
|
|
|
|
RMXLSExport2 := TRMXLSExport.Create(RMXLSExport2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add('select * from Test_Report where TRId=''' + Trim(Order_Main.fieldbyname('TRId').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
|
|
|
|
|
SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
if FileExists(fPrintFile) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
//RMVariables['OrderUnit']:=Order_Main.fieldbyname('OrderUnit').Value;
|
|
|
|
|
|
RM1.LoadFromFile(fPrintFile);
|
|
|
|
|
|
RM1.ShowReport;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD>ⱨ<EFBFBD><E2B1A8>.rmf'), '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.Tv1DblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmCKProductBCPOutList := TfrmCKProductBCPOutList.Create(self);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmCKProductBCPOutList do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
FCKNO := trim(Order_Main.fieldbyname('CKNo').AsString);
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.TBEditClick(Sender: TObject);
|
|
|
|
|
|
var
|
2025-09-30 15:36:41 +08:00
|
|
|
|
FFMYType: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from YS_Money_CR where YFTypeId in');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add('(select SPID from CK_YCL_CR where SMID=''' + Trim(Order_Main.fieldbyname('SMID').AsString) + ''')');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ADOQueryTemp.IsEmpty = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Application.MessageBox('<27>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>տ<D5BF><EEB2BB><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
FFMYType := Trim(Order_Main.fieldbyname('CRType').AsString);
|
|
|
|
|
|
if Trim(FFMYType) = '<27><>ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD>' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiShouInPut := TfrmXiShouInPut.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiShouInPut do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('SMID').AsString);
|
|
|
|
|
|
Label21.Caption := FFMYType;
|
|
|
|
|
|
Button1.Visible := False;
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGridSub();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiShouInPut.Free;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiShouInPutWKC := TfrmXiShouInPutWKC.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiShouInPutWKC do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
PState := 1;
|
|
|
|
|
|
FMainId := Trim(Self.Order_Main.fieldbyname('SMID').AsString);
|
|
|
|
|
|
Label21.Caption := FFMYType;
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGridSub();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiShouInPutWKC.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.Image2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Panel2.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.SpeedButton1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Panel2.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiaoShouDataOldListQB := TfrmXiaoShouDataOldListQB.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiaoShouDataOldListQB do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiaoShouDataOldListQB.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.SpeedButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Panel2.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiShouInPutWKC := TfrmXiShouInPutWKC.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiShouInPutWKC do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
PState := 0;
|
|
|
|
|
|
FMainId := '';
|
|
|
|
|
|
Label21.Caption := '<27><EFBFBD><DEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiShouInPutWKC.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.SpeedButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Panel2.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiShouInPutWKC := TfrmXiShouInPutWKC.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiShouInPutWKC do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
PState := 0;
|
|
|
|
|
|
FMainId := '';
|
|
|
|
|
|
Label21.Caption := '<27>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiShouInPutWKC.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-09-30 15:36:41 +08:00
|
|
|
|
procedure TfrmCPXiaoShouList.Tv2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
InitGridSub();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.Image1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
Panel3.Visible := false;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.SpeedButton8Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-09-30 15:36:41 +08:00
|
|
|
|
fPrintFile: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Order_Main.Locate('ssel', True, []) = false then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.Add('delete TBSubID where DName=''' + Trim(DCode) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5>.rmf';
|
|
|
|
|
|
RMXLSExport2 := TRMXLSExport.Create(RMXLSExport2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with Order_Main do
|
|
|
|
|
|
begin
|
|
|
|
|
|
first;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if FieldByName('Ssel').AsBoolean = true then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Filtered := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select distinct isnull(D.MJID,C.MJID) MJID');
|
|
|
|
|
|
sql.Add(' from CK_YCL_CR A ');
|
|
|
|
|
|
sql.Add(' inner join CK_YCL_CR_Main B on A.SMID=B.SMID ');
|
|
|
|
|
|
sql.Add(' left join CP_InOut1 C on C.InOutNo=B.CKNo');
|
|
|
|
|
|
sql.Add(' left join CK_BanCP_CR D on D.CKOrdNo=B.CKNo');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.add(' where B.CKNO=''' + Trim(Order_Main.fieldbyname('CKNO').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('SELECT * FROM TBSubID where 1=2 ');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
first;
|
|
|
|
|
|
while not eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
ADOQueryTemp.append;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
ADOQueryTemp.fieldbyname('SubId').Value := Trim(ADOQuery1.fieldbyname('MJID').AsString);
|
|
|
|
|
|
ADOQueryTemp.fieldbyname('Dname').Value := Trim(DCode);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ADOQueryTemp.post;
|
|
|
|
|
|
next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.add('exec P_Print_CKMD3 ');
|
2025-09-30 15:36:41 +08:00
|
|
|
|
sql.add('@mainID=' + quotedstr(Trim('')));
|
|
|
|
|
|
sql.add(',@DName=' + quotedstr(Trim(DCode)));
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
SCreateCDS20(ADOQueryTemp, CDS_PRT);
|
|
|
|
|
|
SInitCDSData20(ADOQueryTemp, CDS_PRT);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
if FileExists(fPrintFile) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
RM1.LoadFromFile(fPrintFile);
|
|
|
|
|
|
RM1.ShowReport;
|
2025-09-30 15:36:41 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EBB5A5>.rmf'), '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmCPXiaoShouList.SpeedButton4Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
Panel2.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-09-30 15:36:41 +08:00
|
|
|
|
frmXiaoShouDataNewListQB := TfrmXiaoShouDataNewListQB.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmXiaoShouDataNewListQB do
|
|
|
|
|
|
begin
|
2025-09-30 15:36:41 +08:00
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmXiaoShouDataNewListQB.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|