2025-01-20 13:04:03 +08:00
|
|
|
|
unit U_LLRKMXInPut;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|
|
|
|
|
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
|
|
|
|
|
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
|
|
|
|
|
|
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
|
|
|
|
|
|
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils,
|
|
|
|
|
|
cxDropDownEdit, jpeg, IdBaseComponent, IdComponent, IdTCPConnection,
|
|
|
|
|
|
IdTCPClient, IdFTP, cxPC, cxGridCustomPopupMenu, cxGridPopupMenu, cxGroupBox,
|
|
|
|
|
|
cxCheckBox, RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, Menus,
|
2025-07-19 16:54:23 +08:00
|
|
|
|
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
|
|
|
|
|
dxSkinDarkRoom,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dxSkinOffice2013White,
|
|
|
|
|
|
dxSkinSharpPlus, dxSkinSpringTime,
|
|
|
|
|
|
dxSkinsDefaultPainters,
|
|
|
|
|
|
|
2025-08-19 17:40:03 +08:00
|
|
|
|
dxSkinscxPCPainter, cxNavigator, dxSkinBlack, dxSkinBlue,
|
|
|
|
|
|
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkSide,
|
|
|
|
|
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|
|
|
|
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|
|
|
|
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|
|
|
|
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|
|
|
|
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|
|
|
|
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|
|
|
|
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|
|
|
|
|
dxSkinOffice2013LightGray, dxSkinPumpkin, dxSkinSeven,
|
|
|
|
|
|
dxSkinSevenClassic, dxSkinSharp, dxSkinSilver, dxSkinStardust,
|
|
|
|
|
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinValentine, dxSkinVS2010,
|
|
|
|
|
|
dxSkinWhiteprint, dxSkinXmas2008Blue;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmLLRKMXInPut = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOTemp: TADOQuery;
|
|
|
|
|
|
ADOCmd: TADOQuery;
|
|
|
|
|
|
ADOQuery1: TADOQuery;
|
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
|
Panel3: TPanel;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
CRTime: TDateTimePicker;
|
|
|
|
|
|
cxGroupBox1: TcxGroupBox;
|
|
|
|
|
|
QtyLRM: TEdit;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
UnitM: TEdit;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
UnitKg: TEdit;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
RCGangNo: TEdit;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
ClientDataSet1: TClientDataSet;
|
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
|
QtyLRKg: TEdit;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
Panel2: TPanel;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
|
v1Column6: TcxGridDBColumn;
|
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
v1Column17: TcxGridDBColumn;
|
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
GangQty: TEdit;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
MXHZPS: TEdit;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
MXHZKGQty: TEdit;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
MYType: TBtnEditA;
|
|
|
|
|
|
BtnDel: TButton;
|
|
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
|
Panel4: TPanel;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
Label24: TLabel;
|
|
|
|
|
|
KgQty1: TEdit;
|
|
|
|
|
|
MQty1: TEdit;
|
|
|
|
|
|
Button6: TButton;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
RCGangNO1: TEdit;
|
|
|
|
|
|
MLID: TEdit;
|
|
|
|
|
|
BPID: TEdit;
|
|
|
|
|
|
DYID: TEdit;
|
|
|
|
|
|
PTID: TEdit;
|
|
|
|
|
|
KgQtyAvg: TEdit;
|
|
|
|
|
|
Label25: TLabel;
|
|
|
|
|
|
QtyAvg: TEdit;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
Label26: TLabel;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
labMYType: TLabel;
|
|
|
|
|
|
MXHZQty: TEdit;
|
|
|
|
|
|
v1Column7: TcxGridDBColumn;
|
|
|
|
|
|
RM1: TRMGridReport;
|
|
|
|
|
|
CDS_Print: TClientDataSet;
|
|
|
|
|
|
RMDB_Main: TRMDBDataSet;
|
|
|
|
|
|
Button1: TButton;
|
|
|
|
|
|
BtnM: TButton;
|
|
|
|
|
|
BtnKg: TButton;
|
|
|
|
|
|
Panel5: TPanel;
|
|
|
|
|
|
Label28: TLabel;
|
|
|
|
|
|
ComboBox2: TComboBox;
|
|
|
|
|
|
Label29: TLabel;
|
|
|
|
|
|
ComboBox1: TComboBox;
|
|
|
|
|
|
BtnPrt: TButton;
|
|
|
|
|
|
BtnQX: TButton;
|
|
|
|
|
|
Label30: TLabel;
|
|
|
|
|
|
Button3: TButton;
|
|
|
|
|
|
Panel16: TPanel;
|
|
|
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
|
|
|
N1: TMenuItem;
|
|
|
|
|
|
N2: TMenuItem;
|
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
|
|
|
|
|
procedure ShuiXiSuoLvClick(Sender: TObject);
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure ShuiXiSuoLvJGMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure UnitMClick(Sender: TObject);
|
|
|
|
|
|
procedure UnitKgClick(Sender: TObject);
|
|
|
|
|
|
procedure QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure BtnQXClick(Sender: TObject);
|
|
|
|
|
|
procedure MYNameKeyPress(Sender: TObject; var Key: Char);
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure Button6Click(Sender: TObject);
|
|
|
|
|
|
procedure BtnDelClick(Sender: TObject);
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure v1Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
procedure BtnPrtClick(Sender: TObject);
|
|
|
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
|
|
|
procedure BtnMClick(Sender: TObject);
|
|
|
|
|
|
procedure BtnKgClick(Sender: TObject);
|
|
|
|
|
|
procedure Button3Click(Sender: TObject);
|
|
|
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
procedure InitMXData();
|
2025-07-08 09:22:54 +08:00
|
|
|
|
function SaveData(): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure GetHZData();
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
2025-07-08 09:22:54 +08:00
|
|
|
|
canshu1: string;
|
|
|
|
|
|
PState, CopyInt: Integer;
|
|
|
|
|
|
FMainId: string;
|
|
|
|
|
|
FRead: string;
|
|
|
|
|
|
FSaveFlag: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmLLRKMXInPut: TfrmLLRKMXInPut;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
implementation
|
2025-07-08 09:22:54 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
uses
|
2025-07-08 09:22:54 +08:00
|
|
|
|
U_DataLink, U_ZDYHelp, U_RTFun, U_QCRKJLList;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.InitData();
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitMXData();
|
|
|
|
|
|
GetHZData();
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if TBSave.Visible = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
BtnDel.Visible := False;
|
|
|
|
|
|
Panel3.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure TfrmLLRKMXInPut.InitMXData();
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select A.*,Laster=isnull(Editer,Filler) from CK_MYSC_CR_MX A where isnull(MYID,'''')=''' + Trim(FMainId) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SCreateCDS20(ADOTemp, ClientDataSet1);
|
|
|
|
|
|
SInitCDSData20(ADOTemp, ClientDataSet1);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
|
2025-01-20 13:04:03 +08:00
|
|
|
|
procedure TfrmLLRKMXInPut.GetHZData();
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FKG, FM, FPS: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FKG := Tv1.DataController.Summary.FooterSummaryTexts[0];
|
|
|
|
|
|
FM := Tv1.DataController.Summary.FooterSummaryTexts[1];
|
|
|
|
|
|
FPS := Tv1.DataController.Summary.FooterSummaryTexts[2];
|
|
|
|
|
|
MXHZPS.Text := FPS;
|
|
|
|
|
|
MXHZKGQty.Text := FKG;
|
|
|
|
|
|
MXHZQty.Text := FM;
|
|
|
|
|
|
if (Trim(FPS) = '') or (Trim(FPS) = '0') then
|
|
|
|
|
|
begin
|
|
|
|
|
|
SClearData(Panel2, 2);
|
|
|
|
|
|
SClearData(Panel2, 99);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('exec P_Avg_JS :KgQty,:MQty,:PS');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(FKG) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('KGQty').Value := FKG;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('KGQty').Value := Null;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(FM) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MQty').Value := FM;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MQty').Value := Null;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('PS').Value := FPS;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
KgQtyAvg.Text := ADOTemp.fieldbyname('KgQtyAvg').Value;
|
|
|
|
|
|
QtyAvg.Text := ADOTemp.fieldbyname('QtyAvg').Value;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR where MYID=''' + Trim(FMainId) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
GangQty.Text := ADOTemp.fieldbyname('GangQty').AsString;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-08 09:22:54 +08:00
|
|
|
|
function TfrmLLRKMXInPut.SaveData(): Boolean;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
maxmxno, maxnoflag, fsj, FMXID: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Result := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
ClientDataSet1.DisableControls;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FMXID := Trim(ADOCmd.fieldbyname('MXID').AsString);
|
|
|
|
|
|
if Trim(FMXID) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if GetLSNo(ADOCmd, maxmxno, 'LM', 'CK_MYSC_CR_MX', 4, 1) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
ClientDataSet1.EnableControls;
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
maxmxno := maxmxno + 'LML';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID=''' + Trim(maxmxno) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('MYID').Value := Trim(FMainId);
|
|
|
|
|
|
FieldByName('MXID').Value := Trim(maxmxno);
|
|
|
|
|
|
FieldByName('RCGangNo').Value := ClientDataSet1.fieldbyname('RCGangNo').Value;
|
|
|
|
|
|
FieldByName('KgQty').Value := ClientDataSet1.fieldbyname('KgQty').Value;
|
|
|
|
|
|
FieldByName('MQty').Value := ClientDataSet1.fieldbyname('MQty').Value;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('FillerCode').Value := Trim(DCode);
|
|
|
|
|
|
FieldByName('ZKZT').Value := '<27>ڿ<EFBFBD>';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' exec P_Update_QCRK_GangNo :MYID');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MYID').Value := Trim(FMainId);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('Update CK_MYSC_CR_MX Set JH=isnull((select isnull(max(JH),0) from CK_MYSC_CR_MX A ');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add(' where A.MYID=''' + Trim(FMainId) + ''' and isnull(A.RCGangNO,'''')=isnull(CK_MYSC_CR_MX.RCGangNO,'''')');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
sql.Add(' and isnull(A.GangNO,'''')=isnull(CK_MYSC_CR_MX.GangNO,'''')),0)+1 ');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add(' where MXID=''' + Trim(maxmxno) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Edit;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('MYID').Value := Trim(FMainId);
|
|
|
|
|
|
FieldByName('MXID').Value := Trim(maxmxno);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ClientDataSet1.EnableControls;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' exec P_Update_LLRK_Qty :MYID');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MYID').Value := Trim(FMainId);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
|
|
|
|
|
InitData();
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Result := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
except
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Result := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ClientDataSet1.EnableControls;
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.TBSaveClick(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FReal: Double;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
ToolBar1.SetFocus;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Panel16.Visible := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Panel16.Refresh;
|
|
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
GetHZData();
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(FSaveFlag) <> '99' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Panel16.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.ShuiXiSuoLvClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(TEdit(Sender).Text) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
TEdit(Sender).Text := '<27><>';
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
TEdit(Sender).Text := '';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure TfrmLLRKMXInPut.ShuiXiSuoLvJGMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(FRead) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
TEdit(Sender).ReadOnly := True;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
TEdit(Sender).ReadOnly := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.UnitMClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(UnitM.Text) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
UnitM.Text := '<27><>';
|
|
|
|
|
|
QtyLRM.Visible := True;
|
|
|
|
|
|
BtnM.Visible := True;
|
|
|
|
|
|
if Trim(UnitKg.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
BtnM.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
UnitM.Text := '';
|
|
|
|
|
|
QtyLRM.Visible := False;
|
|
|
|
|
|
BtnM.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.UnitKgClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(UnitKg.Text) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
UnitKg.Text := '<27><>';
|
|
|
|
|
|
QtyLRKg.Visible := True;
|
|
|
|
|
|
BtnKg.Visible := True;
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
BtnM.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
UnitKg.Text := '';
|
|
|
|
|
|
QtyLRKg.Visible := False;
|
|
|
|
|
|
BtnKg.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FReal: Double;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Key = #13 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(QtyLRM.Text) = '' then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if TryStrToFloat(QtyLRM.Text, FReal) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(UnitKg.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
QtyLRKg.SetFocus;
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('RCGangNo').Value := Trim(RCGangNo.Text);
|
|
|
|
|
|
FieldByName('MQty').Value := Trim(QtyLRM.Text);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
QtyLRM.Text := '';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FReal: Double;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Key = #13 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(QtyLRKg.Text) = '' then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(QtyLRM.Text) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if TryStrToFloat(QtyLRKg.Text, FReal) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('RCGangNo').Value := Trim(RCGangNo.Text);
|
|
|
|
|
|
FieldByName('KgQty').Value := Trim(QtyLRKg.Text);
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('MQty').Value := Trim(QtyLRM.Text);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
QtyLRM.Text := '';
|
|
|
|
|
|
QtyLRKg.Text := '';
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
|
|
|
|
|
QtyLRM.SetFocus;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.BtnQXClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Panel5.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.MYNameKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Key = #13 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(MYType.Text) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure TfrmLLRKMXInPut.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ClientDataSet1.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if BtnDel.Visible = False then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if TBSave.Visible = False then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
Panel4.Visible := True;
|
|
|
|
|
|
RCGangNO1.Text := ClientDataSet1.fieldbyname('RCGangNO').Value;
|
|
|
|
|
|
if Trim(ClientDataSet1.fieldbyname('KgQty').AsString) <> '' then
|
|
|
|
|
|
KgQty1.Text := ClientDataSet1.fieldbyname('KgQty').Value
|
2025-01-20 13:04:03 +08:00
|
|
|
|
else
|
2025-07-08 09:22:54 +08:00
|
|
|
|
KgQty1.Text := '';
|
|
|
|
|
|
if Trim(ClientDataSet1.fieldbyname('MQty').AsString) <> '' then
|
|
|
|
|
|
MQty1.Text := ClientDataSet1.fieldbyname('MQty').Value
|
2025-01-20 13:04:03 +08:00
|
|
|
|
else
|
2025-07-08 09:22:54 +08:00
|
|
|
|
MQty1.Text := '';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.Button6Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FReal: Double;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(KgQty1.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if TryStrToFloat(KgQty1.Text, FReal) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(MQty1.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if TryStrToFloat(MQty1.Text, FReal) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('RCGangNo').Value := Trim(RCGangNo1.Text);
|
|
|
|
|
|
if Trim(MQty1.Text) <> '' then
|
|
|
|
|
|
FieldByName('MQty').Value := Trim(MQty1.Text)
|
2025-01-20 13:04:03 +08:00
|
|
|
|
else
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('MQty').Value := Null;
|
|
|
|
|
|
if Trim(KgQty1.Text) <> '' then
|
|
|
|
|
|
FieldByName('KgQty').Value := Trim(KgQty1.Text)
|
2025-01-20 13:04:03 +08:00
|
|
|
|
else
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('KgQty').Value := Null;
|
|
|
|
|
|
FieldByName('Laster').Value := Trim(DName);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Panel4.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ADOTemp.IsEmpty then
|
|
|
|
|
|
exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('RCGangNo').Value := ClientDataSet1.fieldbyname('RCGangNo').Value;
|
|
|
|
|
|
FieldByName('KgQty').Value := ClientDataSet1.fieldbyname('KgQty').Value;
|
|
|
|
|
|
FieldByName('MQty').Value := ClientDataSet1.fieldbyname('MQty').Value;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditerCode').Value := Trim(DCode);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' exec P_Update_LLRK_Qty :MYID');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MYID').Value := Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR where MYID=''' + Trim(ClientDataSet1.fieldbyname('MYID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SCSHDataNew(ADOTemp, Panel2, 2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ݸ<EFBFBD><DDB8><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.BtnDelClick(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FFMXID: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ClientDataSet1.Locate('SSel', True, []) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
ClientDataSet1.DisableControls;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
first;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
while ClientDataSet1.Locate('SSel', True, []) do
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FFMXID := Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|
|
|
|
|
if Trim(FFMXID) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' insert into CK_MYSC_CR_MX_Log ');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add(' select * from CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
|
|
|
|
|
sql.Add(' UPdate CK_MYSC_CR_MX_Log Set DelTime=getdate(),DelerCode=''' + Trim(DCode) + ''',Deler=''' + Trim(DName) + '''');
|
|
|
|
|
|
sql.Add(' where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
|
|
|
|
|
sql.Add(' Delete CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
ClientDataSet1.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ClientDataSet1.EnableControls;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(FMainId) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' exec P_Update_LLRK_Qty :MYID');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MYID').Value := Trim(FMainId);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR where MYID=''' + Trim(FMainId) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SCSHDataNew(ADOTemp, Panel2, 2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure TfrmLLRKMXInPut.v1Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-07-08 09:22:54 +08:00
|
|
|
|
frmQCRKJLList := TfrmQCRKJLList.Create(Application);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with frmQCRKJLList do
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FMXID := Trim(Self.ClientDataSet1.fieldbyname('MXID').AsString);
|
|
|
|
|
|
if ShowModal = 1 then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmQCRKJLList.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-08 09:22:54 +08:00
|
|
|
|
procedure TfrmLLRKMXInPut.FormClose(Sender: TObject; var Action: TCloseAction);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
ModalResult := 1;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.BtnPrtClick(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
fPrintFile, Txt, fImagePath: string;
|
|
|
|
|
|
i, j: Integer;
|
|
|
|
|
|
Moudle: THandle;
|
|
|
|
|
|
Makebar: TMakebar;
|
|
|
|
|
|
Mixtext: TMixtext;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ClientDataSet1.Locate('GangNo', null, []) = true then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('û<>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬<EFBFBD>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ClientDataSet1.Locate('SSel', True, []) = false then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ComboBox2.Text = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ComboBox1.Text = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD>ߴ<EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ComboBox1.Text = '9*7' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>ǩ97.rmf';
|
|
|
|
|
|
end
|
|
|
|
|
|
else if ComboBox1.Text = '8*5' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>ǩ85.rmf';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if FileExists(fPrintFile) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ComboBox1.Text = '9*7' then
|
|
|
|
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>ǩ97.rmf'), '<27><>ʾ', 0);
|
|
|
|
|
|
if ComboBox1.Text = '8*5' then
|
|
|
|
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>ǩ85.rmf'), '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ClientDataSet1.DisableControls;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
while Locate('SSel', True, []) do
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add(' Exec P_PRT_LLRK_ML :MXID');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MXID').Value := Trim(ClientDataSet1.fieldbyname('MXID').AsString);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SCreateCDS20(ADOTemp, CDS_Print);
|
|
|
|
|
|
SInitCDSData20(ADOTemp, CDS_Print);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
try
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|
|
|
|
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|
|
|
|
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|
|
|
|
|
Txt := Trim(ClientDataSet1.fieldbyname('MXID').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);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
except
|
2025-07-08 09:22:54 +08:00
|
|
|
|
application.MessageBox('<27><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Edit;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('SSel').Value := False;
|
|
|
|
|
|
RMVariables['QRBARCODE'] := fImagePath;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
RM1.LoadFromFile(fPrintFile);
|
|
|
|
|
|
//RM1.ShowReport;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
for i := 1 to StrToInt(ComboBox2.Text) do
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
RM1.PrintReport;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ClientDataSet1.EnableControls;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
ComboBox2.ItemIndex := 0;
|
|
|
|
|
|
ComboBox1.ItemIndex := -1;
|
|
|
|
|
|
Panel5.Visible := False;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.Button1Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FFMXID: string;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if ClientDataSet1.Locate('SSel', True, []) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
ClientDataSet1.DisableControls;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
first;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
while ClientDataSet1.Locate('SSel', True, []) do
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FFMXID := Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|
|
|
|
|
if Trim(FFMXID) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set RCGangNo=''' + Trim(RCGangNO1.Text) + '''');
|
|
|
|
|
|
sql.Add(' where MXID=''' + Trim(ClientDataSet1.fieldbyname('MXID').AsString) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Edit;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('SSel').Value := false;
|
|
|
|
|
|
FieldByName('RCGangNo').Value := Trim(RCGangNO1.Text);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
ClientDataSet1.EnableControls;
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FSaveFlag := '99';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
TBSave.Click;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FSaveFlag := '';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' exec P_Update_LLRK_Qty :MYID');
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Parameters.ParamByName('MYID').Value := Trim(FMainId);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
sql.Add('select * from CK_MYSC_CR where MYID=''' + Trim(FMainId) + '''');
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SCSHDataNew(ADOTemp, Panel2, 2);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.BtnMClick(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FReal: Double;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(QtyLRM.Text) = '' then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if TryStrToFloat(QtyLRM.Text, FReal) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(UnitKg.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
|
|
|
|
|
QtyLRKg.SetFocus;
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('RCGangNo').Value := Trim(RCGangNo.Text);
|
|
|
|
|
|
FieldByName('MQty').Value := Trim(QtyLRM.Text);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
QtyLRM.Text := '';
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.BtnKgClick(Sender: TObject);
|
|
|
|
|
|
var
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FReal: Double;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(QtyLRKg.Text) = '' then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if Trim(QtyLRM.Text) = '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
if TryStrToFloat(QtyLRKg.Text, FReal) = False then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ClientDataSet1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('RCGangNo').Value := Trim(RCGangNo.Text);
|
|
|
|
|
|
FieldByName('KgQty').Value := Trim(QtyLRKg.Text);
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
2025-01-20 13:04:03 +08:00
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
FieldByName('MQty').Value := Trim(QtyLRM.Text);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2025-07-08 09:22:54 +08:00
|
|
|
|
QtyLRM.Text := '';
|
|
|
|
|
|
QtyLRKg.Text := '';
|
|
|
|
|
|
if Trim(UnitM.Text) <> '' then
|
|
|
|
|
|
QtyLRM.SetFocus;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
GetHZData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.Button3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
Panel5.Visible := True;
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.N1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SelOKNo(ClientDataSet1, True);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmLLRKMXInPut.N2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-07-08 09:22:54 +08:00
|
|
|
|
SelOKNo(ClientDataSet1, False);
|
2025-01-20 13:04:03 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
2025-07-08 09:22:54 +08:00
|
|
|
|
|