2025-07-05 15:14:36 +08:00
|
|
|
|
unit U_LLCKList;
|
|
|
|
|
|
|
|
|
|
|
|
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, cxButtonEdit,
|
|
|
|
|
|
cxDropDownEdit, cxPC, Buttons, cxTextEdit, cxLookAndFeels,
|
2025-07-19 16:54:23 +08:00
|
|
|
|
cxLookAndFeelPainters, cxNavigator, dxSkinsCore,
|
|
|
|
|
|
dxSkinDarkRoom,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dxSkinOffice2013White,
|
|
|
|
|
|
dxSkinSharpPlus, dxSkinSpringTime,
|
|
|
|
|
|
dxSkinsDefaultPainters,
|
|
|
|
|
|
|
2025-07-05 15:14:36 +08:00
|
|
|
|
dxSkinscxPCPainter;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmLLCKList = 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;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
Label34: TLabel;
|
|
|
|
|
|
v1Column7: TcxGridDBColumn;
|
|
|
|
|
|
v1Column9: TcxGridDBColumn;
|
|
|
|
|
|
KHNameHZ: TEdit;
|
|
|
|
|
|
BegDate: TDateTimePicker;
|
|
|
|
|
|
EndDate: TDateTimePicker;
|
|
|
|
|
|
RM1: TRMGridReport;
|
|
|
|
|
|
RMDBMain: TRMDBDataSet;
|
|
|
|
|
|
RMXLSExport2: TRMXLSExport;
|
|
|
|
|
|
CDS_PRT: TClientDataSet;
|
|
|
|
|
|
v1Column17: TcxGridDBColumn;
|
|
|
|
|
|
v1Column5: TcxGridDBColumn;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
MYName: TEdit;
|
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
Note: TEdit;
|
|
|
|
|
|
labMYType: TLabel;
|
|
|
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
|
|
|
N1: TMenuItem;
|
|
|
|
|
|
N2: TMenuItem;
|
|
|
|
|
|
CheckBox1: TCheckBox;
|
|
|
|
|
|
v1JCDanWeiJC: TcxGridDBColumn;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
JCDanWeiJC: TEdit;
|
|
|
|
|
|
v1filler: TcxGridDBColumn;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
filler: TEdit;
|
|
|
|
|
|
ClientDataSet1: TClientDataSet;
|
|
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
|
v1Column10: TcxGridDBColumn;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
MYTypeFlag: TComboBox;
|
|
|
|
|
|
v1Column11: TcxGridDBColumn;
|
|
|
|
|
|
v1Column12: TcxGridDBColumn;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
MLOrderNo: TEdit;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
KHNameHZZ: TEdit;
|
|
|
|
|
|
v1Column13: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column1: TcxGridDBColumn;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
PBBatchNo: TEdit;
|
|
|
|
|
|
Tv1Column2: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column3: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column4: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column5: TcxGridDBColumn;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
MYColor: TEdit;
|
|
|
|
|
|
Tv1Column6: 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 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 Tv1DblClick(Sender: TObject);
|
|
|
|
|
|
procedure v1Column1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
procedure v1Column17CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
procedure v1Column3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
private
|
|
|
|
|
|
FGXName: string;
|
|
|
|
|
|
DQdate: TDateTime;
|
|
|
|
|
|
procedure InitGrid();
|
|
|
|
|
|
procedure InitForm();
|
|
|
|
|
|
function DelData(): Boolean;
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
FFInt, FCloth: Integer;
|
|
|
|
|
|
canshu1: string;
|
|
|
|
|
|
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmLLCKList: TfrmLLCKList;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_LLCKInPut;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.FormDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frmLLCKList := nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Action := caFree;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.FormCreate(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxgrid1.Align := alClient;
|
|
|
|
|
|
canshu1 := Trim(DParameters1);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
WriteCxGrid('<27>ӹ<EFBFBD><D3B9>뵥CK', Tv1, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.InitGrid();
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryMain.DisableControls;
|
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Filtered := False;
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select AA.* ');
|
|
|
|
|
|
sql.Add(',KHNameHZ=dbo.getpinyin(isnull(AA.KHNameJC,''''))+AA.GYSNo+isnull(AA.KHNameJC,'''')');
|
|
|
|
|
|
sql.Add('from(');
|
|
|
|
|
|
sql.Add(' select A.* ');
|
|
|
|
|
|
sql.Add(',KHNameJC=(select Top 1 B.KHNameJC from KH_Main B ');
|
|
|
|
|
|
sql.Add(' where isnull(B.KHFlag,'''')=''GYS'' and isnull(B.Valid,'''')=''Y'' and B.KHNO=A.GYSNo)');
|
|
|
|
|
|
sql.Add(',KHNameJCDH=(select Top 1 B.KHNameJC from KH_Main B ');
|
|
|
|
|
|
sql.Add(' where isnull(B.KHFlag,'''')=''GYS'' and isnull(B.Valid,'''')=''Y'' and B.KHNO=A.ToGYSNo)');
|
|
|
|
|
|
sql.Add(',KHNameHZZ=dbo.getpinyin(isnull(KM.KHNameJC,''''))+B.KHNO+isnull(KM.KHNameJC,'''')');
|
|
|
|
|
|
sql.Add(',KHNameJCZ=KM.KHNameJC,B.MLOrderNo,KHNOKH=B.KHNO');
|
|
|
|
|
|
sql.Add(' from CK_MYSC_CR A ');
|
|
|
|
|
|
sql.Add(' left join ML_OrderMainNew B on A.MainId=B.NewMLID');
|
|
|
|
|
|
sql.Add(' left join KH_Main KM on KM.KHNO=B.KHNO ');
|
|
|
|
|
|
sql.Add(' where 1=1 ');
|
|
|
|
|
|
if CheckBox1.Checked = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
sql.Add(' and A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM', now) + '-01') + '''');
|
|
|
|
|
|
sql.Add(' and A.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', now + 1)) + '''');
|
|
|
|
|
|
BegDate.Visible := false;
|
|
|
|
|
|
EndDate.Visible := false;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
sql.Add(' and A.CRTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', BegDate.Date)) + '''');
|
|
|
|
|
|
sql.Add(' and A.CRTime<''' + Trim(FormatDateTime('yyyy-MM-dd', EndDate.Date + 1)) + '''');
|
|
|
|
|
|
BegDate.Visible := true;
|
|
|
|
|
|
EndDate.Visible := true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
sql.Add(' and isnull(CRType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|
|
|
|
|
if canshu1 <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
sql.add(' and A.filler=''' + trim(DName) + '''');
|
|
|
|
|
|
end;
|
|
|
|
|
|
sql.Add(')AA');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS20(ADOQueryMain, Order_Main);
|
|
|
|
|
|
SInitCDSData20(ADOQueryMain, Order_Main);
|
|
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryMain.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.InitForm();
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
BegDate.Date := StrToDate(formatdatetime('yyyy-MM', SGetServerDate(ADOQueryTemp)) + '-01');
|
|
|
|
|
|
EndDate.Date := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
ReadCxGrid('<27>ӹ<EFBFBD><D3B9>뵥', Tv1, 'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
fsj := 'select Name=ZDYName,Code=Null from KH_Zdy where Type=''JGGongXu'' ';
|
|
|
|
|
|
SInitComBoxBySql(ADOQueryTemp, MYTypeFlag, False, fsj);
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.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;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmLLCKList.DelData(): Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
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(' delete YS_Money_CR where YFTypeId=''' + Trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|
|
|
|
|
sql.Add(' insert into CK_MYSC_CR_Log ');
|
|
|
|
|
|
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) + '''');
|
|
|
|
|
|
sql.Add(' delete from TP_File where WBID=''' + trim(Order_Main.fieldbyname('MYId').AsString) + ''' ');
|
|
|
|
|
|
sql.Add(' and TFType=''<27>ӹ<EFBFBD><D3B9>뵥''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Main.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Order_Main.EnableControls;
|
|
|
|
|
|
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 TfrmLLCKList.TBExportClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ADOQueryMain.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
TcxGridToExcel(Self.Caption, cxGrid1);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
TBFind.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.TBAddClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmLLCKInPut := TfrmLLCKInPut.Create(Application);
|
|
|
|
|
|
with frmLLCKInPut do
|
|
|
|
|
|
begin
|
|
|
|
|
|
PState := 0;
|
|
|
|
|
|
FMainId := '';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmLLCKInPut.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitForm();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.CheckBox1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.CheckBox2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBRafresh.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FFMYType: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
{FFMYType:=Trim(Order_Main.fieldbyname('MYType').AsString);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmLLRKInPutMH_RCCG:=TfrmLLRKInPutMH_RCCG.Create(Application);
|
|
|
|
|
|
with frmLLRKInPutMH_RCCG do
|
|
|
|
|
|
begin
|
|
|
|
|
|
PState:=1;
|
|
|
|
|
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|
|
|
|
|
FMYType:=Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|
|
|
|
|
FMYTypeFlag:=Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|
|
|
|
|
labMYType.Caption:=Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmLLRKInPutMH_RCCG.Free;
|
|
|
|
|
|
end; }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.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 TfrmLLCKList.N2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(canshu1) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Main.FieldByName('filltime').AsDateTime + 1 < Now then
|
|
|
|
|
|
begin
|
|
|
|
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>һ<EFBFBD>첻<EFBFBD><ECB2BB>ɾ<EFBFBD><C9BE>', '<27><>ʾ');
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from YS_Money_CR where YFTypeId=''' + Trim(Self.Order_Main.fieldbyname('MYId').AsString) + '''');
|
|
|
|
|
|
sql.Add(' and ChkStatusP=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryTemp.IsEmpty = false then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>ܲ<EFBFBD><DCB2><EFBFBD>', '<27><>ʾ');
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from YS_Money_CR where YFTypeId=''' + trim(Order_Main.fieldbyname('MYID').AsString) + '''');
|
|
|
|
|
|
sql.Add(' and (isnull(ChkerP,'''')<>'''' ');
|
|
|
|
|
|
sql.Add(' or isnull(ChkerQ,'''')<>'''') ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryTemp.IsEmpty = false then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>', '<27><>ʾ');
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.N1Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FFMYType: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Main.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(canshu1) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Main.FieldByName('filltime').AsDateTime + 1 < Now then
|
|
|
|
|
|
begin
|
|
|
|
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>һ<EFBFBD>첻<EFBFBD><ECB2BB><EFBFBD><EFBFBD>', '<27><>ʾ');
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from YS_Money_CR where YFTypeId=''' + Trim(Self.Order_Main.fieldbyname('MYId').AsString) + '''');
|
|
|
|
|
|
sql.Add(' and ChkStatusP=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryTemp.IsEmpty = false then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>ܲ<EFBFBD><DCB2><EFBFBD>', '<27><>ʾ');
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
{ FFMYType:=Trim(Order_Main.fieldbyname('MYType').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>ChkerP=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>''
|
|
|
|
|
|
try
|
|
|
|
|
|
frmLLRKInPutMH_RCCG:=TfrmLLRKInPutMH_RCCG.Create(Application);
|
|
|
|
|
|
with frmLLRKInPutMH_RCCG do
|
|
|
|
|
|
begin
|
|
|
|
|
|
PState:=1;
|
|
|
|
|
|
FMainId:=Trim(Self.Order_Main.fieldbyname('MYId').AsString);
|
|
|
|
|
|
FMYType:=Trim(Self.Order_Main.fieldbyname('MYType').AsString);
|
|
|
|
|
|
FMYTypeFlag:=Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString);
|
|
|
|
|
|
labMYType.Caption:=Trim(Self.Order_Main.fieldbyname('MYTypeFlag').AsString)+'<27>ӹ<EFBFBD><D3B9>뵥';
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmLLRKInPutMH_RCCG.Free;
|
|
|
|
|
|
end; }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.cxTabControl1Change(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.ZJStatusChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBFind.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.Tv1DblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
ToolButton1.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.v1Column1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
var
|
|
|
|
|
|
Id, Id10: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Id := TV1.GetColumnByFieldName('PS').Index;
|
|
|
|
|
|
Id10 := TV1.GetColumnByFieldName('MXHZPS').Index;
|
|
|
|
|
|
if (AViewInfo.GridRecord.Values[Id]) <> (AViewInfo.GridRecord.Values[Id10]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ACanvas.Brush.Color := clRed;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.v1Column17CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
var
|
|
|
|
|
|
Id, Id10: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Id := TV1.GetColumnByFieldName('KgQty').Index;
|
|
|
|
|
|
Id10 := TV1.GetColumnByFieldName('MXHZKgQty').Index;
|
|
|
|
|
|
if (AViewInfo.GridRecord.Values[Id]) <> (AViewInfo.GridRecord.Values[Id10]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ACanvas.Brush.Color := clRed;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLCKList.v1Column3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
var
|
|
|
|
|
|
Id, Id10: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Id := TV1.GetColumnByFieldName('Qty').Index;
|
|
|
|
|
|
Id10 := TV1.GetColumnByFieldName('MXHZQty').Index;
|
|
|
|
|
|
if (AViewInfo.GridRecord.Values[Id]) <> (AViewInfo.GridRecord.Values[Id10]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ACanvas.Brush.Color := clRed;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|