2025-11-21 09:31:25 +08:00
|
|
|
|
unit U_PlanScanInEdit;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, strUtils, SysUtils, Variants, Classes, Graphics, Controls,
|
|
|
|
|
|
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|
|
|
|
|
cxDataStorage, cxEdit, DB, cxDBData, StdCtrls, ExtCtrls, ADODB, DBClient,
|
|
|
|
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, MMSystem,
|
|
|
|
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
|
|
|
|
|
cxControls, cxGridCustomView, cxGrid, MovePanel, cxCheckBox, Menus, ComCtrls,
|
|
|
|
|
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, U_BaseList, dxSkinsCore,
|
|
|
|
|
|
dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu, RM_Common, RM_Class,
|
|
|
|
|
|
RM_GridReport, RM_Dataset, Vcl.ToolWin, dxSkinBasic, 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, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
|
|
|
|
|
|
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
|
|
|
|
|
|
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
|
|
|
|
|
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
|
|
|
|
|
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
|
|
|
|
|
|
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
|
|
|
|
|
|
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinWXI,
|
|
|
|
|
|
dxSkinXmas2008Blue, dxScrollbarAnnotations, cxContainer, cxProgressBar,
|
|
|
|
|
|
BtnEdit;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmPlanScanInEdit = class(TfrmBaseList)
|
|
|
|
|
|
GPM_1: TcxGridPopupMenu;
|
|
|
|
|
|
CDS_1: TClientDataSet;
|
|
|
|
|
|
DS_1: TDataSource;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
CDS_2: TClientDataSet;
|
|
|
|
|
|
DS_2: TDataSource;
|
|
|
|
|
|
GPM_2: TcxGridPopupMenu;
|
|
|
|
|
|
DS_3: TDataSource;
|
|
|
|
|
|
CDS_3: TClientDataSet;
|
|
|
|
|
|
GPM_3: TcxGridPopupMenu;
|
|
|
|
|
|
Panel2: TPanel;
|
|
|
|
|
|
cxGrid3: TcxGrid;
|
|
|
|
|
|
Tv3: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
Panel3: TPanel;
|
|
|
|
|
|
ToolBar3: TToolBar;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
btnGetOutNo: TToolButton;
|
|
|
|
|
|
ToolButton7: TToolButton;
|
|
|
|
|
|
ToolButton8: TToolButton;
|
|
|
|
|
|
edtScan: TEdit;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
ToolButton5: TToolButton;
|
|
|
|
|
|
Label2: TLabel;
|
2025-11-24 13:22:51 +08:00
|
|
|
|
wlCompany: TBtnEditA;
|
2025-11-21 09:31:25 +08:00
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
InNo: TEdit;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
CRTime: TDateTimePicker;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
CRType: TComboBox;
|
|
|
|
|
|
carPlate: TBtnEditA;
|
2025-11-24 13:22:51 +08:00
|
|
|
|
Tv3Column1: TcxGridDBColumn;
|
|
|
|
|
|
Tv3Column2: TcxGridDBColumn;
|
|
|
|
|
|
Tv3Column3: TcxGridDBColumn;
|
|
|
|
|
|
Tv3Column4: TcxGridDBColumn;
|
|
|
|
|
|
Tqueren: TButton;
|
2025-11-21 09:31:25 +08:00
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
procedure FormDestroy(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure btnGetOutNoClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton7Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton8Click(Sender: TObject);
|
|
|
|
|
|
procedure edtScanKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure ToolButton5Click(Sender: TObject);
|
2025-11-24 13:22:51 +08:00
|
|
|
|
procedure wlCompanyBtnClick(Sender: TObject);
|
2025-11-21 09:31:25 +08:00
|
|
|
|
procedure carPlateBtnClick(Sender: TObject);
|
2025-11-24 13:22:51 +08:00
|
|
|
|
procedure TquerenClick(Sender: TObject);
|
2025-11-21 09:31:25 +08:00
|
|
|
|
private
|
|
|
|
|
|
{ Private declarations }
|
2025-11-24 13:22:51 +08:00
|
|
|
|
FScan, FSubIds,FZCID: string;
|
2025-11-21 09:31:25 +08:00
|
|
|
|
procedure PlayWav(MWav: string);
|
|
|
|
|
|
procedure InitKC();
|
|
|
|
|
|
procedure ScanKW();
|
|
|
|
|
|
procedure ScanCIID();
|
|
|
|
|
|
public
|
|
|
|
|
|
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmPlanScanInEdit: TfrmPlanScanInEdit;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
U_DataLink, U_RTFun, U_LabelPrint, U_ZDYHelp, U_MachineManageSel; //U_TradeClothWaitStorage, U_PositionSel
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.PlayWav(MWav: string);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\' + MWav + '.wav')) then
|
|
|
|
|
|
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\' + MWav + '.wav'), 0, SND_ASYNC);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.InitKC();
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
2025-11-24 13:22:51 +08:00
|
|
|
|
if carPlate.Text = '' then
|
2025-11-21 09:31:25 +08:00
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-11-24 13:22:51 +08:00
|
|
|
|
sql.Add('select A.* from Trade_Cloth_IO A ');
|
|
|
|
|
|
sql.Add('where A.ioFlag=''<27><><EFBFBD><EFBFBD>'' ');
|
|
|
|
|
|
sql.add('and VNO =' + QuotedStr(TRIm(FScan)));
|
2025-11-21 09:31:25 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQueryTemp, CDS_3);
|
|
|
|
|
|
SInitCDSData(ADOQueryTemp, CDS_3);
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.ScanKW();
|
|
|
|
|
|
var
|
|
|
|
|
|
MStkIds: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from Bs_Position where POSID =''' + trim(FScan) + ''' ');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-11-24 13:22:51 +08:00
|
|
|
|
wlCompany.Text := ADOQueryTemp.FieldByName('posno').AsString;
|
2025-11-21 09:31:25 +08:00
|
|
|
|
|
|
|
|
|
|
btnGetOutNo.Click;
|
|
|
|
|
|
except
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.ScanCIID();
|
|
|
|
|
|
var
|
|
|
|
|
|
MStkIds: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
2025-11-24 13:22:51 +08:00
|
|
|
|
if Trim(wlCompany.Text) = '' then
|
2025-11-21 09:31:25 +08:00
|
|
|
|
raise Exception.Create('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
if Trim(InNo.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>ⵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
|
|
|
|
|
|
MStkIds := FScan;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
Sql.Clear;
|
|
|
|
|
|
Sql.Add('exec P_Market_Position_In ');
|
|
|
|
|
|
Sql.Add('@StkIds=' + quotedstr(trim(MStkIds)));
|
|
|
|
|
|
Sql.Add(',@IOTime=' + Quotedstr(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)));
|
|
|
|
|
|
Sql.Add(',@IOType=' + Quotedstr(crtype.Text));
|
|
|
|
|
|
Sql.Add(',@IONO=' + Quotedstr(InNo.Text));
|
2025-11-24 13:22:51 +08:00
|
|
|
|
Sql.Add(',@StkPosition=' + Quotedstr(wlCompany.Text));
|
2025-11-21 09:31:25 +08:00
|
|
|
|
Sql.Add(',@FillId=' + Quotedstr(DCode));
|
|
|
|
|
|
Sql.Add(',@Filler=' + Quotedstr(DName));
|
|
|
|
|
|
// ShowMessage(sql.Text);
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
|
|
|
|
|
|
end;
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
PlayWav('<27><>ȷ');
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
raise Exception.Create(PChar(Exception(ExceptObject).Message));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
// PlayWav('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
Action := caFree;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.FormDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
frmPlanScanInEdit := nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
ReadCxGrid(self.caption + 'Tv3', Tv3, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|
|
|
|
|
InitKC();
|
|
|
|
|
|
CRTime.DateTime := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.edtScanKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno, SMFlag, KYCKFlag, FMainId, ff: string;
|
|
|
|
|
|
FFQty: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = #13 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FScan := TRIM(edtScan.Text);
|
|
|
|
|
|
edtScan.Text := '';
|
|
|
|
|
|
if Copy(FScan, 1, 2) = 'KW' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ScanKW();
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
ScanCIID();
|
|
|
|
|
|
end;
|
|
|
|
|
|
InitKC();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(InNo.Text) = '' then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
|
|
|
|
|
with frmLabelPrint do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FLMType := 'TradeClothIn1';
|
|
|
|
|
|
FFiltration1 := Trim(Self.InNo.Text);
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmLabelPrint.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
{ try
|
|
|
|
|
|
frmPositionSel := TfrmPositionSel.Create(Application);
|
|
|
|
|
|
with frmPositionSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
IOPosition.Text := CDS_1.FieldByName('POSNO').AsString;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmPositionSel.Free;
|
|
|
|
|
|
btnGetOutNo.Click;
|
|
|
|
|
|
initkc();
|
|
|
|
|
|
end; }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-11-24 13:22:51 +08:00
|
|
|
|
procedure TfrmPlanScanInEdit.wlCompanyBtnClick(Sender: TObject);
|
2025-11-21 09:31:25 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
MainType := 'Cust';
|
|
|
|
|
|
flag := 'AREA';
|
|
|
|
|
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
IOPosition.text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.carPlateBtnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
try
|
|
|
|
|
|
frmMachineManageSel := TfrmMachineManageSel.Create(Application);
|
|
|
|
|
|
with frmMachineManageSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
2025-11-24 13:22:51 +08:00
|
|
|
|
carPlate.text := Trim(CDS_1.fieldbyname('VNO').AsString);
|
2025-11-21 09:31:25 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmMachineManageSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.btnGetOutNoClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
maxNo: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, maxNo, 'RK', 'Trade_Cloth_IO', 3, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD>ⵥ<EFBFBD><E2B5A5>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
InNo.Text := Trim(maxNo);
|
|
|
|
|
|
CRTime.DateTime := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
InitKC();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.ToolButton7Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
tv3.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
Close;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmPlanScanInEdit.ToolButton8Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
WriteCxGrid(self.caption + 'Tv3', Tv3, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-11-24 13:22:51 +08:00
|
|
|
|
procedure TfrmPlanScanInEdit.TquerenClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
MaxMid, MaxSid: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
///////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /////////////////
|
|
|
|
|
|
if Trim(FZCID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, MaxMid, 'ZC', 'Trade_Market_CarTransport', 4, 1) = False then
|
|
|
|
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
MaxMid := Trim(FZCID);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
SQL.Add('select * from Trade_Market_CarTransport where ZCID=''' + Trim(MaxMid) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(FZCID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('FillID').Value := Trim(DCode);
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('EditID').Value := Trim(DCode);
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQuerytemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
RTSetsavedata(ADOQueryCmd, 'Trade_Market_CarTransport', panel3, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('DRMID').Value := Trim(MaxMid);
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
///////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /////////////////
|
|
|
|
|
|
///
|
|
|
|
|
|
///////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> /////////////////
|
|
|
|
|
|
CDS_3.DisableControls;
|
|
|
|
|
|
with CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(CDS_3.fieldbyname('ZCMXID').AsString) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, MaxSid, 'DS', 'Trade_Market_CarTransportSub', 4, 1) = False then
|
|
|
|
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
MaxSid := Trim(CDS_3.fieldbyname('DRSID').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from Trade_Market_CarTransportSub ');
|
|
|
|
|
|
sql.Add(' where DRMID=''' + Trim(MaxMid) + '''');
|
|
|
|
|
|
sql.Add(' and DRSID=''' + Trim(MaxSid) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
if ADOQueryCmd.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv3, CDS_3, 'Trade_Market_CarTransportSub', 0);
|
|
|
|
|
|
FieldByName('DRMID').Value := Trim(MaxMid);
|
|
|
|
|
|
FieldByName('DRSID').Value := Trim(MaxSid);
|
|
|
|
|
|
// FieldByName('QtyUnit').Value := QtyUnit.Text;
|
|
|
|
|
|
FieldByName('MainId').Value := CDS_3.fieldbyname('MainId').Value;
|
|
|
|
|
|
FieldByName('SubId').Value := CDS_3.fieldbyname('SubId').Value;
|
|
|
|
|
|
FieldByName('ConMId').Value := CDS_3.fieldbyname('ConMId').Value;
|
|
|
|
|
|
FieldByName('ConSId').Value := CDS_3.fieldbyname('ConSId').Value;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('ToConNo').Value := CDS_3.fieldbyname('ToConNo').Value;
|
|
|
|
|
|
FieldByName('ToConMId').Value := CDS_3.fieldbyname('ToConMId').Value;
|
|
|
|
|
|
FieldByName('ToConSId').Value := CDS_3.fieldbyname('ToConSId').Value;
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
CDS_3.Edit;
|
|
|
|
|
|
CDS_3.FieldByName('DRSID').Value := Trim(MaxSid);
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
CDS_3.EnableControls;
|
|
|
|
|
|
///////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> /////////////////
|
|
|
|
|
|
FZCID := Trim(MaxMid);
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
// Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
// Result := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-11-21 09:31:25 +08:00
|
|
|
|
end.
|
|
|
|
|
|
|