550 lines
15 KiB
ObjectPascal
550 lines
15 KiB
ObjectPascal
![]() |
unit U_CKProductBCPKCListSel;
|
|||
|
|
|||
|
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, Math, Clipbrd, 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, dxBarBuiltInMenu, cxPC;
|
|||
|
|
|||
|
type
|
|||
|
TfrmCKProductBCPKCListSel = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBRafresh: TToolButton;
|
|||
|
TBClose: TToolButton;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
DataSource1: TDataSource;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
CDS_Main: TClientDataSet;
|
|||
|
MovePanel2: TMovePanel;
|
|||
|
PopupMenu1: TPopupMenu;
|
|||
|
N1: TMenuItem;
|
|||
|
N2: TMenuItem;
|
|||
|
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;
|
|||
|
RMDB_Main: TRMDBDataSet;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
RM2: TRMGridReport;
|
|||
|
CDS_HZ: TClientDataSet;
|
|||
|
CDS_PRT: TClientDataSet;
|
|||
|
RM3: TRMGridReport;
|
|||
|
RMDBHZ: TRMDBDataSet;
|
|||
|
RMDBPRT: TRMDBDataSet;
|
|||
|
Panel1: TPanel;
|
|||
|
Label1: TLabel;
|
|||
|
Label2: TLabel;
|
|||
|
BegDate: TDateTimePicker;
|
|||
|
EndDate: TDateTimePicker;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
N3: TMenuItem;
|
|||
|
Label16: TLabel;
|
|||
|
Label17: TLabel;
|
|||
|
Label18: TLabel;
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
cxStyle2: TcxStyle;
|
|||
|
cxStyle3: TcxStyle;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
v1Column12: TcxGridDBColumn;
|
|||
|
cxgrdCustomerNoName: TcxGridDBColumn;
|
|||
|
v1Column10: TcxGridDBColumn;
|
|||
|
v1Column1: TcxGridDBColumn;
|
|||
|
cxgrdMPRTCodeName: TcxGridDBColumn;
|
|||
|
cxgrdPRTColor: TcxGridDBColumn;
|
|||
|
cxgrdMPRTMF: TcxGridDBColumn;
|
|||
|
cxgrdMPRTKZ: TcxGridDBColumn;
|
|||
|
v1Column6: TcxGridDBColumn;
|
|||
|
v1Column13: TcxGridDBColumn;
|
|||
|
cxgrdMPRTSpec: TcxGridDBColumn;
|
|||
|
v1Column2: TcxGridDBColumn;
|
|||
|
v1Column4: TcxGridDBColumn;
|
|||
|
v1Column11: TcxGridDBColumn;
|
|||
|
v1Column3: TcxGridDBColumn;
|
|||
|
cxgrdJQty: TcxGridDBColumn;
|
|||
|
cxgrdKGQty: TcxGridDBColumn;
|
|||
|
cxgrdNETKGQty: TcxGridDBColumn;
|
|||
|
cxgrdQty: TcxGridDBColumn;
|
|||
|
Tv1Column3: TcxGridDBColumn;
|
|||
|
cxgrdQtyUnit: TcxGridDBColumn;
|
|||
|
v1Column5: TcxGridDBColumn;
|
|||
|
v1Column16: TcxGridDBColumn;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
Tv1Column2: TcxGridDBColumn;
|
|||
|
cxGrid2Level1: TcxGridLevel;
|
|||
|
Panel2: TPanel;
|
|||
|
Panel3: TPanel;
|
|||
|
cxTabControl1: TcxTabControl;
|
|||
|
Panel6: TPanel;
|
|||
|
Label31: TLabel;
|
|||
|
LBCPAP: TLabel;
|
|||
|
BTLP: TButton;
|
|||
|
BTNP: TButton;
|
|||
|
TCBNOR: TComboBox;
|
|||
|
lblMPRTCodeName: TLabel;
|
|||
|
lblorderNo: TLabel;
|
|||
|
lblMJID: TLabel;
|
|||
|
lblMPRTKZ: TLabel;
|
|||
|
lblMPRTMF: TLabel;
|
|||
|
lblCPType: TLabel;
|
|||
|
lblPRTColor: TLabel;
|
|||
|
lblMPRTSpec: TLabel;
|
|||
|
lblRKplace: TLabel;
|
|||
|
lblConNo: TLabel;
|
|||
|
lblRKOrdID: TLabel;
|
|||
|
Label14: TLabel;
|
|||
|
Label3: TLabel;
|
|||
|
MPRTCodeName: TEdit;
|
|||
|
orderNo: TEdit;
|
|||
|
MJID: TEdit;
|
|||
|
MJKZ: TEdit;
|
|||
|
MJMF: TEdit;
|
|||
|
CPType: TComboBox;
|
|||
|
RKplace: TEdit;
|
|||
|
PRTColor: TEdit;
|
|||
|
JYXH: TEdit;
|
|||
|
ConNo: TEdit;
|
|||
|
RKOrdID: TEdit;
|
|||
|
CustomerNoName: TEdit;
|
|||
|
APID: TEdit;
|
|||
|
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 Tv1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure N1Click(Sender: TObject);
|
|||
|
procedure N2Click(Sender: TObject);
|
|||
|
procedure BTNPClick(Sender: TObject);
|
|||
|
procedure BTLPClick(Sender: TObject);
|
|||
|
procedure TCBNORChange(Sender: TObject);
|
|||
|
procedure MPRTCodeNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure CPTypeKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure X1Click(Sender: TObject);
|
|||
|
procedure N3Click(Sender: TObject);
|
|||
|
procedure GetQty();
|
|||
|
procedure v1Column12PropertiesEditValueChanged(Sender: TObject);
|
|||
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
private
|
|||
|
FLeft, FTop: Integer;
|
|||
|
CurrentPage, RecordsNumber: Integer;
|
|||
|
procedure InitGrid();
|
|||
|
procedure setstatus();
|
|||
|
{ Private declarations }
|
|||
|
public
|
|||
|
issel: integer;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmCKProductBCPKCListSel: TfrmCKProductBCPKCListSel;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_Fun, U_ZDYHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
procedure TfrmCKProductBCPKCListSel.SetStatus();
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
0:
|
|||
|
begin
|
|||
|
Panel6.Visible := False;
|
|||
|
ClearOrHideControls(Panel1, '0', false, True);
|
|||
|
ClearOrHideControls(Panel1, '1', True, True);
|
|||
|
ClearOrHideControls(Panel1, '2', True, False);
|
|||
|
|
|||
|
for i := 0 to tv1.ColumnCount - 1 do
|
|||
|
begin
|
|||
|
tv1.Columns[i].Visible := false;
|
|||
|
end;
|
|||
|
IsVisibleTV(Panel1, TV1, '0', True);
|
|||
|
IsVisibleTV(Panel1, TV1, '1', True);
|
|||
|
cxgrdJQty.Visible := True;
|
|||
|
cxgrdKGQty.Visible := True;
|
|||
|
cxgrdNETKGQty.Visible := True;
|
|||
|
cxgrdQty.Visible := True;
|
|||
|
cxgrdQtyUnit.Visible := True;
|
|||
|
Tv1Column3.Visible := True;
|
|||
|
cxgrdMPRTSpec.Visible := True;
|
|||
|
v1Column12.Visible := True;
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
for i := 0 to tv1.ColumnCount - 1 do
|
|||
|
begin
|
|||
|
tv1.Columns[i].Visible := True;
|
|||
|
end;
|
|||
|
cxgrdJQty.Visible := false;
|
|||
|
|
|||
|
ClearOrHideControls(Panel1, '0', False, True);
|
|||
|
ClearOrHideControls(Panel1, '1', False, True);
|
|||
|
ClearOrHideControls(Panel1, '2', False, True);
|
|||
|
|
|||
|
Panel6.Visible := True;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.GetQty();
|
|||
|
var
|
|||
|
sumP, sumnum, summoney: double;
|
|||
|
id: string;
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
id := CDS_Main.fieldbyname('mjid').asstring;
|
|||
|
try
|
|||
|
sumP := 0;
|
|||
|
sumnum := 0;
|
|||
|
summoney := 0;
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
DisableControls;
|
|||
|
First;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
if Fieldbyname('ssel').AsBoolean then
|
|||
|
begin
|
|||
|
sumP := sumP + 1;
|
|||
|
sumnum := sumnum + CDS_Main.fieldbyname('KGQty').AsFloat;
|
|||
|
summoney := summoney + CDS_Main.fieldbyname('Qty').AsFloat;
|
|||
|
end;
|
|||
|
|
|||
|
next;
|
|||
|
end;
|
|||
|
EnableControls;
|
|||
|
end;
|
|||
|
|
|||
|
// label16.Caption := 'ƥ<><C6A5>:' + floattostr(sumP);
|
|||
|
// label17.Caption := '<27><><EFBFBD><EFBFBD>:' + floattostr(sumnum);
|
|||
|
// label18.Caption := '<27><><EFBFBD><EFBFBD>:' + floattostr(summoney);
|
|||
|
// CDS_Main.Locate('mjid', id, []);
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmCKProductBCPKCListSel := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
Action := caHide;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.FormCreate(Sender: TObject);
|
|||
|
begin
|
|||
|
BegDate.DateTime := SGetServerDateTime(ADOQueryTemp);
|
|||
|
EndDate.DateTime := SGetServerDateTime(ADOQueryTemp)
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.InitGrid();
|
|||
|
var
|
|||
|
fwhere, Pwhere: string;
|
|||
|
begin
|
|||
|
MovePanel2.Left := (self.Width - MovePanel2.Width) div 2;
|
|||
|
MovePanel2.Visible := True;
|
|||
|
MovePanel2.Refresh;
|
|||
|
Pwhere := SGetFilters(Panel1, 1, 2);
|
|||
|
if trim(Pwhere) <> '' then
|
|||
|
fwhere := fwhere + ' where ' + trim(Pwhere);
|
|||
|
|
|||
|
try
|
|||
|
ADOQueryMain.DisableControls;
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Filtered := False;
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
|
|||
|
case cxTabControl1.TabIndex of
|
|||
|
|
|||
|
0:
|
|||
|
begin
|
|||
|
sql.Add('select *,MJID= STUFF(( SELECT '','' +convert(VARCHAR, rtrim(mjid)) FROM WFB_MJJY z where z.jyxh = aa.jyxh AND Z.APID=AA.APID and z.MJStr2=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and Z.MJType=AA.CPTYPE ');
|
|||
|
sql.add('AND aa.PRTColor=z.jycolor FOR XML PATH('''')), 1, 1, '''') ');
|
|||
|
sql.Add('from ( select CPTYPE,SUM(A.KGQty) KGQty,SUM(A.Qty) Qty,SUM(A.NetKGQty) NetKGQty,count(A.MJID) JQty,A.QtyUnit,A.ganghao,JYXH ');
|
|||
|
sql.Add(' ,B.CustomerNoName,B.ConNo,B.OrderNo,B.MPRTCode,B.MPRTCodeName,B.MPRTSpec,PRTColor=isnull(jycolor,PRTColor) ');
|
|||
|
sql.Add(' ,A.MJMF,A.MJKZ,A.APID,jinchang=SUM(round((a.qty-a.kongjia)*machi,2)) ');
|
|||
|
sql.Add('from CK_BanCP_CR A inner join CK_BanCP_KC D on A.MJID=D.MJID inner join JYOrder_Main B on A.MainId=B.MainId ');
|
|||
|
sql.Add('inner join JYOrder_Sub C on A.SubId=C.SubId ');
|
|||
|
sql.Add('inner join JYOrder_Car E on E.CarNo=A.APID ');
|
|||
|
sql.Add('where A.CRFlag=''<27><><EFBFBD><EFBFBD>'' and D.KCValid=''Y'' ');
|
|||
|
sql.Add(' group by CPTYPE,B.CustomerNoName,A.QtyUnit,A.ganghao,B.ConNo,B.OrderNo,B.MPRTCode,B.MPRTCodeName,A.MJMF,A.MJKZ,B.MPRTSpec,JYXH ,isnull(jycolor,PRTColor),A.APID ');
|
|||
|
sql.Add(' ) AA ' + fwhere);
|
|||
|
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
sql.Add('exec P_Page_FinishClothKC ');
|
|||
|
sql.Add('@pageIndex=' + inttostr(CurrentPage));
|
|||
|
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
|||
|
sql.Add(',@criteria= ' + quotedstr(fwhere));
|
|||
|
end;
|
|||
|
end;
|
|||
|
// SHOWMESSAGE(SQL.TEXT);
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_Main);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_Main);
|
|||
|
if cxTabControl1.TabIndex = 1 then
|
|||
|
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(CDS_Main.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
|||
|
|
|||
|
MovePanel2.Visible := false;
|
|||
|
finally
|
|||
|
ADOQueryMain.EnableControls;
|
|||
|
MovePanel2.Visible := false;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
CurrentPage := 1;
|
|||
|
InitGrid();
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.ConNoMChange(Sender: TObject);
|
|||
|
begin
|
|||
|
if ADOQueryMain.Active then
|
|||
|
begin
|
|||
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
WriteCxGrid(trim(self.Caption), Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
CurrentPage := 1;
|
|||
|
setstatus();
|
|||
|
RecordsNumber := 500;
|
|||
|
// ReadCxGrid(trim(self.Caption), Tv1, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.Tv1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
begin
|
|||
|
FLeft := X;
|
|||
|
FTop := Y;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
var
|
|||
|
Tabint: integer;
|
|||
|
begin
|
|||
|
Tabint := cxTabControl1.TabIndex;
|
|||
|
case Tabint of
|
|||
|
0:
|
|||
|
begin
|
|||
|
AssignmentControls(Panel1, CDS_Main, '1');
|
|||
|
cxTabControl1.TabIndex := 1;
|
|||
|
end;
|
|||
|
1:
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.N1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main, True);
|
|||
|
GetQty();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.N2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
SelOKNo(CDS_Main, False);
|
|||
|
GetQty();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.BTNPClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CurrentPage < CDS_Main.FieldByName('TotalCount').AsInteger / RecordsNumber then
|
|||
|
CurrentPage := CurrentPage + 1;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.BTLPClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CurrentPage > 1 then
|
|||
|
CurrentPage := CurrentPage - 1;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.TCBNORChange(Sender: TObject);
|
|||
|
begin
|
|||
|
RecordsNumber := StrToInt(TCBNOR.Text);
|
|||
|
CurrentPage := 1;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.MPRTCodeNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
CurrentPage := 1;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.CPTypeKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
CurrentPage := 1;
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_Main.IsEmpty then
|
|||
|
exit;
|
|||
|
ModalResult := 1;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.X1Click(Sender: TObject);
|
|||
|
var
|
|||
|
str, SSubId, SGangNo: string;
|
|||
|
ZChiShu, DQChiShu: integer;
|
|||
|
ISSel: boolean;
|
|||
|
begin
|
|||
|
ISSel := true;
|
|||
|
SSubId := trim(CDS_Main.FieldByName('SubId').AsString);
|
|||
|
str := '';
|
|||
|
if InputQuery('ѡ<><D1A1>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', str) then
|
|||
|
begin
|
|||
|
ZChiShu := strtointdef(str, 0);
|
|||
|
if ZChiShu <= 0 then
|
|||
|
exit;
|
|||
|
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
|
|||
|
CDS_Main.DisableControls;
|
|||
|
first;
|
|||
|
DQChiShu := 0;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
|
|||
|
if ((SSubId = trim(FieldByName('SubId').AsString))) then
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('SSel').value := ISSel;
|
|||
|
DQChiShu := DQChiShu + 1;
|
|||
|
Post;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('SSel').value := false;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
if DQChiShu = ZChiShu then
|
|||
|
ISSel := false;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
CDS_Main.Locate('SubId', SSubId, []);
|
|||
|
CDS_Main.EnableControls;
|
|||
|
end;
|
|||
|
end;
|
|||
|
GetQty();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.N3Click(Sender: TObject);
|
|||
|
var
|
|||
|
SSubId, SGangNo, SAPID: string;
|
|||
|
begin
|
|||
|
with CDS_Main do
|
|||
|
begin
|
|||
|
SSubId := trim(FieldByName('jyxh').AsString);
|
|||
|
SGangNo := trim(FieldByName('apid').AsString);
|
|||
|
CDS_Main.DisableControls;
|
|||
|
first;
|
|||
|
while not eof do
|
|||
|
begin
|
|||
|
if ((SSubId = trim(FieldByName('jyxh').AsString))) and ((SGangNo = trim(FieldByName('apid').AsString))) then
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('SSel').value := true;
|
|||
|
Post;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('SSel').value := false;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
CDS_Main.Locate('jyxh', SSubId, []);
|
|||
|
CDS_Main.EnableControls;
|
|||
|
end;
|
|||
|
// GetQty();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.v1Column12PropertiesEditValueChanged(Sender: TObject);
|
|||
|
begin
|
|||
|
// GetQty();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmCKProductBCPKCListSel.cxTabControl1Change(Sender: TObject);
|
|||
|
begin
|
|||
|
SetStatus();
|
|||
|
InitGrid();
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|