2025-06-06 13:56:41 +08:00
|
|
|
|
unit U_DyeGreyClothOutEdit;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|
|
|
|
cxEdit, DB, cxDBData, cxCalendar, cxDropDownEdit, ComCtrls, ToolWin,
|
|
|
|
|
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|
|
|
|
cxClasses, cxControls, cxGridCustomView, cxGrid, cxGridCustomPopupMenu,
|
|
|
|
|
cxGridPopupMenu, ADODB, DBClient, cxButtonEdit, cxTextEdit, cxSpinEdit,
|
|
|
|
|
StdCtrls, ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
|
|
|
|
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu,
|
2025-09-08 14:31:40 +08:00
|
|
|
|
U_BaseInput, System.ImageList, Vcl.ImgList, dxScrollbarAnnotations, cxCheckBox;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
TfrmDyeGreyClothOutEdit = class(TfrmBaseInput)
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
TBAdd: TToolButton;
|
|
|
|
|
TBDel: TToolButton;
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
DataSource3: TDataSource;
|
|
|
|
|
CDS_Sub: TClientDataSet;
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
ToolButton1: TToolButton;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
Tv1Column2: TcxGridDBColumn;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
v1Column6: TcxGridDBColumn;
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
Tv1OrderNo: TcxGridDBColumn;
|
|
|
|
|
Tv1Column4: TcxGridDBColumn;
|
|
|
|
|
Tv1F_Code: TcxGridDBColumn;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
v2Column1: TcxGridDBColumn;
|
|
|
|
|
v2Column6: TcxGridDBColumn;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
v1Column15: TcxGridDBColumn;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
v1Column13: TcxGridDBColumn;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
Tv1F_Width: TcxGridDBColumn;
|
|
|
|
|
Tv1Material: TcxGridDBColumn;
|
|
|
|
|
Tv1finishDescription: TcxGridDBColumn;
|
|
|
|
|
Tv1DlyDate: TcxGridDBColumn;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
v1Column14: TcxGridDBColumn;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
v1Column12: TcxGridDBColumn;
|
|
|
|
|
cxGrid2Level1: TcxGridLevel;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
procedure TBAddClick(Sender: TObject);
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure TBDelClick(Sender: TObject);
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
|
|
|
|
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
procedure Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-09-08 14:31:40 +08:00
|
|
|
|
procedure v1Column13PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-06-06 13:56:41 +08:00
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
function SaveCKData(): Boolean;
|
|
|
|
|
public
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
FBCId, FStkName, FKHName, FWorkshop: string;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frmDyeGreyClothOutEdit: TfrmDyeGreyClothOutEdit;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses
|
2025-09-08 14:31:40 +08:00
|
|
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_DyeGreyClothStkSel, U_CompanySel,
|
|
|
|
|
U_DyePlanForCardSel;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
begin
|
|
|
|
|
inherited;
|
|
|
|
|
Action := caFree;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.TBAddClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
frmDyeGreyClothStkSel := TfrmDyeGreyClothStkSel.Create(Application);
|
|
|
|
|
with frmDyeGreyClothStkSel do
|
|
|
|
|
begin
|
|
|
|
|
FstkName := Self.FstkName;
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
begin
|
|
|
|
|
frmDyeGreyClothStkSel.CDS_Main.DisableControls;
|
|
|
|
|
with frmDyeGreyClothStkSel.CDS_Main do
|
|
|
|
|
begin
|
|
|
|
|
First;
|
|
|
|
|
while frmDyeGreyClothStkSel.CDS_Main.Locate('SSel', True, []) do
|
|
|
|
|
begin
|
|
|
|
|
with Self.CDS_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Append;
|
|
|
|
|
FieldByName('IOTime').Value := Trim(FormatDateTime('yyyy-MM-dd', Now));
|
|
|
|
|
FieldByName('STKID').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('BCIOID').Value;
|
|
|
|
|
FieldByName('IOType').Value := '<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
FieldByName('FromCoNo').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('FromCoNo').Value;
|
|
|
|
|
FieldByName('FromCoName').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('FromCoName').Value;
|
|
|
|
|
FieldByName('StkCoNo').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('StkCoNo').Value;
|
|
|
|
|
FieldByName('StkCoName').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('StkCoName').Value;
|
|
|
|
|
FieldByName('ToCoNo').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('StkCoNo').Value;
|
|
|
|
|
FieldByName('ToCoName').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('StkCoName').Value;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
FieldByName('F_Code').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('F_Code').Value;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
FieldByName('C_Name').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('C_Name').Value;
|
|
|
|
|
|
|
|
|
|
FieldByName('C_code').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('C_code').Value;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
FieldByName('OrderNo').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('OrderNo').Value;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
FieldByName('QtyUnit').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('QtyUnit').Value;
|
|
|
|
|
FieldByName('Qty').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('STKQTY').Value;
|
|
|
|
|
FieldByName('Piece').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('StkPiece').Value;
|
|
|
|
|
FieldByName('BatchNo').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('BatchNo').Value;
|
|
|
|
|
FieldByName('C_Width').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('C_Width').Value;
|
|
|
|
|
FieldByName('C_GramWeight').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('C_GramWeight').Value;
|
|
|
|
|
FieldByName('FromOrdNo').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('FromOrdNo').Value;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
FieldByName('F_Width').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('F_Width').Value;
|
|
|
|
|
FieldByName('finishDescription').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('finishDescription').Value;
|
|
|
|
|
FieldByName('Material').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('Material').Value;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
FieldByName('C_Color').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('C_Color').Value;
|
|
|
|
|
|
2025-09-08 14:31:40 +08:00
|
|
|
|
FieldByName('DlyDate').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('DlyDate').Value;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
|
2025-09-08 14:31:40 +08:00
|
|
|
|
FieldByName('Note').Value := frmDyeGreyClothStkSel.CDS_Main.fieldbyname('Note').Value;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
frmDyeGreyClothStkSel.CDS_Main.Delete;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
frmDyeGreyClothStkSel.CDS_Main.EnableControls;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmDyeGreyClothStkSel.Free;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
function TfrmDyeGreyClothOutEdit.SaveCKData(): Boolean;
|
|
|
|
|
var
|
|
|
|
|
MBCIOID, Maxno: string;
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
CDS_Sub.DisableControls;
|
|
|
|
|
with CDS_Sub do
|
|
|
|
|
begin
|
|
|
|
|
First;
|
|
|
|
|
while not eof do
|
|
|
|
|
begin
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select * from BS_Cloth_IO where BCIOID=''' + Trim(CDS_Sub.fieldbyname('BCIOID').AsString) + '''');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
MBCIOID := Trim(ADOQueryTemp.fieldbyname('BCIOID').AsString);
|
|
|
|
|
if Trim(MBCIOID) = '' then
|
|
|
|
|
begin
|
|
|
|
|
if not GetLSNo(ADOQueryCmd, Maxno, 'PC', 'BS_Cloth_IO', 3, 1) then
|
|
|
|
|
raise Exception.Create('ȡȾɫ<C8BE><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
Maxno := Trim(MBCIOID);
|
|
|
|
|
end;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
|
2025-06-06 13:56:41 +08:00
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select * from BS_Cloth_IO where BCIOID=''' + Trim(Maxno) + '''');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
begin
|
|
|
|
|
if Trim(MBCIOID) = '' then
|
|
|
|
|
begin
|
|
|
|
|
Append;
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
Edit;
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
end;
|
|
|
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Sub, 'BS_Cloth_IO', 2);
|
|
|
|
|
FieldByName('STKName').Value := FSTKName;
|
|
|
|
|
FieldByName('Workshop').Value := FWorkshop;
|
|
|
|
|
FieldByName('BCIOID').Value := Trim(Maxno);
|
|
|
|
|
FieldByName('IOFlag').Value := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
FieldByName('IOQtyFlag').Value := -1;
|
|
|
|
|
FieldByName('STKID').Value := CDS_Sub.fieldbyname('STKID').Value;
|
|
|
|
|
FieldByName('FromCoNo').Value := CDS_Sub.fieldbyname('FromCoNo').Value;
|
|
|
|
|
FieldByName('FromCoName').Value := CDS_Sub.fieldbyname('FromCoName').Value;
|
|
|
|
|
FieldByName('StkCoNo').Value := CDS_Sub.fieldbyname('StkCoNo').Value;
|
|
|
|
|
FieldByName('ToCoNo').Value := CDS_Sub.fieldbyname('ToCoNo').Value;
|
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('Update BS_Cloth_IO Set StkPiece=(select Sum(isnull(Piece,0)*IOQtyFlag) from BS_Cloth_IO A where A.STKID=BS_Cloth_IO.BCIOID)');
|
|
|
|
|
sql.Add(',STKQty=(select Sum(isnull(Qty,0)*IOQtyFlag) from BS_Cloth_IO A where A.STKID=BS_Cloth_IO.BCIOID )');
|
|
|
|
|
sql.Add('where BCIOID=''' + Trim(CDS_Sub.fieldbyname('STKID').AsString) + '''');
|
|
|
|
|
ExecSQL;
|
|
|
|
|
end;
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select * from BS_Cloth_IO where BCIOID=''' + Trim(CDS_Sub.fieldbyname('STKID').AsString) + '''');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
if ADOQueryTemp.FieldByName('StkPiece').Value < 0 then
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1>棡');
|
|
|
|
|
|
|
|
|
|
if ADOQueryTemp.FieldByName('StkPiece').Value < 0 then
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1>棡');
|
|
|
|
|
|
|
|
|
|
Edit;
|
|
|
|
|
FieldByName('BCIOID').Value := Trim(Maxno);
|
|
|
|
|
Post;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
CDS_Sub.EnableControls;
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
Result := True;
|
|
|
|
|
except
|
|
|
|
|
Result := False;
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.TBCloseClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
Close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.FormShow(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
fsj: string;
|
|
|
|
|
begin
|
|
|
|
|
inherited;
|
|
|
|
|
ReadCxGrid(FSTKName + '<27><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>ϲֿ<CFB2>');
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add(' select A.* ');
|
|
|
|
|
sql.Add(' from BS_Cloth_IO A');
|
|
|
|
|
sql.Add(' where BCIOID=''' + Trim(FBCId) + '''');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
SCreateCDS(ADOQueryTemp, CDS_Sub);
|
|
|
|
|
SInitCDSData(ADOQueryTemp, CDS_Sub);
|
|
|
|
|
// fsj:='select name=CJName ,Code=null from CheJian';
|
|
|
|
|
// SInitCxGridComboBoxBySql(ADOQueryTemp,v1CheJian,fsj,0,True,'');
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.TBDelClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
if CDS_Sub.IsEmpty then
|
|
|
|
|
Exit;
|
|
|
|
|
if Trim(CDS_Sub.fieldbyname('BCIOID').AsString) <> '' then
|
|
|
|
|
begin
|
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
Sql.Clear;
|
|
|
|
|
Sql.Add('exec P_BS_Cloth_Out_Del ');
|
|
|
|
|
Sql.Add(' @BCIOIDS=' + quotedstr(Trim(CDS_Sub.fieldbyname('BCIOID').AsString)));
|
|
|
|
|
Sql.Add(',@DCode=' + quotedstr(Trim(DCode)));
|
|
|
|
|
Sql.Add(',@DName=' + quotedstr(Trim(DName)));
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
|
|
|
|
|
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
|
|
|
|
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
CDS_Sub.Delete;
|
|
|
|
|
except
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
CDS_Sub.Delete;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.TBSaveClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
if CDS_Sub.IsEmpty then
|
|
|
|
|
Exit;
|
|
|
|
|
if CDS_Sub.Locate('IOTime', null, []) = True then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʱ<EFBFBD>䲻<EFBFBD><E4B2BB>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
if CDS_Sub.Locate('IOType', null, []) = True then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
{ if CDS_Sub.Locate('CRType;LCKNO', VarArrayOf(['<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>', Null]), [loPartialKey]) then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><CCBF>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|
|
|
|
Exit;
|
|
|
|
|
end; }
|
|
|
|
|
if CDS_Sub.Locate('Piece', null, []) = True then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('ƥ<><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
if CDS_Sub.Locate('Qty', null, []) = True then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
if CDS_Sub.Locate('OrderNo', null, []) = True then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
if SaveCKData() then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|
|
|
|
//ModalResult:=1;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.ToolButton1Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
WriteCxGrid(fSTKName + '<27><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>ϲֿ<CFB2>');
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.Tv1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|
|
|
|
with frmCompanySel do
|
|
|
|
|
begin
|
|
|
|
|
if Trim(self.CDS_Sub.fieldbyname('IOType').AsString) = '<27>˻<EFBFBD>' then
|
|
|
|
|
FCoType := '<27>ͻ<EFBFBD>'
|
|
|
|
|
else
|
|
|
|
|
FCoType := '<27><>Ӧ<EFBFBD><D3A6>';
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
begin
|
|
|
|
|
with Self.CDS_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Edit;
|
|
|
|
|
FieldByName('ToCoNo').Value := Trim(CDS_1.fieldbyname('CoCode').AsString);
|
|
|
|
|
FieldByName('ToCoName').Value := Trim(CDS_1.fieldbyname('CoAbbrName').AsString);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmCompanySel.Free;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
|
|
|
var
|
|
|
|
|
FFSPID: string;
|
|
|
|
|
begin
|
2025-09-08 14:31:40 +08:00
|
|
|
|
// if CDS_Sub.IsEmpty then
|
|
|
|
|
// Exit;
|
|
|
|
|
// if Trim(CDS_Sub.fieldbyname('BCIOID').AsString) <> '' then
|
|
|
|
|
// begin
|
|
|
|
|
// with ADOQueryTemp do
|
|
|
|
|
// begin
|
|
|
|
|
// Close;
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
// sql.Add('select * from BS_Cloth_IO where BCIOID=''' + Trim(CDS_Sub.fieldbyname('BCIOID').AsString) + '''');
|
|
|
|
|
// Open;
|
|
|
|
|
// end;
|
|
|
|
|
// FFSPID := Trim(ADOQueryTemp.fieldbyname('BCIOID').AsString);
|
|
|
|
|
// if Trim(FFSPID) <> '' then
|
|
|
|
|
// begin
|
|
|
|
|
// v1CRType.Options.Editing := False;
|
|
|
|
|
// end
|
|
|
|
|
// else
|
|
|
|
|
// begin
|
|
|
|
|
// v1CRType.Options.Editing := True;
|
|
|
|
|
// end;
|
|
|
|
|
// end
|
|
|
|
|
// else
|
|
|
|
|
// begin
|
|
|
|
|
// v1CRType.Options.Editing := True;
|
|
|
|
|
// end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmDyeGreyClothOutEdit.v1Column13PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
begin
|
|
|
|
|
with ADOQueryTemp do
|
2025-06-06 13:56:41 +08:00
|
|
|
|
begin
|
2025-09-08 14:31:40 +08:00
|
|
|
|
close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('exec P_OrderCR');
|
|
|
|
|
|
|
|
|
|
// ShowMessage(sql.Text);
|
|
|
|
|
execsql;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frmProductOrderListSel := TfrmProductOrderListSel.create(self);
|
|
|
|
|
with frmProductOrderListSel do
|
|
|
|
|
begin
|
|
|
|
|
FWorkshop := self.FWorkshop;
|
|
|
|
|
if ShowModal = 1 then
|
2025-06-06 13:56:41 +08:00
|
|
|
|
begin
|
2025-09-08 14:31:40 +08:00
|
|
|
|
Self.CDS_Sub.FieldByName('OrderNo').Value := Order_Main.fieldbyname('OrderNo').asstring;
|
|
|
|
|
// initGlide();
|
2025-06-06 13:56:41 +08:00
|
|
|
|
end;
|
2025-09-08 14:31:40 +08:00
|
|
|
|
free;
|
2025-06-06 13:56:41 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|