2025-04-30 16:20:38 +08:00
unit U_DJBRKList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
2025-09-25 13:21:52 +08:00
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
cxDropDownEdit, cxCheckBox, RM_Common, RM_Class, RM_e_Xls, RM_Dataset,
RM_System, RM_GridReport, Menus, cxCalendar, cxButtonEdit, cxTextEdit, cxPC,
BtnEdit, cxLookAndFeels, cxLookAndFeelPainters, 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, cxNavigator, dxBarBuiltInMenu;
2025-04-30 16:20:38 +08:00
type
TfrmDJBRKList = class( TForm)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBExport: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
ADOQueryCmd: TADOQuery;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
DataSource1: TDataSource;
cxGridPopupMenu1: TcxGridPopupMenu;
Label1: TLabel;
Label2: TLabel;
BegDate: TDateTimePicker;
EndDate: TDateTimePicker;
CDS_Main: TClientDataSet;
RM1: TRMGridReport;
RMDBMain: TRMDBDataSet;
RMXLSExport1: TRMXLSExport;
RMDBHZ: TRMDBDataSet;
CDS_HZ: TClientDataSet;
CDS_PRT: TClientDataSet;
TBDel: TToolButton;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
TBAdd: TToolButton;
TBEdit: TToolButton;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label8: TLabel;
SPName: TEdit;
FactoryName: TEdit;
SPID: TEdit;
SPSpec: TEdit;
Label6: TLabel;
SPCF: TEdit;
Label7: TLabel;
OrderNo: TEdit;
cxGrid2: TcxGrid;
Tv1: TcxGridDBTableView;
v1Column6: TcxGridDBColumn;
v1Column2: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1Column13: TcxGridDBColumn;
v1Column5: TcxGridDBColumn;
v1Column15: TcxGridDBColumn;
v1Column17: TcxGridDBColumn;
v1Column14: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
v1Column8: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column1: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
v1Column11: TcxGridDBColumn;
v1Column9: TcxGridDBColumn;
v2Column6: TcxGridDBColumn;
v1Column3: TcxGridDBColumn;
v1Column16: TcxGridDBColumn;
v1Column12: TcxGridDBColumn;
cxGrid2Level1: TcxGridLevel;
Label9: TLabel;
ToFactoryName: TEdit;
Label12: TLabel;
CRType: TComboBox;
v1Column18: TcxGridDBColumn;
Label10: TLabel;
KuWei: TEdit;
v1Column19: TcxGridDBColumn;
Label11: TLabel;
RCGangNo: TEdit;
Label13: TLabel;
PRTColor: TEdit;
Label14: TLabel;
SOrddefstr1: TEdit;
Label15: TLabel;
PRTHX: TEdit;
v1Column20: TcxGridDBColumn;
prtkuanNo: TEdit;
Label16: TLabel;
v1Column21: TcxGridDBColumn;
v1Column22: TcxGridDBColumn;
v1Column23: TcxGridDBColumn;
TBCHK: TToolButton;
TBNOchk: TToolButton;
cxTabControl1: TcxTabControl;
v1Column24: TcxGridDBColumn;
v1Column25: TcxGridDBColumn;
Panel5: TPanel;
Label28: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label24: TLabel;
Button5: TButton;
Button6: TButton;
factoryName1: TBtnEditA;
Com_CRype: TComboBox;
Button1: TButton;
edit_defstr2: TEdit;
edit_gangNo: TEdit;
Button2: TButton;
Button3: TButton;
edit_note: TEdit;
Button4: TButton;
TBTSedit: TToolButton;
v1Column26: TcxGridDBColumn;
defstr2: TEdit;
Label20: TLabel;
note: TEdit;
Label21: TLabel;
procedure FormDestroy( Sender: TObject) ;
procedure FormClose( Sender: TObject; var Action: TCloseAction) ;
procedure FormCreate( Sender: TObject) ;
procedure TBRafreshClick( Sender: TObject) ;
procedure ConNoMChange( Sender: TObject) ;
procedure TBCloseClick( Sender: TObject) ;
procedure FormShow( Sender: TObject) ;
procedure TBExportClick( Sender: TObject) ;
procedure TBFindClick( Sender: TObject) ;
procedure N1Click( Sender: TObject) ;
procedure N2Click( Sender: TObject) ;
procedure TBDelClick( Sender: TObject) ;
procedure TBAddClick( Sender: TObject) ;
procedure TBEditClick( Sender: TObject) ;
procedure SPIDKeyPress( Sender: TObject; var Key: Char ) ;
procedure SPIDChange( Sender: TObject) ;
procedure SPSpecChange( Sender: TObject) ;
procedure FactoryNameChange( Sender: TObject) ;
procedure OrderNoKeyPress( Sender: TObject; var Key: Char ) ;
procedure TBCHKClick( Sender: TObject) ;
procedure TBNOchkClick( Sender: TObject) ;
procedure cxTabControl1Change( Sender: TObject) ;
procedure Button5Click( Sender: TObject) ;
procedure Button1Click( Sender: TObject) ;
procedure factoryName1BtnClick( Sender: TObject) ;
procedure TBTSeditClick( Sender: TObject) ;
procedure Button6Click( Sender: TObject) ;
procedure Button2Click( Sender: TObject) ;
procedure defstr2KeyPress( Sender: TObject; var Key: Char ) ;
2025-09-29 09:32:48 +08:00
procedure Button4Click( Sender: TObject) ;
2025-04-30 16:20:38 +08:00
private
2025-09-25 13:21:52 +08:00
canshu1, canshu2: string ;
2025-04-30 16:20:38 +08:00
procedure InitGrid( ) ;
2025-09-25 13:21:52 +08:00
procedure setstatus( ) ;
2025-04-30 16:20:38 +08:00
{ Private declarations }
public
{ Public declarations }
end ;
var
frmDJBRKList: TfrmDJBRKList;
implementation
2025-09-25 13:21:52 +08:00
2025-04-30 16:20:38 +08:00
uses
2025-09-25 13:21:52 +08:00
U_DataLink, U_RTFun, U_DJBCKInPut, U_ZdyAttachGYS;
2025-04-30 16:20:38 +08:00
{$R *.dfm}
2025-09-25 13:21:52 +08:00
procedure TfrmDJBRKList. setstatus( ) ;
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
TBedit. Visible : = false ;
TBdel. Visible : = false ;
TBchk. Visible : = false ;
TBNochk. Visible : = false ;
TBTSedit. Visible : = false ;
if canshu1 = '<27> <> Ȩ<EFBFBD> <C8A8> ' then
2025-04-30 16:20:38 +08:00
begin
case cxTabControl1. TabIndex of
0 :
2025-09-25 13:21:52 +08:00
begin
TBedit. Visible : = true ;
TBdel. Visible : = true ;
TBchk. Visible : = true ;
TBTSedit. Visible : = true ;
end ;
2025-04-30 16:20:38 +08:00
1 :
2025-09-25 13:21:52 +08:00
begin
TBNochk. Visible : = True ;
TBTSedit. Visible : = true ;
end ;
2025-04-30 16:20:38 +08:00
end ;
end
else
begin
case cxTabControl1. TabIndex of
0 :
2025-09-25 13:21:52 +08:00
begin
TBedit. Visible : = true ;
TBdel. Visible : = true ;
2025-04-30 16:20:38 +08:00
// TBchk.Visible:=true;
2025-09-25 13:21:52 +08:00
end ;
2025-04-30 16:20:38 +08:00
1 :
2025-09-25 13:21:52 +08:00
begin
2025-04-30 16:20:38 +08:00
// TBNochk.Visible:=True;
2025-09-25 13:21:52 +08:00
end ;
2025-04-30 16:20:38 +08:00
end ;
end ;
end ;
procedure TfrmDJBRKList. FormDestroy( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
frmDJBRKList : = nil ;
2025-04-30 16:20:38 +08:00
end ;
2025-09-25 13:21:52 +08:00
procedure TfrmDJBRKList. FormClose( Sender: TObject; var Action: TCloseAction) ;
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
Action : = caFree;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. FormCreate( Sender: TObject) ;
begin
//cxGrid1.Align:=alClient;
2025-09-25 13:21:52 +08:00
canshu1 : = Trim( DParameters1) ;
canshu2 : = Trim( DParameters2) ;
EndDate. DateTime : = SGetServerDate10( ADOQueryTemp) ;
BegDate. DateTime : = EndDate. DateTime;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. InitGrid( ) ;
begin
try
ADOQueryMain. DisableControls;
with ADOQueryMain do
begin
2025-09-25 13:21:52 +08:00
Filtered : = False ;
2025-04-30 16:20:38 +08:00
Close;
sql. Clear;
sql. Add( ' select A.* ,AvgQty=case when piQty<>0 then cast(Qty/piQty as decimal(18,2)) else 0 end' ) ;
sql. Add( ',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)' ) ;
sql. Add( ' ,SOrddefstr1=(select SOrddefstr1 from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTColor=(select PRTColor from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTkuanNo=(select PRTkuanNo from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTHX=(select PRTHX from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' from CK_SXPB_CR A' ) ;
2025-09-25 13:21:52 +08:00
sql. add( ' where A.CRTime>=' '' + Trim( FormatDateTime( 'yyyy-MM-dd' , BegDate. DateTime) ) + '' '' ) ;
sql. Add( ' and A.CRTime<=' '' + Trim( FormatDateTime( 'yyyy-MM-dd' , enddate. DateTime + 1 ) ) + '' '' ) ;
2025-04-30 16:20:38 +08:00
sql. Add( ' and isnull(CKName,' '' ')=' '<27> <> <EFBFBD> 첼' '' ) ;
SQL. Add( ' and CRFlag=' '<27> <> <EFBFBD> <EFBFBD> ' ' ' ) ;
2025-09-25 13:21:52 +08:00
if cxTabControl1. TabIndex < 2 then
SQL. Add( ' and isnull(A.chkstatus,' '0' ')=' '' + inttostr( cxTabControl1. TabIndex) + '' ' ' ) ;
2025-04-30 16:20:38 +08:00
Open;
//ShowMessage(SQL.Text);
end ;
2025-09-25 13:21:52 +08:00
SCreateCDS20( ADOQueryMain, CDS_Main) ;
SInitCDSData20( ADOQueryMain, CDS_Main) ;
2025-04-30 16:20:38 +08:00
finally
ADOQueryMain. EnableControls;
end ;
end ;
procedure TfrmDJBRKList. TBRafreshClick( Sender: TObject) ;
begin
BegDate. SetFocus;
InitGrid( ) ;
end ;
procedure TfrmDJBRKList. ConNoMChange( Sender: TObject) ;
begin
if ADOQueryMain. Active then
begin
2025-09-25 13:21:52 +08:00
SDofilter( ADOQueryMain, SGetFilters( Panel1, 1 , 2 ) ) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. TBCloseClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
WriteCxGrid( '<27> <> <EFBFBD> 첼<EFBFBD> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ' , Tv1, '<27> <> <EFBFBD> 첼<EFBFBD> ֿ<EFBFBD> ' ) ;
2025-04-30 16:20:38 +08:00
Close;
end ;
procedure TfrmDJBRKList. FormShow( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if Trim( canshu2) = '<27> 鿴' then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
TBAdd. Visible : = False ;
TBDel. Visible : = False ;
TBEdit. Visible : = False ;
end
else
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
TBAdd. Visible : = True ;
TBDel. Visible : = True ;
TBEdit. Visible : = True ;
2025-04-30 16:20:38 +08:00
end ;
2025-09-25 13:21:52 +08:00
ReadCxGrid( '<27> <> <EFBFBD> 첼<EFBFBD> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ' , Tv1, '<27> <> <EFBFBD> 첼<EFBFBD> ֿ<EFBFBD> ' ) ;
2025-04-30 16:20:38 +08:00
setstatus( ) ;
// InitGrid();
end ;
procedure TfrmDJBRKList. TBExportClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if ADOQueryMain. IsEmpty then
exit;
TcxGridToExcel( '<27> <> <EFBFBD> 첼<EFBFBD> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> б <EFBFBD> ' , cxGrid2) ;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. TBFindClick( Sender: TObject) ;
begin
if ADOQueryMain. Active then
begin
2025-09-25 13:21:52 +08:00
SDofilter( ADOQueryMain, SGetFilters( Panel1, 1 , 2 ) ) ;
SCreateCDS20( ADOQueryMain, CDS_Main) ;
SInitCDSData20( ADOQueryMain, CDS_Main) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. N1Click( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
SelOKNo( CDS_Main, True ) ;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. N2Click( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
SelOKNo( CDS_Main, False ) ;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. TBDelClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
Exit;
if Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) < > '' then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
if Trim( CDS_Main. fieldbyname( 'CRType' ) . AsString) = 'ƽ <> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
Application. MessageBox( 'ƽ <> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
Exit;
end ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
2025-09-25 13:21:52 +08:00
sql. Add( 'select * from CK_SXPB_CR where FZSPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
2025-04-30 16:20:38 +08:00
sql. Add( ' and CRQtyFlag=-1' ) ;
Open;
end ;
2025-09-25 13:21:52 +08:00
if ADOQueryTemp. IsEmpty = False then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> г <EFBFBD> <D0B3> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
Exit;
end ;
2025-09-25 13:21:52 +08:00
if Application. MessageBox( 'ȷ<> <C8B7> Ҫɾ<D2AA> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , '<27> <> ʾ ' , 3 2 + 4 ) < > IDYES then
Exit;
2025-04-30 16:20:38 +08:00
try
ADOQueryCmd. Connection. BeginTrans;
with ADOQueryCmd do
begin
Close;
sql. Clear;
2025-09-25 13:21:52 +08:00
sql. Add( ' delete CK_SXPB_CR where SPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
2025-04-30 16:20:38 +08:00
{ sql. Add( 'Update CK_SXPB_KC Set KCKGQty=(select sum(isnull(KGQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.CRID=CK_SXPB_KC.CRID)' ) ;
sql. Add( ',KCPiQty=(select sum(isnull(PiQty,0)*CRQtyFlag) from CK_SXPB_CR A where A.CRID=CK_SXPB_KC.CRID)' ) ;
sql. Add( ' where CRID=' + Trim( CDS_Main. fieldbyname( 'CRID' ) . AsString) ) ; }
2025-09-25 13:21:52 +08:00
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> <ECB2BC> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> ' ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> <> <EFBFBD> ⵥ<EFBFBD> ţ<EFBFBD> ' + trim( CDS_Main. FieldByName( 'SPID' ) . AsString) + ',<2C> ӹ<EFBFBD> <D3B9> <EFBFBD> ' + trim( CDS_Main. FieldByName( 'factoryName' ) . AsString) + ',<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' + trim( CDS_Main. FieldByName( 'QCorderNo' ) . AsString) + ',ƥ<> <C6A5> ' + trim( CDS_Main. FieldByName( 'piqty' ) . AsString) ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> ɹ<EFBFBD> ' ) ) ) ;
sql. Add( ')' ) ;
2025-04-30 16:20:38 +08:00
ExecSQL;
end ;
{ with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select KCKGQty=isnull(KCKGQty,0) from CK_SXPB_KC where CRID=' + Trim( CDS_Main. fieldbyname( 'CRID' ) . AsString) ) ;
Open;
end ;
if ADOQueryTemp. IsEmpty= False then
begin
if ADOQueryTemp. FieldByName( 'KCKGQty' ) . Value< 0 then
begin
ADOQueryCmd. Connection. RollbackTrans;
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <E2B9AB> <EFBFBD> <EFBFBD> С <EFBFBD> ڳ<EFBFBD> <DAB3> <EFBFBD> <E2B9AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <C9BE> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
end ; }
ADOQueryCmd. Connection. CommitTrans;
CDS_Main. Delete;
except
ADOQueryCmd. Connection. RollbackTrans;
2025-09-25 13:21:52 +08:00
Application. MessageBox( 'ɾ<> <C9BE> <EFBFBD> 쳣!' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
end ;
2025-09-25 13:21:52 +08:00
end
else
2025-04-30 16:20:38 +08:00
begin
CDS_Main. Delete;
end ;
end ;
procedure TfrmDJBRKList. TBAddClick( Sender: TObject) ;
begin
try
2025-09-25 13:21:52 +08:00
frmDJBCKInPut : = TfrmDJBCKInPut. Create( Application) ;
2025-04-30 16:20:38 +08:00
with frmDJBCKInPut do
begin
2025-09-25 13:21:52 +08:00
FBCId : = '' ;
if ShowModal = 1 then
2025-04-30 16:20:38 +08:00
begin
Self. InitGrid( ) ;
end ;
end ;
finally
frmDJBCKInPut. Free;
end ;
end ;
procedure TfrmDJBRKList. TBEditClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
Exit;
if Trim( CDS_Main. fieldbyname( 'CRType' ) . AsString) = 'ƽ <> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' then
begin
Application. MessageBox( 'ƽ <> <C6BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select * from CK_SXPB_CR where FZSPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
sql. Add( ' and CRQtyFlag=-1' ) ;
Open;
end ;
if ADOQueryTemp. IsEmpty = False then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> г <EFBFBD> <D0B3> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
Exit;
end ;
try
2025-09-25 13:21:52 +08:00
frmDJBCKInPut : = TfrmDJBCKInPut. Create( Application) ;
2025-04-30 16:20:38 +08:00
with frmDJBCKInPut do
begin
2025-09-25 13:21:52 +08:00
FBCId : = Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) ;
TBDel. Visible : = False ;
TBAdd. Visible : = False ;
if ShowModal = 1 then
2025-04-30 16:20:38 +08:00
begin
Self. InitGrid( ) ;
end ;
end ;
finally
frmDJBCKInPut. Free;
end ;
end ;
procedure TfrmDJBRKList. SPIDKeyPress( Sender: TObject; var Key: Char ) ;
begin
2025-09-25 13:21:52 +08:00
if Key = #13 then
2025-04-30 16:20:38 +08:00
begin
{ if Length( Trim( SPID. Text ) ) < 4 then Exit;
try
ADOQueryMain. DisableControls;
with ADOQueryMain do
begin
Filtered: = False ;
Close;
sql. Clear;
sql. Add( ' select A.* ' ) ;
sql. Add( ',ConNo=(select ConNo from Contract_Main CM where CM.MainId=A.CGMainId)' ) ;
//sql.Add(' ,ConNo=(select ConNo from Contract_Main CM where CM.MainId=A.CGMainId )');
sql. Add( ' from CK_SXPB_CR A' ) ;
sql. add( ' where SPID like :SXID' ) ;
Parameters. ParamByName( 'SXID' ) . Value: = '%' + Trim( SXID. Text ) + '%' ;
Open;
//ShowMessage(SQL.Text);
end ;
SCreateCDS20( ADOQueryMain, CDS_Main) ;
SInitCDSData20( ADOQueryMain, CDS_Main) ;
finally
ADOQueryMain. EnableControls;
end ; }
end ;
end ;
procedure TfrmDJBRKList. SPIDChange( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if Length( Trim( SPID. Text ) ) < 4 then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
if Trim( SPID. Text ) < > '' then
Exit;
2025-04-30 16:20:38 +08:00
end ;
TBFind. Click;
end ;
procedure TfrmDJBRKList. SPSpecChange( Sender: TObject) ;
begin
TBFind. Click;
end ;
procedure TfrmDJBRKList. FactoryNameChange( Sender: TObject) ;
begin
TBFind. Click;
end ;
procedure TfrmDJBRKList. OrderNoKeyPress( Sender: TObject; var Key: Char ) ;
begin
2025-09-25 13:21:52 +08:00
if trim( OrderNo. Text ) = '' then
exit;
if Key = #13 then
2025-04-30 16:20:38 +08:00
begin
try
ADOQueryMain. DisableControls;
with ADOQueryMain do
begin
Close;
2025-09-25 13:21:52 +08:00
Filtered : = False ;
2025-04-30 16:20:38 +08:00
sql. Clear;
sql. Add( ' select A.* ' ) ;
sql. Add( ',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)' ) ;
sql. Add( ' ,SOrddefstr1=(select SOrddefstr1 from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTColor=(select PRTColor from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTkuanNo=(select PRTkuanNo from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTHX=(select PRTHX from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' from CK_SXPB_CR A' ) ;
2025-09-25 13:21:52 +08:00
sql. add( ' where exists(select MainID from JYOrder_Main X where X.mainID=A.ORDMainIdRK and X.orderNo like ' + quotedstr( '%' + trim( OrderNo. text ) + '%' ) + ')' ) ;
2025-04-30 16:20:38 +08:00
sql. Add( ' and isnull(CKName,' '' ')=' '<27> <> <EFBFBD> 첼' '' ) ;
SQL. Add( ' and CRFlag=' '<27> <> <EFBFBD> <EFBFBD> ' ' ' ) ;
2025-09-25 13:21:52 +08:00
if cxTabControl1. TabIndex < 2 then
SQL. Add( ' and isnull(A.chkstatus,' '0' ')=' '' + inttostr( cxTabControl1. TabIndex) + '' ' ' ) ;
2025-04-30 16:20:38 +08:00
Open;
//ShowMessage(SQL.Text);
2025-09-25 13:21:52 +08:00
end ;
SCreateCDS20( ADOQueryMain, CDS_Main) ;
SInitCDSData20( ADOQueryMain, CDS_Main) ;
2025-04-30 16:20:38 +08:00
finally
ADOQueryMain. EnableControls;
end ;
end ;
end ;
procedure TfrmDJBRKList. TBCHKClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
exit;
if CDS_Main. Locate( 'SSel' , True , [ ] ) = False then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
Application. MessageBox( 'û<> <C3BB> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
Exit;
end ;
try
with CDS_Main do
begin
DisableControls;
while not eof do
begin
2025-09-25 13:21:52 +08:00
if fieldbyname( 'ssel' ) . AsBoolean then
2025-04-30 16:20:38 +08:00
begin
with ADOQueryCmd do
begin
close;
sql. Clear;
2025-09-25 13:21:52 +08:00
sql. Add( 'update CK_SXPB_CR SET chkstatus=' '1' ',chker=' '' + trim( DName) + '' ',chkTime=getdate() ' ) ;
sql. Add( 'where SPID=' + quotedstr( trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) ) ) ;
2025-04-30 16:20:38 +08:00
execsql;
end ;
end ;
next;
end ;
EnableControls;
end ;
2025-09-25 13:21:52 +08:00
application. MessageBox( '<27> <> <EFBFBD> ˳ɹ<CBB3> <C9B9> <EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' ) ;
2025-04-30 16:20:38 +08:00
TBRafresh. Click;
except
2025-09-25 13:21:52 +08:00
application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. TBNOchkClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
exit;
if CDS_Main. Locate( 'SSel' , True , [ ] ) = False then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
Application. MessageBox( 'û<> <C3BB> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
Exit;
end ;
try
with CDS_Main do
begin
DisableControls;
while not eof do
begin
2025-09-25 13:21:52 +08:00
if fieldbyname( 'ssel' ) . AsBoolean then
2025-04-30 16:20:38 +08:00
begin
with ADOQueryCmd do
begin
close;
sql. Clear;
2025-09-25 13:21:52 +08:00
sql. Add( 'update CK_SXPB_CR SET chkstatus=' '0' ',chker=' '' + trim( DName) + '' ',chkTime=getdate() ' ) ;
sql. Add( 'where SPID=' + quotedstr( trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) ) ) ;
2025-04-30 16:20:38 +08:00
execsql;
end ;
end ;
next;
end ;
EnableControls;
end ;
2025-09-25 13:21:52 +08:00
application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˳ɹ<CBB3> <C9B9> <EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' ) ;
2025-04-30 16:20:38 +08:00
TBRafresh. Click;
except
2025-09-25 13:21:52 +08:00
application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. cxTabControl1Change( Sender: TObject) ;
begin
setstatus( ) ;
InitGrid( ) ;
end ;
procedure TfrmDJBRKList. Button5Click( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
exit;
if trim( factoryName1. Text ) = '' then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
application. MessageBox( '<27> ӹ<EFBFBD> <D3B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
2025-04-30 16:20:38 +08:00
exit;
end ;
2025-09-25 13:21:52 +08:00
if Application. MessageBox( 'ȷ<> <C8B7> Ҫ<EFBFBD> ļӹ<C4BC> <D3B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , '<27> <> ʾ ' , 3 2 + 4 ) < > IDYES then
Exit;
2025-04-30 16:20:38 +08:00
try
with ADOQueryCmd do
begin
Close;
sql. Clear;
2025-09-25 13:21:52 +08:00
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> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> <> <EFBFBD> ⵥ<EFBFBD> ţ<EFBFBD> ' + trim( CDS_Main. FieldByName( 'SPID' ) . AsString) + ',ԭ<> ӹ<EFBFBD> <D3B9> <EFBFBD> ' + Trim( CDS_Main. fieldbyname( 'factoryName' ) . AsString) + ',<2C> ĺ<DEB8> ' + trim( factoryName1. Text ) ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> ɹ<EFBFBD> ' ) ) ) ;
sql. Add( ')' ) ;
sql. Add( 'update CK_SXPB_CR SET factoryName=' '' + trim( factoryName1. Text ) + '' ',edittime=getdate() where SPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
2025-04-30 16:20:38 +08:00
// sql.Add('update WFB_MJJY SET factoryName='''+trim(factoryName1.Text)+''' where APID='''+Trim(CDS_Main.fieldbyname('SPID').AsString)+'''');
ExecSQL;
end ;
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
Panel5. Visible : = false ;
2025-04-30 16:20:38 +08:00
TBRafresh. Click;
except
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. Button1Click( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
exit;
if trim( Com_CRype. Text ) = '' then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
2025-04-30 16:20:38 +08:00
exit;
end ;
2025-09-25 13:21:52 +08:00
if Application. MessageBox( 'ȷ<> <C8B7> Ҫ<EFBFBD> <EFBFBD> <DEB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , '<27> <> ʾ ' , 3 2 + 4 ) < > IDYES then
Exit;
2025-04-30 16:20:38 +08:00
try
with ADOQueryCmd do
begin
Close;
sql. Clear;
2025-09-25 13:21:52 +08:00
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> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> <> <EFBFBD> ⵥ<EFBFBD> ţ<EFBFBD> ' + trim( CDS_Main. FieldByName( 'SPID' ) . AsString) + ',ԭ<> <D4AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' + Trim( CDS_Main. fieldbyname( 'CRType' ) . AsString) + ',<2C> ĺ<DEB8> ' + trim( Com_CRype. Text ) ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> ɹ<EFBFBD> ' ) ) ) ;
sql. Add( ')' ) ;
sql. Add( 'update CK_SXPB_CR SET CRType=' '' + trim( Com_CRype. Text ) + '' ' where SPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
2025-04-30 16:20:38 +08:00
ExecSQL;
end ;
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
Panel5. Visible : = false ;
2025-04-30 16:20:38 +08:00
TBRafresh. Click;
except
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. factoryName1BtnClick( Sender: TObject) ;
begin
try
2025-09-25 13:21:52 +08:00
frmZdyAttachGYS : = TfrmZdyAttachGYS. Create( Application) ;
2025-04-30 16:20:38 +08:00
with frmZdyAttachGYS do
begin
2025-09-25 13:21:52 +08:00
if ShowModal = 1 then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
factoryName1. Text : = Trim( frmZdyAttachGYS. CDS_HZ. fieldbyname( 'ZdyName' ) . AsString) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
finally
frmZdyAttachGYS. Free;
end ;
end ;
procedure TfrmDJBRKList. TBTSeditClick( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
factoryName1. Text : = '' ;
Com_CRype. Text : = '' ;
edit_defstr2. Text : = '' ;
edit_gangNo. Text : = '' ;
edit_note. Text : = '' ;
Panel5. Left : = ( self. Width - Panel5. Width) div 2 ;
Panel5. Visible : = true ;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. Button6Click( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
Panel5. Visible : = false ;
2025-04-30 16:20:38 +08:00
end ;
procedure TfrmDJBRKList. Button2Click( Sender: TObject) ;
begin
2025-09-25 13:21:52 +08:00
if CDS_Main. IsEmpty then
exit;
if trim( edit_defstr2. Text ) = '' then
2025-04-30 16:20:38 +08:00
begin
2025-09-25 13:21:52 +08:00
application. MessageBox( 'ͳ<> Ƶ<EFBFBD> <C6B5> Ų<EFBFBD> <C5B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
2025-04-30 16:20:38 +08:00
exit;
end ;
2025-09-25 13:21:52 +08:00
if Application. MessageBox( 'ȷ<> <C8B7> Ҫ<EFBFBD> <EFBFBD> ͳ<EFBFBD> Ƶ<EFBFBD> <C6B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' , '<27> <> ʾ ' , 3 2 + 4 ) < > IDYES then
Exit;
2025-04-30 16:20:38 +08:00
try
with CDS_Main do
begin
DisableControls;
first;
while not eof do
begin
2025-09-25 13:21:52 +08:00
if fieldbyName( 'Ssel' ) . AsBoolean then
2025-04-30 16:20:38 +08:00
begin
with ADOQueryCmd do
begin
Close;
sql. Clear;
2025-09-25 13:21:52 +08:00
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> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> <> <EFBFBD> ⵥ<EFBFBD> ţ<EFBFBD> ' + trim( CDS_Main. FieldByName( 'SPID' ) . AsString) + ',ԭͳ<D4AD> Ƶ<EFBFBD> <C6B5> <EFBFBD> ' + Trim( CDS_Main. fieldbyname( 'defstr2' ) . AsString) + ',<2C> ĺ<DEB8> ' + trim( edit_defstr2. Text ) ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> ɹ<EFBFBD> ' ) ) ) ;
sql. Add( ')' ) ;
sql. Add( 'update CK_SXPB_CR SET defstr2=' '' + trim( edit_defstr2. Text ) + '' ' where SPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
2025-04-30 16:20:38 +08:00
ExecSQL;
end ;
end ;
next;
end ;
EnableControls;
end ;
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
Panel5. Visible : = false ;
2025-04-30 16:20:38 +08:00
TBRafresh. Click;
except
2025-09-25 13:21:52 +08:00
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> !' , '<27> <> ʾ ' , 0 ) ;
2025-04-30 16:20:38 +08:00
end ;
end ;
procedure TfrmDJBRKList. defstr2KeyPress( Sender: TObject; var Key: Char ) ;
begin
2025-09-25 13:21:52 +08:00
if trim( defstr2. Text ) = '' then
exit;
if Key = #13 then
2025-04-30 16:20:38 +08:00
begin
try
ADOQueryMain. DisableControls;
with ADOQueryMain do
begin
Close;
2025-09-25 13:21:52 +08:00
Filtered : = False ;
2025-04-30 16:20:38 +08:00
sql. Clear;
sql. Add( ' select A.* ' ) ;
sql. Add( ',OrderNO=(select OrderNO from JYOrder_Main JM where JM.MainId=A.ORDMainIdRK)' ) ;
sql. Add( ' ,SOrddefstr1=(select SOrddefstr1 from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTColor=(select PRTColor from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTkuanNo=(select PRTkuanNo from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' ,PRTHX=(select PRTHX from JYOrder_Sub JM where JM.SubId=A.OrdSubIdRK )' ) ;
sql. Add( ' from CK_SXPB_CR A' ) ;
2025-09-25 13:21:52 +08:00
sql. add( ' where A.defstr2 like ' + quotedstr( '%' + trim( OrderNo. text ) + '%' ) ) ;
2025-04-30 16:20:38 +08:00
sql. Add( ' and isnull(CKName,' '' ')=' '<27> <> <EFBFBD> 첼' '' ) ;
SQL. Add( ' and CRFlag=' '<27> <> <EFBFBD> <EFBFBD> ' ' ' ) ;
2025-09-25 13:21:52 +08:00
if cxTabControl1. TabIndex < 2 then
SQL. Add( ' and isnull(A.chkstatus,' '0' ')=' '' + inttostr( cxTabControl1. TabIndex) + '' ' ' ) ;
2025-04-30 16:20:38 +08:00
Open;
//ShowMessage(SQL.Text);
2025-09-25 13:21:52 +08:00
end ;
SCreateCDS20( ADOQueryMain, CDS_Main) ;
SInitCDSData20( ADOQueryMain, CDS_Main) ;
2025-04-30 16:20:38 +08:00
finally
ADOQueryMain. EnableControls;
end ;
end ;
2025-09-29 09:32:48 +08:00
end ;
procedure TfrmDJBRKList. Button4Click( Sender: TObject) ;
begin
if CDS_Main. IsEmpty then
exit;
if trim( edit_note. Text ) = '' then
begin
application. MessageBox( '<27> <> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
exit;
end ;
if Application. MessageBox( 'ȷ<> <C8B7> Ҫ<EFBFBD> ı <DEB8> ע<EFBFBD> <D7A2> <EFBFBD> <EFBFBD> ' , '<27> <> ʾ ' , 3 2 + 4 ) < > IDYES then
Exit;
try
with ADOQueryCmd do
begin
Close;
sql. Clear;
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> <ECB2BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> <> <EFBFBD> ⵥ<EFBFBD> ţ<EFBFBD> ' + trim( CDS_Main. FieldByName( 'SPID' ) . AsString) + ',ԭ<> <D4AD> ע' + Trim( CDS_Main. fieldbyname( 'Note' ) . AsString) + ',<2C> ĺ<DEB8> ' + trim( edit_note. Text ) ) ) ) ;
sql. Add( ',' + quotedstr( trim( '<27> ɹ<EFBFBD> ' ) ) ) ;
sql. Add( ')' ) ;
sql. Add( 'update CK_SXPB_CR SET Note=' '' + trim( edit_note. Text ) + '' ',edittime=getdate() where SPID=' '' + Trim( CDS_Main. fieldbyname( 'SPID' ) . AsString) + '' '' ) ;
ExecSQL;
end ;
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
Panel5. Visible : = false ;
TBRafresh. Click;
except
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> !' , '<27> <> ʾ ' , 0 ) ;
end ;
2025-04-30 16:20:38 +08:00
end ;
end .
2025-09-25 13:21:52 +08:00