2025-03-01 10:55:52 +08:00
|
|
|
|
unit U_TatPlanMachInput;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|
|
|
|
|
cxEdit, DB, cxDBData, ADODB, DBClient, cxGridLevel, cxGridCustomTableView,
|
|
|
|
|
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
|
|
|
|
|
cxGrid, ComCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, cxTextEdit,
|
|
|
|
|
|
cxButtonEdit, StdCtrls, ExtCtrls, cxCurrencyEdit, BtnEdit, cxLookAndFeels,
|
|
|
|
|
|
cxLookAndFeelPainters, cxNavigator, cxContainer, cxMaskEdit, dxDateRanges,
|
2025-07-05 09:59:21 +08:00
|
|
|
|
dxScrollbarAnnotations, cxDropDownEdit, dxSkinsCore, dxSkinsDefaultPainters,
|
2025-07-18 15:42:53 +08:00
|
|
|
|
dxSkinOffice2013White, dxSkinSharpPlus, dxSkinWXI;
|
2025-03-01 10:55:52 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmTatPlanMachInput = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
PMID: TcxTextEdit;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
MCNO: TcxTextEdit;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
OrderNo: TcxButtonEdit;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
MainID: TcxTextEdit;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
SubID: TcxTextEdit;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
C_Name: TcxTextEdit;
|
|
|
|
|
|
C_Code: TcxTextEdit;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
ClientDataSet1: TClientDataSet;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
ADOQuery2: TADOQuery;
|
|
|
|
|
|
CDS_2: TClientDataSet;
|
|
|
|
|
|
DS_2: TDataSource;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
|
TV2: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
TV1: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column1: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel2: TcxGridLevel;
|
|
|
|
|
|
Label14: TLabel;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
C_FinishLatitudeDensity: TcxTextEdit;
|
|
|
|
|
|
C_FinishLatitudeBatchNo: TcxTextEdit;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
WB_Name: TcxTextEdit;
|
|
|
|
|
|
action: TcxComboBox;
|
|
|
|
|
|
PMType: TcxComboBox;
|
|
|
|
|
|
WB_Code: TcxButtonEdit;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
2025-11-12 17:32:44 +08:00
|
|
|
|
cxGrid3: TcxGrid;
|
|
|
|
|
|
Tv3: TcxGridDBTableView;
|
|
|
|
|
|
Tv2Column7: TcxGridDBColumn;
|
|
|
|
|
|
v2Column10: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
2025-12-09 17:30:17 +08:00
|
|
|
|
Tv2Y_Composition: TcxGridDBColumn;
|
2025-11-12 17:32:44 +08:00
|
|
|
|
v2Column6: TcxGridDBColumn;
|
2026-01-14 17:32:54 +08:00
|
|
|
|
Tv2Z_Number: TcxGridDBColumn;
|
2025-11-12 17:32:44 +08:00
|
|
|
|
Tv2Column12: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel3: TcxGridLevel;
|
|
|
|
|
|
Tv3BatchNO: TcxGridDBColumn;
|
|
|
|
|
|
CDS_3: TClientDataSet;
|
|
|
|
|
|
DS_3: TDataSource;
|
2025-03-01 10:55:52 +08:00
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure PMTypePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure OrderNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure WB_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
procedure PMTypePropertiesChange(Sender: TObject);
|
2025-12-09 17:30:17 +08:00
|
|
|
|
procedure Tv3BatchNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v2Column10PropertiesButtonClick(Sender: TObject;
|
2025-11-12 17:32:44 +08:00
|
|
|
|
AButtonIndex: Integer);
|
2025-03-01 10:55:52 +08:00
|
|
|
|
private
|
|
|
|
|
|
canshu1, YCP, XCP: string;
|
|
|
|
|
|
Fint, CXS: Integer;
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
|
function CheckData(): Boolean;
|
2025-12-09 17:30:17 +08:00
|
|
|
|
procedure InitClothYarn();
|
2025-03-01 10:55:52 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
2025-09-01 15:38:00 +08:00
|
|
|
|
FPMID, FCYCode, FCPID, FCPNO, FCPName, FMCNo, FMCType: string;
|
2025-03-01 10:55:52 +08:00
|
|
|
|
CopyInt, PState: Integer;
|
|
|
|
|
|
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmTatPlanMachInput: TfrmTatPlanMachInput;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
2025-12-09 17:30:17 +08:00
|
|
|
|
U_DataLink, U_RTFun, U_iniParam, U_ZDYHelp, U_TatPlanSel, U_WBSpecSel,
|
|
|
|
|
|
U_YarnStkSel,U_YarnInfoSel;
|
2025-03-01 10:55:52 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.InitData();
|
|
|
|
|
|
var
|
|
|
|
|
|
FXHInt: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryMain.DisableControls;
|
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
SQL.Add('select * from Tat_Plan_Mach where PMID=''' + Trim(FPMID) + '''');
|
|
|
|
|
|
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryMain.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
PMType.Text := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
MCNo.text := FMCNo;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
SCSHData(ADOQueryMain, ScrollBox1, 2);
|
|
|
|
|
|
PMType.ItemIndex := PMType.Properties.Items.IndexOf(trim(ADOQueryMain.fieldbyname('PMType').AsString));
|
|
|
|
|
|
|
|
|
|
|
|
action.ItemIndex := action.Properties.Items.IndexOf(trim(ADOQueryMain.fieldbyname('action').AsString));
|
|
|
|
|
|
|
|
|
|
|
|
if trim(PMType.text) = '<27>²<EFBFBD><C2B2>Ļ<EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
action.text := '<27>²<EFBFBD><C2B2>Ļ<EFBFBD>';
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////ˢ<><CBA2>ǰ<EFBFBD><C7B0><EFBFBD>μ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>/////////////////////////
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select top 2 PMType,filltime from Tat_Plan_Mach where MCNO =''' + Trim(MCNO.Text) + '''');
|
|
|
|
|
|
sql.Add('ORDER BY FillTime desc ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQueryTemp, CDS_2);
|
|
|
|
|
|
SInitCDSData(ADOQueryTemp, CDS_2);
|
|
|
|
|
|
/////////////////ˢ<><CBA2>ǰ<EFBFBD><C7B0><EFBFBD>μ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>/////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
ADOQueryMain.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-12-09 17:30:17 +08:00
|
|
|
|
procedure TfrmTatPlanMachInput.InitClothYarn();
|
2025-11-12 17:32:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2025-12-09 17:30:17 +08:00
|
|
|
|
sql.Add('select A.* from Tat_Plan_Mach_Yarn A ');
|
|
|
|
|
|
sql.Add(' where A.PMID=''' + Trim(FPMID) + '''');
|
2025-11-12 17:32:44 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQueryTemp, CDS_3);
|
|
|
|
|
|
SInitCDSData(ADOQueryTemp, CDS_3);
|
2025-12-09 17:30:17 +08:00
|
|
|
|
// ClearCDSColumn(CDS_3, ['YRId', 'SubId', 'MainId']);
|
|
|
|
|
|
|
|
|
|
|
|
if FPMID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('RowNo').Value := 'A';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('RowNo').Value := 'B';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('RowNo').Value := 'C';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('RowNo').Value := 'D';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('RowNo').Value := 'E';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('RowNo').Value := 'F';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2025-11-12 17:32:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
procedure TfrmTatPlanMachInput.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
readCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
readCxGrid(trim(self.Caption) + 'Tv2', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
2025-11-12 17:32:44 +08:00
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
InitData();
|
2025-12-09 17:30:17 +08:00
|
|
|
|
InitClothYarn();
|
2025-03-01 10:55:52 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmTatPlanMachInput.SaveData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
maxId, FCYNo, maxpbno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
|
|
|
|
|
|
if FPMID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, maxId, 'RW', 'Tat_Plan_Mach', 4, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
PMID.Text := trim(maxId);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
maxId := trim(FPMID);
|
|
|
|
|
|
PMID.Text := trim(maxId);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from Tat_Plan_Mach where PMID=''' + Trim(FPMID) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if FPMID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('Filltime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('PMID').Value := Trim(maxId);
|
|
|
|
|
|
RTSetsavedata(ADOQueryCmd, 'Tat_Plan_Mach', ScrollBox1, 2);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('EXEC P_Tat_Plan_Mach_SetSequence @PMID=''' + Trim(PMID.Text) + '''');
|
|
|
|
|
|
sql.Add(',@Operate=''<27><><EFBFBD><EFBFBD>'' ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-12-09 17:30:17 +08:00
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD>ɴ<EFBFBD><C9B4><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
with CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(CDS_3.fieldbyname('YRId').AsString) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryTemp, maxpbno, 'RM', 'Tat_Plan_Mach_Yarn', 4, 1) = False then
|
|
|
|
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
maxpbno := Trim(CDS_3.fieldbyname('YRId').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from Tat_Plan_Mach_Yarn where ');
|
|
|
|
|
|
sql.Add(' YRId=''' + Trim(maxpbno) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(CDS_3.fieldbyname('YRId').AsString) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('YRType').Value := 'γ˿';
|
|
|
|
|
|
FieldByName('MainId').Value := Trim(OrderNo.Text);
|
|
|
|
|
|
FieldByName('OrderNo').Value := Trim(OrderNo.Text);
|
|
|
|
|
|
// FieldByName('SubId').Value := Trim(maxsubno);
|
|
|
|
|
|
FieldByName('YRId').Value := Trim(maxpbno);
|
|
|
|
|
|
FieldByName('PMID').Value := Trim(maxId);
|
|
|
|
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv3, CDS_3, 'Tat_Plan_Mach_Yarn', 0);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD>ɴ<EFBFBD><C9B4><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
//////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
FPMID := maxId;
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.ToolButton1Click(Sender: TObject);
|
2025-07-07 14:45:30 +08:00
|
|
|
|
var
|
|
|
|
|
|
FWB_CODE: string;
|
2025-03-01 10:55:52 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if CheckData() = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
2025-07-07 14:45:30 +08:00
|
|
|
|
if FPMID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('SELECT * FROM Tat_Plan_Mach');
|
|
|
|
|
|
sql.Add('WHERE ISNULL(Status, ''0'') in (''0'') ');
|
|
|
|
|
|
SQL.Add('AND MCNO=' + QuotedStr(FMCNo));
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryTemp.IsEmpty = FALSE then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27>û<EFBFBD>̨<EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A3ACB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棡', '<27><>ʾ', 0);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if PMType.Text = '<27>²<EFBFBD><C2B2>Ļ<EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if FPMID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('SELECT * FROM Tat_Plan_Mach');
|
|
|
|
|
|
sql.Add('WHERE ISNULL(Status, ''0'') in (''1'') ');
|
|
|
|
|
|
SQL.Add('AND MCNO=' + QuotedStr(FMCNo));
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOQueryTemp.IsEmpty = FALSE then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ADOQueryTemp.FieldByName('WB_CODE').AsString <> WB_CODE.Text then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ղ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棡', '<27><>ʾ', 0);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
ModalResult := 1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
WriteCxGrid(trim(self.Caption) + 'Tv2', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-12-09 17:30:17 +08:00
|
|
|
|
procedure TfrmTatPlanMachInput.Tv3BatchNOPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-11-12 17:32:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmYarnStkSel := TfrmYarnStkSel.Create(Application);
|
|
|
|
|
|
with frmYarnStkSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FstkName := 'ɴ<><C9B4>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
frmYarnStkSel.CDS_Main.DisableControls;
|
|
|
|
|
|
|
|
|
|
|
|
with Self.CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
edit;
|
|
|
|
|
|
FieldByName('BatchNo').Value := frmYarnStkSel.CDS_Main.fieldbyname('BatchNo').Value;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
frmYarnStkSel.CDS_Main.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmYarnStkSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-12-09 17:30:17 +08:00
|
|
|
|
procedure TfrmTatPlanMachInput.v2Column10PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmYarnInfoSel := TfrmYarnInfoSel.Create(Application);
|
|
|
|
|
|
with frmYarnInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with self.CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Y_Code').Value := frmYarnInfoSel.CDS_1.fieldbyname('Y_Code').Value;
|
|
|
|
|
|
FieldByName('Y_Name').Value := frmYarnInfoSel.CDS_1.fieldbyname('Y_Name').Value;
|
|
|
|
|
|
|
|
|
|
|
|
// FieldByName('Y_Spec').Value := frmYarnInfoSel.CDS_1.fieldbyname('Y_Spec').Value;
|
|
|
|
|
|
FieldByName('Y_Color').Value := frmYarnInfoSel.CDS_1.fieldbyname('Y_Color').Value;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('FF').Value := frmYarnInfoSel.CDS_1.fieldbyname('FF').Value;
|
|
|
|
|
|
FieldByName('ND').Value := frmYarnInfoSel.CDS_1.fieldbyname('ND').Value;
|
|
|
|
|
|
|
|
|
|
|
|
// FieldByName('Brand').Value := frmYarnInfoSel.CDS_1.fieldbyname('Brand').Value;
|
|
|
|
|
|
FieldByName('Y_Composition').Value := frmYarnInfoSel.CDS_1.fieldbyname('Y_Composition').Value;
|
|
|
|
|
|
FieldByName('TestDenier').Value := frmYarnInfoSel.CDS_1.fieldbyname('Denier').Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmYarnInfoSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
procedure TfrmTatPlanMachInput.WB_CodePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmWBSpecSel := TfrmWBSpecSel.Create(Application);
|
|
|
|
|
|
with frmWBSpecSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Self.WB_Code.Text := frmWBSpecSel.CDS_1.fieldbyname('WB_Code').AsString;
|
|
|
|
|
|
Self.WB_Name.Text := frmWBSpecSel.CDS_1.fieldbyname('WB_Name').AsString;
|
2025-12-09 17:30:17 +08:00
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmWBSpecSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmTatPlanMachInput.CheckData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue, FReal: Double;
|
|
|
|
|
|
maxConNo: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
if Trim(orderno.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><>֯<EFBFBD><D6AF><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(action.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if Trim(CYNo.Text) = '' then
|
|
|
|
|
|
// raise Exception.Create('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
// if Trim(JZPM.Text) = '' then
|
|
|
|
|
|
// raise Exception.Create('<27><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
// if Trim(weimi.Text) = '' then
|
|
|
|
|
|
// raise Exception.Create('γ<>ܲ<EFBFBD><DCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
// if Trim(wsspec.Text) = '' then
|
|
|
|
|
|
// raise Exception.Create('γɴ<CEB3><C9B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
// if Trim(pici.Text) = '' then
|
|
|
|
|
|
// raise Exception.Create('<27><><EFBFBD>β<EFBFBD><CEB2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|
|
|
|
|
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.PMTypePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TcxButtonEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|
|
|
|
|
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TcxTextEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.PMTypePropertiesChange(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(PMType.text) = '<27>²<EFBFBD><C2B2>Ļ<EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
action.Text := '<27>²<EFBFBD><C2B2>Ļ<EFBFBD>';
|
|
|
|
|
|
action.Enabled := False;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
action.Text := '';
|
|
|
|
|
|
action.Enabled := true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatPlanMachInput.OrderNoPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmTatPlanSel := TfrmTatPlanSel.Create(Application);
|
|
|
|
|
|
with frmTatPlanSel do
|
|
|
|
|
|
begin
|
2025-09-01 15:38:00 +08:00
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Self.OrderNo.Text := frmTatPlanSel.CDS_1.fieldbyname('OrderNo').AsString;
|
|
|
|
|
|
Self.MainID.Text := frmTatPlanSel.CDS_1.fieldbyname('MainID').AsString;
|
|
|
|
|
|
Self.SubID.Text := frmTatPlanSel.CDS_1.fieldbyname('SubID').AsString;
|
|
|
|
|
|
Self.C_Code.Text := frmTatPlanSel.CDS_1.fieldbyname('C_Code').AsString;
|
|
|
|
|
|
Self.C_Name.Text := frmTatPlanSel.CDS_1.fieldbyname('C_Name').AsString;
|
|
|
|
|
|
Self.C_FinishLatitudeDensity.Text := frmTatPlanSel.CDS_1.fieldbyname('C_FinishLatitudeDensity').AsString;
|
2025-07-05 09:59:21 +08:00
|
|
|
|
Self.WB_Code.Text := frmTatPlanSel.CDS_1.fieldbyname('WB_Code').AsString;
|
|
|
|
|
|
Self.WB_Name.Text := frmTatPlanSel.CDS_1.fieldbyname('WB_Name').AsString;
|
2025-03-01 10:55:52 +08:00
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select WB_Code,WB_Name from Bs_Cloth_Info where C_Code =''' + Trim(Self.C_Code.Text) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2025-07-05 09:59:21 +08:00
|
|
|
|
// Self.WB_Code.Text := ADOQueryTemp.fieldbyname('WB_Code').AsString;
|
|
|
|
|
|
// Self.WB_Name.Text := ADOQueryTemp.fieldbyname('WB_Name').AsString;
|
2025-12-09 17:30:17 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with self.ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select * from Tat_Plan_Yarn ');
|
|
|
|
|
|
sql.Add(' where YRType=''γ˿'' and MainId=''' + Trim(frmTatPlanSel.CDS_1.fieldbyname('MainId').AsString) + '''');
|
|
|
|
|
|
sql.Add(' Order by RowNo ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
self.CDS_3.EmptyDataSet;
|
|
|
|
|
|
self.ADOQueryCmd.First;
|
|
|
|
|
|
|
|
|
|
|
|
while not self.ADOQueryCmd.eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with self.CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
APpend;
|
|
|
|
|
|
FieldByName('RowNo').Value := self.ADOQueryCmd.fieldbyname('RowNo').Value;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('Y_Code').Value := self.ADOQueryCmd.fieldbyname('Y_Code').Value;
|
|
|
|
|
|
FieldByName('Y_Name').Value := self.ADOQueryCmd.fieldbyname('Y_Name').Value;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('Y_Color').Value := self.ADOQueryCmd.fieldbyname('Y_Color').Value;
|
|
|
|
|
|
FieldByName('Y_Composition').Value := self.ADOQueryCmd.fieldbyname('Y_Composition').Value;
|
|
|
|
|
|
|
|
|
|
|
|
FieldByName('BatchNO').Value := self.ADOQueryCmd.fieldbyname('BatchNO').Value;
|
|
|
|
|
|
|
2026-01-14 17:32:54 +08:00
|
|
|
|
FieldByName('Z_Number').Value := self.ADOQueryCmd.fieldbyname('Z_Number').Value;
|
2025-12-09 17:30:17 +08:00
|
|
|
|
|
|
|
|
|
|
// FieldByName('FF').Value := self.ADOQueryCmd.fieldbyname('FF').Value;
|
|
|
|
|
|
// FieldByName('ND').Value := self.ADOQueryCmd.fieldbyname('ND').Value;
|
|
|
|
|
|
FieldByName('note').Value := self.ADOQueryCmd.fieldbyname('note').Value;
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
self.ADOQueryCmd.next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 10:55:52 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmTatPlanSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|