668 lines
20 KiB
ObjectPascal
668 lines
20 KiB
ObjectPascal
![]() |
unit U_CKProductBCPKCList;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
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, MovePanel, cxCheckBox,
|
|||
|
Menus, cxCalendar, RM_Common, RM_Class, RM_GridReport, RM_System,
|
|||
|
RM_Dataset, BtnEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
|
|||
|
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
|
|||
|
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
|||
|
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans,
|
|||
|
dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
|
|||
|
dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
|
|||
|
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
|
|||
|
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
|
|||
|
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
|
|||
|
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter;
|
|||
|
|
|||
|
type
|
|||
|
TfrmCKProductBCPKCList = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBFind: TToolButton;
|
|||
|
TBExport: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
Panel1: TPanel;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
Label3: TLabel;
|
|||
|
MPRTCodeName: TEdit;
|
|||
|
Label1: TLabel;
|
|||
|
Label2: TLabel;
|
|||
|
BegDate: TDateTimePicker;
|
|||
|
EndDate: TDateTimePicker;
|
|||
|
CDS_Main: TClientDataSet;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
cxGrid2Level1: TcxGridLevel;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
v2Column3: TcxGridDBColumn;
|
|||
|
v2Column5: TcxGridDBColumn;
|
|||
|
v2Column6: TcxGridDBColumn;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
Label5: TLabel;
|
|||
|
orderNo: TEdit;
|
|||
|
Label6: TLabel;
|
|||
|
MJID: TEdit;
|
|||
|
v1Column7: TcxGridDBColumn;
|
|||
|
v1Column6: TcxGridDBColumn;
|
|||
|
v1Column8: TcxGridDBColumn;
|
|||
|
v1Column9: TcxGridDBColumn;
|
|||
|
Label8: TLabel;
|
|||
|
MPRTKZ: TEdit;
|
|||
|
Label9: TLabel;
|
|||
|
MPRTMF: TEdit;
|
|||
|
Label7: TLabel;
|
|||
|
CPType: TComboBox;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
v1Column2: TcxGridDBColumn;
|
|||
|
v1Column4: TcxGridDBColumn;
|
|||
|
v1Column5: TcxGridDBColumn;
|
|||
|
Panel4: TPanel;
|
|||
|
Label11: TLabel;
|
|||
|
Panel10: TPanel;
|
|||
|
Image2: TImage;
|
|||
|
RichEdit1: TRichEdit;
|
|||
|
MovePanel2: TMovePanel;
|
|||
|
v1Column11: TcxGridDBColumn;
|
|||
|
TBZD: TToolButton;
|
|||
|
v1Column12: TcxGridDBColumn;
|
|||
|
PopupMenu1: TPopupMenu;
|
|||
|
N1: TMenuItem;
|
|||
|
N2: TMenuItem;
|
|||
|
v1Column10: TcxGridDBColumn;
|
|||
|
v1Column13: TcxGridDBColumn;
|
|||
|
Label4: TLabel;
|
|||
|
Label10: TLabel;
|
|||
|
PRTColor: TComboBox;
|
|||
|
MJstr4: TComboBox;
|
|||
|
v1Column14: TcxGridDBColumn;
|
|||
|
ThreeColorBase: TcxStyleRepository;
|
|||
|
SHuangSe: TcxStyle;
|
|||
|
SkyBlue: TcxStyle;
|
|||
|
Default: TcxStyle;
|
|||
|
QHuangSe: TcxStyle;
|
|||
|
Red: TcxStyle;
|
|||
|
FontBlue: TcxStyle;
|
|||
|
TextSHuangSe: TcxStyle;
|
|||
|
FonePurple: TcxStyle;
|
|||
|
FoneClMaroon: TcxStyle;
|
|||
|
FoneRed: TcxStyle;
|
|||
|
RowColor: TcxStyle;
|
|||
|
handBlack: TcxStyle;
|
|||
|
cxBlue: TcxStyle;
|
|||
|
TBSAVE: TToolButton;
|
|||
|
Label12: TLabel;
|
|||
|
baoNo: TEdit;
|
|||
|
CheckBox1: TCheckBox;
|
|||
|
print: TToolButton;
|
|||
|
RMDB_Main: TRMDBDataSet;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
RM2: TRMGridReport;
|
|||
|
ComboBox1: TComboBox;
|
|||
|
Label34: TLabel;
|
|||
|
v1Column15: TcxGridDBColumn;
|
|||
|
PRTKuanNO: TEdit;
|
|||
|
Label13: TLabel;
|
|||
|
v1Column16: TcxGridDBColumn;
|
|||
|
RKPlace1: TBtnEditA;
|
|||
|
Label14: TLabel;
|
|||
|
Button1: TButton;
|
|||
|
RKplace: TEdit;
|
|||
|
Label15: TLabel;
|
|||
|
v1Column17: TcxGridDBColumn;
|
|||
|
TOK: TToolButton;
|
|||
|
v1Column18: TcxGridDBColumn;
|
|||
|
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 MPRTCodeNameChange(Sender: TObject);
|
|||
|
procedure Panel10MouseMove(Sender: TObject; Shift: TShiftState; X,
|
|||
|
Y: Integer);
|
|||
|
procedure Image2Click(Sender: TObject);
|
|||
|
procedure Tv1MouseUp(Sender: TObject; Button: TMouseButton;
|
|||
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure TBZDClick(Sender: TObject);
|
|||
|
procedure N1Click(Sender: TObject);
|
|||
|
procedure N2Click(Sender: TObject);
|
|||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure PRTColorChange(Sender: TObject);
|
|||
|
procedure MJstr4Change(Sender: TObject);
|
|||
|
procedure TBSAVEClick(Sender: TObject);
|
|||
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
procedure printClick(Sender: TObject);
|
|||
|
procedure RKPlace1BtnClick(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
procedure TOKClick(Sender: TObject);
|
|||
|
private
|
|||
|
FLeft,FTop:Integer;
|
|||
|
procedure InitGrid();
|
|||
|
function PrtData(FMJID:String):boolean;
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
issel:integer;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmCKProductBCPKCList: TfrmCKProductBCPKCList;
|
|||
|
|
|||
|
implementation
|
|||
|
uses
|
|||
|
U_DataLink,U_Fun,U_ProductOrderListSel, U_ZDYHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
function TfrmCKProductBCPKCList.PrtData(FMJID:String):boolean;
|
|||
|
var
|
|||
|
fPrintFile:String;
|
|||
|
Txt,fImagePath:string;
|
|||
|
Moudle: THandle;
|
|||
|
Makebar:TMakebar;
|
|||
|
Mixtext:TMixtext;
|
|||
|
begin
|
|||
|
result:=false;
|
|||
|
try
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' EXEC P_Print_JYLab ');
|
|||
|
SQL.Add(' @MJID='''+Trim(FMJID)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
|||
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
|||
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
|||
|
Txt:=Trim(ADOQueryPrint.fieldbyname('MJID').AsString);
|
|||
|
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp' ;
|
|||
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
|||
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
|||
|
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
|||
|
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(ADOQueryPrint.fieldbyname('LbName').AsString)<>'' then
|
|||
|
fPrintFile:=ExtractFilePath(Application.ExeName)+'Report\'+Trim(ADOQueryPrint.fieldbyname('LbName').AsString)+'.rmf'
|
|||
|
else
|
|||
|
fPrintFile:=ExtractFilePath(Application.ExeName)+'Report\ͨ<><CDA8>Ӣ<EFBFBD>ı<EFBFBD>ǩ.rmf' ;
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['QRBARCODE']:=fImagePath;
|
|||
|
Rm2.DefaultCopies:=strtointdef(trim(ComboBox1.Text),1);
|
|||
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
//RM2.ShowReport;
|
|||
|
RM2.PrintReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+fPrintFile),'<27><>ʾ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
result:=true;
|
|||
|
except
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmCKProductBCPKCList:=nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.FormClose(Sender: TObject;
|
|||
|
var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action:=caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
BegDate.DateTime:=SGetServerDateTime(ADOQueryTemp);
|
|||
|
EndDate.DateTime:=SGetServerDateTime(ADOQueryTemp)
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.InitGrid();
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered:=False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('exec P_View_CPKCMX :WSQl');
|
|||
|
// sql.Add('exec P_JYOrder_HZFX20 ' + quotedstr(FormatDateTime('yyyy-MM-dd', BegDate.DateTime)) + ',' + quotedstr(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) + ',0,'''' ');
|
|||
|
if Trim(DParameters2)<>'<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
// Parameters.ParamByName('WSQl').Value:=' and B.Filler='''+Trim(DName)+'''';
|
|||
|
end else
|
|||
|
begin
|
|||
|
// Parameters.ParamByName('WSQl').Value:='';
|
|||
|
end;
|
|||
|
Parameters.ParamByName('WSQl').Value:=' and A.CRTime>='''+(FormatDateTime('yyyy-MM-dd', BegDate.DateTime))+''' and A.CRTime<'+quotedstr(FormatDateTime('yyyy-MM-dd', enddate.DateTime + 1)) ;
|
|||
|
// ShowMessage(sql.text);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
// BegDate.SetFocus;
|
|||
|
MovePanel2.Visible:=True;
|
|||
|
MovePanel2.Refresh;
|
|||
|
InitGrid();
|
|||
|
MovePanel2.Visible:=False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.ConNoMChange(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
WriteCxGrid('<27>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>',Tv1,'<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
|
|||
|
ReadCxGrid('<27>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>',Tv1,'<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
if Trim(DParameters2)='<27><><EFBFBD><EFBFBD>' then
|
|||
|
begin
|
|||
|
TBZD.Visible:=True;
|
|||
|
TBSAVE.Visible:=false;
|
|||
|
// ToolButton1.Visible:=true;
|
|||
|
end else
|
|||
|
begin
|
|||
|
TBSAVE.Visible:=false;
|
|||
|
TBZD.Visible:=False;
|
|||
|
// ToolButton1.Visible:=false;
|
|||
|
end;
|
|||
|
IF issel=1 then
|
|||
|
begin
|
|||
|
TBSAVE.Visible:=false;
|
|||
|
TBZD.Visible:=False;
|
|||
|
TOK.Visible:=true;
|
|||
|
end;
|
|||
|
//InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TBExportClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.IsEmpty then exit;
|
|||
|
TcxGridToExcel('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>',cxGrid2);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TBFindClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.MPRTCodeNameChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.Panel10MouseMove(Sender: TObject;
|
|||
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
begin
|
|||
|
ReleaseCapture;
|
|||
|
TWinControl(Panel4).Perform(WM_SYSCOMMAND,$F012,0);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.Image2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel4.Visible:=False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.Tv1MouseUp(Sender: TObject;
|
|||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
begin
|
|||
|
FLeft:=X;
|
|||
|
FTop:=Y;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.Tv1CellDblClick(
|
|||
|
Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
Panel4.Left:=FLeft;
|
|||
|
Panel4.Top:=FTop+110;
|
|||
|
Panel4.Visible:=True;
|
|||
|
Panel4.Refresh;
|
|||
|
Panel10.Caption:=Trim(TV1.Controller.FocusedColumn.Caption);
|
|||
|
|
|||
|
RichEdit1.Text:=CDS_Main.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TBZDClick(Sender: TObject);
|
|||
|
var
|
|||
|
FMainid,FSubId,FOrderNo,FColor,FSH,FHX,FCodeName,FMPRTMF,FMPRTKZ:String;
|
|||
|
begin
|
|||
|
if CDS_Main.Locate('SSel',True,[])=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
FMainid:='';
|
|||
|
try
|
|||
|
frmProductOrderListSel:=TfrmProductOrderListSel.Create(Application);
|
|||
|
with frmProductOrderListSel do
|
|||
|
begin
|
|||
|
// FFInt:=1;
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
FMainid:=frmProductOrderListSel.Order_Main.fieldbyname('Mainid').AsString;
|
|||
|
FSubId:=frmProductOrderListSel.Order_Main.fieldbyname('SubId').AsString;
|
|||
|
FOrderNo:=frmProductOrderListSel.Order_Main.fieldbyname('OrderNo').Value;
|
|||
|
FCodeName:=frmProductOrderListSel.Order_Main.fieldbyname('MPRTCodeName').Value;
|
|||
|
FColor:=frmProductOrderListSel.Order_Main.fieldbyname('PRTColor').Value;
|
|||
|
if Trim(frmProductOrderListSel.Order_Main.fieldbyname('SOrddefstr1').AsString)<>'' then
|
|||
|
FSH:=frmProductOrderListSel.Order_Main.fieldbyname('SOrddefstr1').AsString;
|
|||
|
if Trim(frmProductOrderListSel.Order_Main.fieldbyname('PRTHX').AsString)<>'' then
|
|||
|
FHX:=frmProductOrderListSel.Order_Main.fieldbyname('PRTHX').Value;
|
|||
|
FMPRTMF:=frmProductOrderListSel.Order_Main.fieldbyname('MPRTMF').AsString;
|
|||
|
FMPRTKZ:=frmProductOrderListSel.Order_Main.fieldbyname('MPRTKZ').AsString;
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmProductOrderListSel.Free;
|
|||
|
end;
|
|||
|
if Trim(FMainid)<>'' then
|
|||
|
begin
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫִ<D2AA>д˲<D0B4><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
MovePanel2.Visible:=True;
|
|||
|
MovePanel2.Refresh;
|
|||
|
try
|
|||
|
Self.ADOQueryCmd.Connection.BeginTrans;
|
|||
|
Self.CDS_Main.DisableControls;
|
|||
|
with Self.CDS_Main do
|
|||
|
begin
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Self.CDS_Main.FieldByName('SSEl').AsBoolean=True then
|
|||
|
begin
|
|||
|
with Self.ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add(' UPdate CK_BanCP_CR Set MainId='''+Trim(FMainid)+''' ');
|
|||
|
sql.Add(',SubId='''+Trim(FSubId)+'''');
|
|||
|
sql.Add(',ZDPerson='''+Trim(DName)+''',ZDTime=getdate() ');
|
|||
|
sql.Add(' where CRID='+self.CDS_Main.fieldbyname('CRID').AsString);
|
|||
|
sql.Add(' UPdate WFB_MJJY Set MainId='''+Trim(FMainid)+'''');
|
|||
|
sql.Add(',SubId='''+Trim(FSubId)+'''');
|
|||
|
sql.Add(',ZDPerson='''+Trim(DName)+''',ZDTime=getdate() ');
|
|||
|
sql.Add(' where MJID='+QuotedStr(Trim(self.CDS_Main.fieldbyname('MJID').AsString)));
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
Edit;
|
|||
|
FieldByName('OrderNo').Value:=FOrderNo;
|
|||
|
FieldByName('MPRTCodeName').Value:=FCodeName;
|
|||
|
FieldByName('PRTColor').Value:=FColor;
|
|||
|
FieldByName('SOrddefstr1').Value:=FSH;
|
|||
|
FieldByName('PRTHX').Value:=FHX;
|
|||
|
FieldByName('MPRTMF').Value:=FMPRTMF;
|
|||
|
FieldByName('MPRTKZ').Value:=FMPRTKZ;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Self.CDS_Main.EnableControls;
|
|||
|
Self.ADOQueryCmd.Connection.CommitTrans;
|
|||
|
MovePanel2.Visible:=False;
|
|||
|
except
|
|||
|
Self.ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
MovePanel2.Visible:=False;
|
|||
|
Application.MessageBox('ת<><D7AA>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0) ;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.N1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main,True);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.N2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main,False);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.Tv1CellClick(
|
|||
|
Sender: TcxCustomGridTableView;
|
|||
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty=False then
|
|||
|
begin
|
|||
|
InitOrderColor(Trim(CDS_Main.fieldbyname('MainId').AsString),PRTColor,ADOQueryTemp);
|
|||
|
// InitBCGangNo(Trim(CDS_Main.fieldbyname('SubId').AsString),AOrdDefStr1,ADOQueryTemp);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.PRTColorChange(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
if CDS_Main.IsEmpty=False then
|
|||
|
begin
|
|||
|
//InitOrderColor(Trim(CDS_Main.fieldbyname('MainId').AsString),PRTColor,ADOQueryTemp);
|
|||
|
// InitBCGangNo(Trim(CDS_Main.fieldbyname('SubId').AsString),AOrdDefStr1,ADOQueryTemp);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.MJstr4Change(Sender: TObject);
|
|||
|
begin
|
|||
|
TBFind.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TBSAVEClick(Sender: TObject);
|
|||
|
begin
|
|||
|
IF CDS_main.IsEmpty then exit;
|
|||
|
orderNo.SetFocus;
|
|||
|
if CDS_Main.Locate('SSel',True,[])=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
try
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
DisableControls;
|
|||
|
first;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
IF fieldbyname('ssel').AsBoolean then
|
|||
|
begin
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update CK_BanCP_CR ');
|
|||
|
sql.Add('SET baoNO='+quotedstr(CDS_Main.fieldbyname('baoNO').AsString));
|
|||
|
sql.Add('where BCID='+quotedstr(CDS_Main.fieldbyname('BCID').AsString));
|
|||
|
sql.Add('and MJID='+quotedstr(CDS_Main.fieldbyname('MJID').AsString));
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
end;
|
|||
|
next;
|
|||
|
end;
|
|||
|
first;
|
|||
|
EnableControls;
|
|||
|
end;
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|||
|
exit;
|
|||
|
except
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.CheckBox1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
DisableControls;
|
|||
|
first;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
edit;
|
|||
|
fieldbyname('ssel').Value:=checkbox1.Checked;
|
|||
|
post;
|
|||
|
next;
|
|||
|
end;
|
|||
|
first;
|
|||
|
EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.printClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.Locate('SSel',True,[])=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
DisableControls;
|
|||
|
first;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Self.CDS_Main.FieldByName('SSEl').AsBoolean=True then
|
|||
|
begin
|
|||
|
iF not PrtData(CDS_Main.fieldbyname('MJID').AsString) then
|
|||
|
begin
|
|||
|
EnableControls;
|
|||
|
exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.RKPlace1BtnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag:='KuWei';
|
|||
|
flagname:='<27><>λ';
|
|||
|
if ShowModal=1 then
|
|||
|
begin
|
|||
|
RKPlace1.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.Button1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
// IF trim(RKPlace1.Text)='' then exit;
|
|||
|
MovePanel2.Visible:=True;
|
|||
|
MovePanel2.Refresh;
|
|||
|
try
|
|||
|
Self.ADOQueryCmd.Connection.BeginTrans;
|
|||
|
Self.CDS_Main.DisableControls;
|
|||
|
with Self.CDS_Main do
|
|||
|
begin
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Self.CDS_Main.FieldByName('SSEl').AsBoolean=True then
|
|||
|
begin
|
|||
|
with Self.ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPdate CK_BanCP_CR Set RKPlace='+quotedstr(trim(RKPlace1.Text)));
|
|||
|
sql.Add(' where BCID='+quotedstr(trim(self.CDS_Main.fieldbyname('BCID').AsString)));
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
Edit;
|
|||
|
FieldByName('RKPlace').Value:=trim(rkplace1.Text);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Self.CDS_Main.EnableControls;
|
|||
|
Self.ADOQueryCmd.Connection.CommitTrans;
|
|||
|
MovePanel2.Visible:=False;
|
|||
|
except
|
|||
|
Self.ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
MovePanel2.Visible:=False;
|
|||
|
Application.MessageBox('ת<>ƿ<EFBFBD>λʧ<CEBB><CAA7>!','<27><>ʾ',0) ;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCList.TOKClick(Sender: TObject);
|
|||
|
begin
|
|||
|
IF CDS_Main.IsEmpty then exit;
|
|||
|
if CDS_Main.Locate('SSel',True,[])=False then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
self.ModalResult:=1;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|