2025-03-11 15:26:40 +08:00
unit U_TatGYInPut;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
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, cxDropDownEdit,
StrUtils, cxPC, ShellAPI, cxCalendar, Math, cxLookAndFeels,
cxLookAndFeelPainters, dxBarBuiltInMenu, cxNavigator, dxDateRanges,
U_BaseInput, System. ImageList, Vcl. ImgList, Vcl. Menus, cxCheckBox, dxCore,
cxDateUtils, dxScrollbarAnnotations, cxGridCustomPopupMenu, cxGridPopupMenu,
dxCoreClasses, dxHashUtils, dxSpreadSheetCore, dxSpreadSheetCoreFormulas,
dxSpreadSheetCoreHistory, dxSpreadSheetCoreStyles, dxSpreadSheetCoreStrs,
dxSpreadSheetConditionalFormatting, dxSpreadSheetConditionalFormattingRules,
dxSpreadSheetClasses, dxSpreadSheetContainers, dxSpreadSheetFormulas,
dxSpreadSheetHyperlinks, dxSpreadSheetFunctions, dxSpreadSheetStyles,
dxSpreadSheetGraphics, dxSpreadSheetPrinting, dxSpreadSheetTypes,
dxSpreadSheetUtils, dxSpreadSheetFormattedTextUtils, dxSpreadSheet,
dxSkinsCore, dxSkinsDefaultPainters, cxImageList, 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;
type
TfrmTatGYInPut = class( TfrmBaseInput)
ToolBar1: TToolBar;
TBSave: TToolButton;
TBClose: TToolButton;
ScrollBox1: TScrollBox;
Label2: TLabel;
Label3: TLabel;
Label14: TLabel;
ADOQueryTemp: TADOQuery;
Label5: TLabel;
Label8: TLabel;
Label12: TLabel;
OrdPieceLen: TcxTextEdit;
OrdPiece: TcxTextEdit;
Label13: TLabel;
OrdQty: TcxTextEdit;
CDS_2: TClientDataSet;
DS_1: TDataSource;
CDS_1: TClientDataSet;
DS_2: TDataSource;
Label26: TLabel;
Label31: TLabel;
Label47: TLabel;
C_Name: TcxTextEdit;
Label43: TLabel;
lbl2: TLabel;
Saleser: TcxTextEdit;
Label7: TLabel;
OrderNo: TcxTextEdit;
Label4: TLabel;
ToolButton8: TToolButton;
Label35: TLabel;
ConMId: TcxTextEdit;
ConSId: TcxTextEdit;
cxPageControl3: TcxPageControl;
cxTabSheet1: TcxTabSheet;
GroupBox1: TGroupBox;
Y_Note_PLJ: TMemo;
cxTabSheet2: TcxTabSheet;
GroupBox2: TGroupBox;
Y_Note_PLW: TMemo;
cxTabSheet3: TcxTabSheet;
cxGrid4: TcxGrid;
TV4: TcxGridDBTableView;
TV4Column1: TcxGridDBColumn;
cxGridDBColumn16: TcxGridDBColumn;
cxGridDBColumn17: TcxGridDBColumn;
cxGridLevel5: TcxGridLevel;
Panel1: TPanel;
cxPageControl2: TcxPageControl;
Panel2: TPanel;
cxPageControl1: TcxPageControl;
DS_QZ: TDataSource;
CDS_QZ: TClientDataSet;
ThroughHealdOrder: TcxMemo;
C_FinishLatitudeDensity: TcxTextEdit;
C_GramWeight: TcxTextEdit;
C_ReedNo: TcxTextEdit;
C_ReedWidth: TcxTextEdit;
C_YarnQty: TcxTextEdit;
LoomType: TcxTextEdit;
OrdNote: TcxMemo;
Label10: TLabel;
Label9: TLabel;
Label6: TLabel;
Label11: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label55: TLabel;
Label18: TLabel;
OurCoName: TcxButtonEdit;
FtyCoName: TcxButtonEdit;
OrdType: TcxComboBox;
DlyDate: TcxDateEdit;
OrdDate: TcxDateEdit;
ConNo: TcxButtonEdit;
CustName: TcxButtonEdit;
C_Spec: TcxMemo;
C_Code: TcxButtonEdit;
cxGrid1: TcxGrid;
TV1: TcxGridDBTableView;
TV1Column7: TcxGridDBColumn;
cxGridDBColumn3: TcxGridDBColumn;
cxGridDBColumn4: TcxGridDBColumn;
cxGridDBColumn5: TcxGridDBColumn;
cxGridDBColumn8: TcxGridDBColumn;
TV1Column1: TcxGridDBColumn;
TV1Column2: TcxGridDBColumn;
TV1Column3: TcxGridDBColumn;
TV1Column4: TcxGridDBColumn;
TV1Column5: TcxGridDBColumn;
TV1Column6: TcxGridDBColumn;
TV1Column8: TcxGridDBColumn;
TV1Column9: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
Tv2Column7: TcxGridDBColumn;
v2Column10: TcxGridDBColumn;
cxGridDBColumn1: TcxGridDBColumn;
v2Column2: TcxGridDBColumn;
v2Column6: TcxGridDBColumn;
Tv2Column1: TcxGridDBColumn;
Tv2Column2: TcxGridDBColumn;
Tv2Column3: TcxGridDBColumn;
Tv2Column4: TcxGridDBColumn;
Tv2Column5: TcxGridDBColumn;
Tv2Column6: TcxGridDBColumn;
Tv2Column8: TcxGridDBColumn;
Tv2Column9: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
GPM_1: TcxGridPopupMenu;
GPM_2: TcxGridPopupMenu;
cxTabSheet4: TcxTabSheet;
CZF: TMemo;
cxTabSheet5: TcxTabSheet;
CKF: TMemo;
TV1Column11: TcxGridDBColumn;
TV1Column12: TcxGridDBColumn;
Tv2Column11: TcxGridDBColumn;
Tv2Column12: TcxGridDBColumn;
Label1: TLabel;
PBQty: TcxTextEdit;
Label19: TLabel;
DDQty: TcxTextEdit;
Label20: TLabel;
C_Width: TcxTextEdit;
Label21: TLabel;
C_FinishWidth: TcxTextEdit;
Label22: TLabel;
BBNo: TcxTextEdit;
Label23: TLabel;
C_Color: TcxTextEdit;
QZF: TMemo;
Tv2Column10: TcxGridDBColumn;
Tv2Column13: TcxGridDBColumn;
TV1Column10: TcxGridDBColumn;
TV1Column13: TcxGridDBColumn;
2025-03-12 16:13:21 +08:00
Label24: TLabel;
Label25: TLabel;
WB_Name: TcxTextEdit;
WB_Code: TcxButtonEdit;
ADOQueryCmd: TADOQuery;
ADOQuery1: TADOQuery;
2025-05-28 09:28:35 +08:00
TV1Column14: TcxGridDBColumn;
Tv2Column14: TcxGridDBColumn;
Label27: TLabel;
Label28: TLabel;
2025-07-05 09:59:21 +08:00
C_TestGramWeight: TcxTextEdit;
2025-03-11 15:26:40 +08:00
procedure TBCloseClick( Sender: TObject) ;
procedure FormShow( Sender: TObject) ;
procedure TBSaveClick( Sender: TObject) ;
procedure cxGridDBColumn1PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure v2Column11PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure OrdPieceLenChange( Sender: TObject) ;
procedure OrdPieceChange( Sender: TObject) ;
procedure C_CodeKeyPress( Sender: TObject; var Key: Char ) ;
procedure ConNoKeyPress( Sender: TObject; var Key: Char ) ;
procedure MCTypeBtnUpClick( Sender: TObject) ;
procedure cxGridDBColumn4PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure Edit1KeyPress( Sender: TObject; var Key: Char ) ;
procedure ToolButton7Click( Sender: TObject) ;
procedure ToolButton9Click( Sender: TObject) ;
procedure FormCreate( Sender: TObject) ;
procedure OurCoNamePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure OurCoNameDblClick( Sender: TObject) ;
procedure FtyCoNamePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure CustNamePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure C_CodePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure ConNoPropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure ToolButton8Click( Sender: TObject) ;
procedure OrdPiecePropertiesEditValueChanged( Sender: TObject) ;
procedure cxGridDBColumn3PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure v2Column10PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure TV1Column1PropertiesEditValueChanged( Sender: TObject) ;
procedure Tv2Column1PropertiesEditValueChanged( Sender: TObject) ;
procedure C_YarnQtyPropertiesEditValueChanged( Sender: TObject) ;
2025-03-12 16:13:21 +08:00
procedure WB_CodePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
2025-07-05 09:59:21 +08:00
procedure TV1CellClick( Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean ) ;
procedure Tv2CellClick( Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean ) ;
2025-03-11 15:26:40 +08:00
private
FXS, FGridFlag: Integer ;
procedure InitData( ) ;
procedure Initexcel( ) ;
procedure CALCYarnQty( ) ;
procedure JSJS( ) ; //<2F> <> <EFBFBD> 㾭˿
procedure JSWS( ) ; //<2F> <> <EFBFBD> <EFBFBD> γ ˿
procedure JSKZ( ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
function SaveData( ) : Boolean ;
procedure InitClothYarn( MC_Code: string ) ;
{ Private declarations }
public
PState, FCopyInt: Integer ;
FConNo, FMainId, FSubId: string ;
2025-07-05 09:59:21 +08:00
fStatus: Integer ; //0<> <30> <EFBFBD> <EFBFBD> , 1<> <EFBFBD>
2025-03-11 15:26:40 +08:00
{ Public declarations }
end ;
var
frmTatGYInPut: TfrmTatGYInPut;
newh: hwnd;
implementation
uses
U_DataLink, U_ZDYHelp, U_RTFun, U_TatClothInfoSel, U_CompanySel, U_YarnInfoSel,
2025-03-12 16:13:21 +08:00
U_TradeSalesContractSel, U_WBSpecSel;
2025-03-11 15:26:40 +08:00
{$R *.dfm}
procedure TfrmTatGYInPut. InitClothYarn( MC_Code: string ) ;
begin
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.* from Bs_Cloth_Info A' ) ;
sql. Add( ' where A.C_Code=' '' + Trim( MC_Code) + '' '' ) ;
Open;
end ;
Self. C_Code. Text : = ADOQueryTemp. fieldbyname( 'C_Code' ) . AsString;
Self. C_Name. Text : = ADOQueryTemp. fieldbyname( 'C_Name' ) . AsString;
Self. C_Spec. Text : = ADOQueryTemp. fieldbyname( 'C_Spec' ) . AsString;
Self. C_FinishLatitudeDensity. Text : = ADOQueryTemp. fieldbyname( 'C_FinishLatitudeDensity' ) . AsString;
Self. C_GramWeight. Text : = ADOQueryTemp. fieldbyname( 'C_GramWeight' ) . AsString;
Self. C_ReedNo. Text : = ADOQueryTemp. fieldbyname( 'C_ReedNo' ) . AsString;
Self. C_YarnQty. Text : = ADOQueryTemp. fieldbyname( 'C_YarnQty' ) . AsString;
Self. C_TestGramWeight. Text : = ADOQueryTemp. fieldbyname( 'C_TestGramWeight' ) . AsString;
Self. LoomType. Text : = ADOQueryTemp. fieldbyname( 'LoomType' ) . AsString;
Self. C_ReedWidth. Text : = ADOQueryTemp. fieldbyname( 'C_ReedWidth' ) . AsString;
Self. BBNO. Text : = ADOQueryTemp. fieldbyname( 'BBNO' ) . AsString;
Self. C_Color. Text : = ADOQueryTemp. fieldbyname( 'C_Color' ) . AsString;
// Self.QZF.Text := ADOQueryTemp.fieldbyname('QZF').AsString;
// Self.CZF.Text := ADOQueryTemp.fieldbyname('CZF').AsString;
// Self.CKF.Text := ADOQueryTemp.fieldbyname('CKF').AsString;
// Self.Y_Note_PLJ.Text := ADOQueryTemp.fieldbyname('Y_Note_PLJ').AsString;
// Self.Y_Note_PLW.Text := ADOQueryTemp.fieldbyname('Y_Note_PLW').AsString;
2025-04-17 15:21:14 +08:00
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.*,MainId=cast(' '' ' as varchar(30)),SubId=cast(' '' ' as varchar(30)) from BS_Cloth_Yarn A inner join Bs_Cloth_Info B on A.BCIID=B.BCIID' ) ;
sql. Add( ' where A.YRType=' '<27> <> ˿' ' and B.C_Code=' '' + Trim( MC_Code) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_1) ;
SInitCDSData( ADOQueryTemp, CDS_1) ;
ClearCDSColumn( CDS_1, [ 'YRId' , 'SubId' , 'MainId' ] ) ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.*,MainId=cast(' '' ' as varchar(30)),SubId=cast(' '' ' as varchar(30)) from BS_Cloth_Yarn A inner join Bs_Cloth_Info B on A.BCIID=B.BCIID' ) ;
sql. Add( ' where A.YRType=' 'γ˿' ' and B.C_Code=' '' + Trim( MC_Code) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_2) ;
SInitCDSData( ADOQueryTemp, CDS_2) ;
ClearCDSColumn( CDS_2, [ 'YRId' , 'SubId' , 'MainId' ] ) ;
2025-03-11 15:26:40 +08:00
// with ADOQueryTemp do
// begin
// Close;
// sql.Clear;
// sql.Add('select A.*,MainId=cast('''' as varchar(30)),SubId=cast('''' as varchar(30)) from BS_Cloth_QZ A inner join Bs_Cloth_Info B on A.BCIID=B.BCIID');
// sql.Add(' where B.C_Code=''' + Trim(MC_Code) + '''');
// Open;
// end;
// SCreateCDS(ADOQueryTemp, CDS_QZ);
// SInitCDSData(ADOQueryTemp, CDS_QZ);
// ClearCDSColumn(CDS_QZ, ['QZID', 'SubId', 'MainId']);
end ;
procedure TfrmTatGYInPut. CALCYarnQty( ) ;
var
MYarnQty, MOrdQty, MWidth, MMachLatitudeDensity: Double ;
begin
// MYarnQty := STRTOFLOATDEF(C_YarnQty.Text, 0);
// MOrdQty := STRTOFLOATDEF(OrdQty.Text, 0);
// MWidth := STRTOFLOATDEF(StringReplace(C_Width.Text, 'CM', '', [rfReplaceAll, rfIgnoreCase]), 0);
// MMachLatitudeDensity := STRTOFLOATDEF(C_MachLatitudeDensity.Text, 0);
// with CDS_1 do
// begin
// DisableControls;
// First;
// while not Eof do
// begin
// Edit;
// FieldByName('Y_Qty').Value := MYarnQty * MOrdQty * FieldByName('Y_Ratio').AsFloat / 100 / 9000 * FieldByName('Denier').AsFloat / 1000;
// Next;
// end;
// EnableControls;
// end;
//
// with CDS_2 do
// begin
// DisableControls;
// First;
// while not Eof do
// begin
// Edit;
// FieldByName('Y_Qty').Value := MMachLatitudeDensity * MOrdQty * MWidth * FieldByName('Y_Ratio').AsFloat / 100 / 9000 * FieldByName('Denier').AsFloat / 1000;
// Next;
// end;
// EnableControls;
// end;
end ;
procedure TfrmTatGYInPut. TBCloseClick( Sender: TObject) ;
begin
ModalResult : = 1 ;
end ;
procedure TfrmTatGYInPut. InitData( ) ;
var
PBNO, PBFlag: string ;
begin
if PState = 1 then
begin
ConNo. enabled : = false ;
end ;
with ADOQueryTemp do
begin
Close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_Main A where A.MainId=' '' + Trim( FMainId) + '' '' ) ;
Open;
end ;
SCSHData( ADOQueryTemp, ScrollBox1, 0 ) ;
// QZF.Text := Trim(ADOQueryTemp.FieldByName('QZF').AsString);
CZF. Text : = Trim( ADOQueryTemp. FieldByName( 'CZF' ) . AsString) ;
CKF. Text : = Trim( ADOQueryTemp. FieldByName( 'CKF' ) . AsString) ;
with ADOQueryTemp do
begin
Close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_Sub A where A.MainId=' '' + Trim( FMainId) + '' '' ) ;
Open;
end ;
SCSHData( ADOQueryTemp, ScrollBox1, 2 ) ;
Y_Note_PLJ. Text : = ADOQueryTemp. FieldByName( 'Y_Note_PLJ' ) . AsString;
Y_Note_PLW. Text : = ADOQueryTemp. FieldByName( 'Y_Note_PLW' ) . AsString;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.* from Tat_Plan_Yarn A ' ) ;
sql. Add( ' where YRType=' '<27> <> ˿' ' and A.MainId=' '' + Trim( FMainId) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_1) ;
SInitCDSData( ADOQueryTemp, CDS_1) ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.* from Tat_Plan_Yarn A ' ) ;
sql. Add( ' where YRType=' 'γ˿' ' and A.MainId=' '' + Trim( FMainId) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_2) ;
SInitCDSData( ADOQueryTemp, CDS_2) ;
/////////////////ˢ<> <CBA2> <EFBFBD> <EFBFBD> <EFBFBD> ۹<EFBFBD> <DBB9> յ<EFBFBD> <D5B5> <EFBFBD> Ϣ/////////////////////////
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select * from Tat_Plan_QZ where MainId=' '' + Trim( FMainId) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_QZ) ;
SInitCDSData( ADOQueryTemp, CDS_QZ) ;
/////////////////ˢ<> <CBA2> <EFBFBD> <EFBFBD> <EFBFBD> ۹<EFBFBD> <DBB9> յ<EFBFBD> <D5B5> <EFBFBD> Ϣ/////////////////////////
if FMainId = '' then
begin
with CDS_1 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;
Append;
FieldByName( 'RowNo' ) . Value : = 'G' ;
Post;
end ;
with CDS_2 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;
Append;
FieldByName( 'RowNo' ) . Value : = 'G' ;
Post;
end ;
end ;
2025-03-12 16:13:21 +08:00
if FCopyInt = 1 then
begin
FMainId : = '' ;
OrderNo. text : = '' ;
with CDS_1 do
begin
First;
while not Eof do
begin
Edit;
FieldByName( 'MainID' ) . Value : = '' ;
FieldByName( 'SubID' ) . Value : = '' ;
FieldByName( 'YRId' ) . Value : = '' ;
Post;
Next;
end ;
end ;
with CDS_2 do
begin
First;
while not Eof do
begin
Edit;
FieldByName( 'MainID' ) . Value : = '' ;
FieldByName( 'SubID' ) . Value : = '' ;
FieldByName( 'YRId' ) . Value : = '' ;
Post;
Next;
end ;
end ;
end ;
2025-03-11 15:26:40 +08:00
end ;
procedure TfrmTatGYInPut. Initexcel( ) ;
var
myStream: TMemoryStream;
begin
// myStream := TMemoryStream.Create();
//
// with ADOQueryTemp do
// begin
// close;
// sql.Clear;
// sql.Add(' select * from BS_Cloth_Info_Excel A INNER JOIN Bs_Cloth_Info B on A.BCIID =B.BCIID where B.C_Code=''' + Trim(C_Code.text) + '''');
// open;
// end;
//
// if not ADOQueryTemp.IsEmpty then
// begin
//
// TBlobField(ADOQueryTemp.FieldByName('ExcelData')).SaveToStream(myStream);
// myStream.Position := 0;
// dxSpreadSheet1.LoadFromStream(myStream);
// end
// else
// begin
//// dxSpreadSheet1.ClearAll;
// end;
//
// myStream.Free;
end ;
procedure TfrmTatGYInPut. FormCreate( Sender: TObject) ;
var
FDate: TDateTime;
begin
FDate : = SGetServerDateTime( ADOQueryTemp) ;
OrdDate. Date : = FDate;
DlyDate. Date : = FDate;
end ;
procedure TfrmTatGYInPut. FormShow( Sender: TObject) ;
begin
ReadCxGrid( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƻ<EFBFBD> <C6BB> <EFBFBD> ¼<EFBFBD> <C2BC> 11' , Tv1, '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ;
ReadCxGrid( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƻ<EFBFBD> <C6BB> <EFBFBD> ¼<EFBFBD> <C2BC> 22' , Tv2, '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ;
InitData( ) ;
2025-07-05 16:25:58 +08:00
JSJS( ) ; //<2F> <> <EFBFBD> 㾭˿
JSWS( ) ; //<2F> <> <EFBFBD> <EFBFBD> γ ˿
JSKZ( ) ;
2025-03-11 15:26:40 +08:00
// Initexcel();
end ;
procedure TfrmTatGYInPut. FtyCoNamePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmCompanySel : = TfrmCompanySel. Create( Application) ;
with frmCompanySel do
begin
FCoType : = '<27> <> Ӧ<EFBFBD> <D3A6> ' ;
if ShowModal = 1 then
begin
FtyCoName. Properties. LookupItems. Text : = Trim( CDS_1. fieldbyname( 'CoCode' ) . AsString) ;
FtyCoName. Text : = Trim( CDS_1. fieldbyname( 'CoAbbrName' ) . AsString) ;
end ;
end ;
finally
frmCompanySel. Free;
end ;
end ;
function TfrmTatGYInPut. SaveData( ) : Boolean ;
var
maxno, maxsubno, maxpbno, maxpzno, maxsjno, maxQZID: string ;
begin
try
ADOQueryCmd. Connection. BeginTrans;
if Trim( FMainId) = '' then
begin
if GetLSNo( ADOQueryCmd, maxno, 'GY' , 'Tat_Plan_Main' , 4 , 1 ) = False then
raise Exception. Create( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˮ<EFBFBD> <CBAE> <EFBFBD> 쳣<EFBFBD> <ECB3A3> ' ) ;
OrderNo. Text : = maxno;
end
else
begin
maxno : = Trim( FMainId) ;
end ;
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //////////////////////////
with ADOQueryCmd do
begin
Close;
sql. Clear;
SQL. Add( 'select * from Tat_Plan_Main where MainId=' '' + Trim( FMainId) + '' '' ) ;
Open;
end ;
with ADOQueryCmd do
begin
if Trim( FMainId) = '' then
begin
Append;
FieldByName( 'Filler' ) . Value : = Trim( DName) ;
FieldByName( 'Status' ) . Value : = 1 1 ;
end
else
begin
Edit;
FieldByName( 'Editer' ) . Value : = Trim( DName) ;
FieldByName( 'EditTime' ) . Value : = SGetServerDateTime( ADOQueryTemp) ;
end ;
FieldByName( 'MainId' ) . Value : = Trim( maxno) ;
// FieldByName('QZF').Value := Trim(QZF.text);
FieldByName( 'CZF' ) . Value : = Trim( CZF. text ) ;
FieldByName( 'CKF' ) . Value : = Trim( CKF. text ) ;
RTSetsavedata( ADOQueryCmd, 'Tat_Plan_Main' , ScrollBox1, 0 ) ;
Post;
end ;
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //////////////////////////
///
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ӱ<EFBFBD> //////////////////////////
if Trim( FSubId) = '' then
begin
if GetLSNo( ADOQueryTemp, maxsubno, 'SZS' , 'Tat_Plan_Sub' , 4 , 1 ) = False then
raise Exception. Create( 'ȡ<> <C8A1> <EFBFBD> <EFBFBD> ˮ<EFBFBD> <CBAE> ʧ<EFBFBD> ܣ<EFBFBD> ' ) ;
end
else
begin
maxsubno : = Trim( FSubId) ;
end ;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_Sub where ' ) ;
sql. Add( ' SubId=' '' + Trim( maxsubno) + '' '' ) ;
Open;
end ;
with ADOQueryCmd do
begin
if Trim( FSubId) = '' then
Append
else
Edit;
FieldByName( 'MainId' ) . Value : = Trim( maxno) ;
FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
RTSetsavedata( ADOQueryCmd, 'Tat_Plan_Sub' , ScrollBox1, 2 ) ;
FieldByName( 'Y_Note_PLJ' ) . Value : = Trim( Y_Note_PLJ. Text ) ;
FieldByName( 'Y_Note_PLW' ) . Value : = Trim( Y_Note_PLW. Text ) ;
Post;
end ;
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ӱ<EFBFBD> //////////////////////////
////////////////////////// <20> <> <EFBFBD> 澭˿<E6BEAD> <CBBF> <EFBFBD> ȱ<EFBFBD> //////////////////////////
with CDS_1 do
begin
First;
while not Eof do
begin
if Trim( CDS_1. fieldbyname( 'YRId' ) . AsString) = '' then
begin
if GetLSNo( ADOQueryTemp, maxpbno, 'RJ' , 'Tat_Plan_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_1. fieldbyname( 'YRId' ) . AsString) ;
end ;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_Yarn where ' ) ;
sql. Add( ' YRId=' '' + Trim( maxpbno) + '' '' ) ;
Open;
end ;
with ADOQueryCmd do
begin
if Trim( CDS_1. 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 : = '<27> <> ˿' ;
FieldByName( 'MainId' ) . Value : = Trim( maxno) ;
FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
2025-07-05 09:59:21 +08:00
RTSetSaveDataCDS( ADOQueryCmd, Tv1, CDS_1, 'Tat_Plan_Yarn' , 0 ) ;
2025-03-11 15:26:40 +08:00
Post;
end ;
CDS_1. Edit;
CDS_1. FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
CDS_1. FieldByName( 'MainId' ) . Value : = Trim( maxno) ;
CDS_1. FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
Next;
end ;
end ;
////////////////////////// <20> <> <EFBFBD> 澭˿<E6BEAD> <CBBF> <EFBFBD> ȱ<EFBFBD> //////////////////////////
//////////////////////
////////////////////////// <20> <> <EFBFBD> <EFBFBD> γ ˿<CEB3> <CBBF> <EFBFBD> ȱ<EFBFBD> //////////////////////////
with CDS_2 do
begin
First;
while not Eof do
begin
if Trim( CDS_2. fieldbyname( 'YRId' ) . AsString) = '' then
begin
if GetLSNo( ADOQueryTemp, maxpbno, 'RJ' , 'Tat_Plan_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_2. fieldbyname( 'YRId' ) . AsString) ;
end ;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_Yarn where ' ) ;
sql. Add( ' YRId=' '' + Trim( maxpbno) + '' '' ) ;
Open;
end ;
with ADOQueryCmd do
begin
if Trim( CDS_2. 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( maxno) ;
FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
RTSetSaveDataCDS( ADOQueryCmd, Tv2, CDS_2, 'Tat_Plan_Yarn' , 0 ) ;
Post;
end ;
CDS_2. Edit;
CDS_2. FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
CDS_2. FieldByName( 'MainId' ) . Value : = Trim( maxno) ;
CDS_2. FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
Next;
end ;
end ;
////////////////////////// <20> <> <EFBFBD> <EFBFBD> γ ˿<CEB3> <CBBF> <EFBFBD> ȱ<EFBFBD> //////////////////////////
//////////////////////
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //////////////////////////
with CDS_QZ do
begin
First;
while not Eof do
begin
if Trim( CDS_QZ. fieldbyname( 'QZID' ) . AsString) = '' then
begin
if GetLSNo( ADOQueryTemp, maxQZID, 'QZ' , 'Tat_Plan_QZ' , 4 , 1 ) = False then
raise Exception. Create( 'ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˮ<EFBFBD> <CBAE> ʧ<EFBFBD> ܣ<EFBFBD> ' ) ;
end
else
begin
maxQZID : = Trim( CDS_QZ. fieldbyname( 'QZID' ) . AsString) ;
end ;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_QZ where ' ) ;
sql. Add( ' QZID=' '' + Trim( maxQZID) + '' '' ) ;
Open;
end ;
with ADOQueryCmd do
begin
if Trim( CDS_QZ. fieldbyname( 'QZID' ) . 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( 'MainId' ) . Value : = Trim( maxno) ;
FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
FieldByName( 'QZID' ) . Value : = Trim( maxQZID) ;
RTSetSaveDataCDS( ADOQueryCmd, Tv4, CDS_QZ, 'Tat_Plan_QZ' , 0 ) ;
Post;
end ;
CDS_QZ. Edit;
CDS_QZ. FieldByName( 'SubId' ) . Value : = Trim( maxsubno) ;
CDS_QZ. FieldByName( 'MainId' ) . Value : = Trim( maxno) ;
CDS_QZ. FieldByName( 'QZID' ) . Value : = Trim( maxQZID) ;
Next;
end ;
end ;
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //////////////////////////
ADOQueryCmd. Connection. CommitTrans;
FMainId : = Trim( maxno) ;
FSubId : = Trim( maxsubno) ;
Result : = True ;
except
Result : = False ;
CDS_1. EnableControls;
CDS_2. EnableControls;
ADOQueryCmd. Connection. RollbackTrans;
application. MessageBox( PChar( Exception( ExceptObject) . Message ) , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' , 0 ) ;
end ;
end ;
procedure TfrmTatGYInPut. TBSaveClick( Sender: TObject) ;
var
FReal: Double ;
maxConNo: string ;
begin
OrdDate. SetFocus;
CALCYarnQty( ) ;
2025-04-17 15:21:14 +08:00
// if Trim(CustName.Text) = '' then
// begin
// Application.MessageBox('<27> ͻ<EFBFBD> <CDBB> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> !', '<27> <> ʾ ', 0);
// Exit;
// end;
2025-03-11 15:26:40 +08:00
if Trim( OrdType. Text ) = '' then
begin
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> Ϊ<EFBFBD> <CEAA> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if Trim( C_Name. Text ) = '' then
begin
Application. MessageBox( '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> Ʋ<EFBFBD> <C6B2> <EFBFBD> Ϊ<EFBFBD> <CEAA> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if Trim( C_Code. Text ) = '' then
begin
Application. MessageBox( '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> Ų<EFBFBD> <C5B2> <EFBFBD> Ϊ<EFBFBD> <CEAA> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if Trim( C_Width. Text ) = '' then
begin
Application. MessageBox( '<27> ϻ<EFBFBD> <CFBB> ŷ<EFBFBD> <C5B7> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
// if Trim(OrdQty.Text) = '' then
// begin
// Application.MessageBox('<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> !', '<27> <> ʾ ', 0);
// Exit;
// end;
2025-04-17 15:21:14 +08:00
// if Trim(OrdPieceLen.Text) = '' then
// begin
// Application.MessageBox('ƥ<> <C6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> !', '<27> <> ʾ ', 0);
// Exit;
// end;
2025-03-11 15:26:40 +08:00
// if Trim(OrdPiece.Text) = '' then
// begin
// Application.MessageBox('ƥ<> <C6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> !', '<27> <> ʾ ', 0);
// Exit;
// end;
//
// if TryStrToFloat(OrdQty.Text, FReal) = False then
// begin
// Application.MessageBox('<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> !', '<27> <> ʾ ', 0);
// Exit;
// end;
2025-04-17 15:21:14 +08:00
// if TryStrToFloat(OrdPiecelen.Text, FReal) = False then
// begin
// Application.MessageBox('ƥ<> <C6A5> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> !', '<27> <> ʾ ', 0);
// Exit;
// end;
2025-03-11 15:26:40 +08:00
// if TryStrToFloat(OrdPiece.Text, FReal) = False then
// begin
// Application.MessageBox('ƥ<> <C6A5> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> !', '<27> <> ʾ ', 0);
// Exit;
// end;
2025-07-05 09:59:21 +08:00
with ADOQueryTemp do
begin
close;
SQL. Clear;
sql. Add( 'select * from Tat_Plan_Sub where C_Code = ' + QuotedStr( C_Code. Text ) ) ;
Open;
end ;
if ( ADOQueryTemp. RecordCount < > 0 ) and ( FStatus = 0 ) then
begin
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ظ<EFBFBD> <D8B8> <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
2025-03-11 15:26:40 +08:00
if SaveData( ) then
begin
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> <C9B9> <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
ModalResult : = 1 ;
end ;
end ;
procedure TfrmTatGYInPut. ToolButton7Click( Sender: TObject) ;
var
i, j: Integer ;
begin
for j : = 0 to 5 do
begin
i : = CDS_QZ. RecordCount;
i : = i + 1 ;
with CDS_QZ do
begin
Append;
FieldByName( 'SSEL' ) . Value : = FALSE ;
FieldByName( 'XuNO' ) . Value : = i;
Post;
end ;
end ;
end ;
procedure TfrmTatGYInPut. ToolButton8Click( Sender: TObject) ;
begin
WriteCxGrid( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƻ<EFBFBD> <C6BB> <EFBFBD> ¼<EFBFBD> <C2BC> 11' , Tv1, '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ;
WriteCxGrid( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƻ<EFBFBD> <C6BB> <EFBFBD> ¼<EFBFBD> <C2BC> 22' , Tv2, '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ) ;
end ;
procedure TfrmTatGYInPut. ToolButton9Click( Sender: TObject) ;
begin
if CDS_QZ. IsEmpty then
exit;
if CDS_QZ. Locate( 'ssel' , True , [ ] ) = False then
begin
Application. MessageBox( 'û<> <C3BB> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if Application. MessageBox( 'ȷ<> <C8B7> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϻ <EFBFBD> <CFBA> <EFBFBD> <EFBFBD> ݲ<EFBFBD> <DDB2> ָܻ<DCBB> <D6B8> <EFBFBD> ' , '<27> <> ʾ ' , 3 2 + 4 ) < > IDYES then
Exit;
CDS_QZ. DisableControls;
with CDS_QZ do
begin
First;
while not Eof do
begin
if CDS_QZ. FieldByName( 'SSel' ) . AsBoolean = True then
begin
if Trim( CDS_QZ. fieldbyname( 'QZID' ) . AsString) < > '' then
with ADOQueryCmd do
begin
Close;
sql. Clear;
sql. Add( 'delete PD_Plan_QZ where QZID=' '' + Trim( CDS_QZ. fieldbyname( 'QZID' ) . AsString) + '' '' ) ;
ExecSQL;
end ;
CDS_QZ. Delete;
end
else
Next;
end ;
end ;
CDS_QZ. EnableControls;
end ;
2025-07-05 09:59:21 +08:00
procedure TfrmTatGYInPut. TV1CellClick( Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean ) ;
2025-05-28 09:28:35 +08:00
var
AColumn: TcxGridColumn;
AFieldName: string ;
begin
if Assigned( ACellViewInfo) then
begin
AColumn : = ACellViewInfo. Item as TcxGridColumn;
AFieldName : = AColumn. DataBinding. FilterFieldName;
if AFieldName = 'MeterQty' then
begin
TV1Column1. Styles. Header : = DataLink_TatPlan. grid_head_blue;
TV1Column2. Styles. Header : = DataLink_TatPlan. grid_head_blue;
TV1Column6. Styles. Header : = DataLink_TatPlan. grid_head_blue;
TV1Column14. Styles. Header : = DataLink_TatPlan. grid_head_blue;
C_YarnQty. Style. Color : = clMoneyGreen;
end
else
begin
TV1Column1. Styles. Header : = nil ;
TV1Column2. Styles. Header : = nil ;
TV1Column6. Styles. Header : = nil ;
TV1Column14. Styles. Header : = nil ;
C_YarnQty. Style. Color : = clWhite;
end ;
end ;
end ;
2025-07-05 09:59:21 +08:00
2025-03-11 15:26:40 +08:00
procedure TfrmTatGYInPut. TV1Column1PropertiesEditValueChanged( Sender: TObject) ;
var
mvalue, FFieldName: string ;
2025-07-07 14:45:30 +08:00
GS, ZGS, MF, DS, WM, TW, SUNHAO: double ;
2025-03-11 15:26:40 +08:00
begin
mvalue : = TcxTextEdit( Sender) . EditingText;
FFieldName : = Trim( Tv1. Controller. FocusedColumn. DataBinding. FilterFieldName) ;
with CDS_1 do
begin
Edit;
FieldByName( FFieldName) . Value : = mvalue;
Post;
if FieldByName( 'YarnQty' ) . Value = null then
begin
GS : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
GS : = FieldByName( 'YarnQty' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
if FieldByName( 'CycleYarnQty' ) . Value = null then
begin
ZGS : = 0 ; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end
else
begin
ZGS : = FieldByName( 'CycleYarnQty' ) . Value; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
2025-07-07 14:45:30 +08:00
if FieldByName( 'SH' ) . Value = null then
begin
SUNHAO : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
SUNHAO : = FieldByName( 'SH' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
2025-03-11 15:26:40 +08:00
MF : = strtofloatdef( C_ReedWidth. text , 0 ) ; //<2F> ط<EFBFBD>
if FieldByName( 'TestDenier' ) . Value = null then
begin
DS : = 0 ; //D<> <44>
end
else
begin
DS : = FieldByName( 'TestDenier' ) . Value; //D<> <44>
end ;
WM : = strtofloatdef( C_FinishLatitudeDensity. text , 0 ) ; //γ <> <CEB3>
TW : = strtofloatdef( C_YarnQty. text , 0 ) ; //ͷ<> <CDB7>
end ;
if ZGS < > 0 then
begin
with CDS_1 do
begin
Edit;
2025-07-07 14:45:30 +08:00
FieldByName( 'MeterQty' ) . Value : = roundfloat( GS / ZGS * TW * DS * ( 1 + SUNHAO / 1 0 0 ) / 9 0 0 0 , 2 ) ;
2025-03-11 15:26:40 +08:00
Post;
end ;
end ;
JSKZ( ) ;
end ;
2025-07-05 09:59:21 +08:00
procedure TfrmTatGYInPut. Tv2CellClick( Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean ) ;
2025-05-28 09:28:35 +08:00
var
AColumn: TcxGridColumn;
AFieldName: string ;
begin
if Assigned( ACellViewInfo) then
begin
AColumn : = ACellViewInfo. Item as TcxGridColumn;
AFieldName : = AColumn. DataBinding. FilterFieldName;
if AFieldName = 'MeterQty' then
begin
TV2Column1. Styles. Header : = DataLink_TatPlan. grid_head_blue;
TV2Column2. Styles. Header : = DataLink_TatPlan. grid_head_blue;
TV2Column6. Styles. Header : = DataLink_TatPlan. grid_head_blue;
TV2Column14. Styles. Header : = DataLink_TatPlan. grid_head_blue;
C_ReedWidth. Style. Color : = clMoneyGreen;
C_FinishLatitudeDensity. Style. Color : = clMoneyGreen;
end
else
begin
TV2Column1. Styles. Header : = nil ;
TV2Column2. Styles. Header : = nil ;
TV2Column6. Styles. Header : = nil ;
TV2Column14. Styles. Header : = nil ;
C_ReedWidth. Style. Color : = clWhite;
C_FinishLatitudeDensity. Style. Color : = clWhite;
end ;
end ;
end ;
2025-03-11 15:26:40 +08:00
procedure TfrmTatGYInPut. Tv2Column1PropertiesEditValueChanged( Sender: TObject) ;
var
mvalue, FFieldName: string ;
2025-07-07 14:45:30 +08:00
GS, ZGS, MF, DS, WM, sunhao: double ;
2025-03-11 15:26:40 +08:00
begin
mvalue : = TcxTextEdit( Sender) . EditingText;
FFieldName : = Trim( Tv2. Controller. FocusedColumn. DataBinding. FilterFieldName) ;
with CDS_2 do
begin
Edit;
FieldByName( FFieldName) . Value : = mvalue;
Post;
if FieldByName( 'YarnQty' ) . Value = null then
begin
GS : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
GS : = FieldByName( 'YarnQty' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
if FieldByName( 'CycleYarnQty' ) . Value = null then
begin
ZGS : = 0 ; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end
else
begin
ZGS : = FieldByName( 'CycleYarnQty' ) . Value; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
2025-07-07 14:45:30 +08:00
if FieldByName( 'SH' ) . Value = null then
begin
sunhao : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
sunhao : = FieldByName( 'SH' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
2025-03-11 15:26:40 +08:00
MF : = strtofloatdef( C_ReedWidth. text , 0 ) ; //<2F> ط<EFBFBD>
if FieldByName( 'TestDenier' ) . Value = null then
begin
DS : = 0 ; //D<> <44>
end
else
begin
DS : = FieldByName( 'TestDenier' ) . Value; //D<> <44>
end ;
WM : = strtofloatdef( C_FinishLatitudeDensity. text , 0 ) ; //γ <> <CEB3>
end ;
if ZGS < > 0 then
begin
with CDS_2 do
begin
Edit;
2025-07-07 14:45:30 +08:00
FieldByName( 'MeterQty' ) . Value : = roundfloat( GS / ZGS * ( MF + sunhao) * DS * WM / 9 0 0 0 , 2 ) ;
2025-03-11 15:26:40 +08:00
Post;
end ;
end ;
JSKZ( ) ;
end ;
procedure TfrmTatGYInPut. cxGridDBColumn1PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmYarnInfoSel : = TfrmYarnInfoSel. Create( Application) ;
with frmYarnInfoSel do
begin
if ShowModal = 1 then
begin
with self. CDS_2 do
begin
Edit;
FieldByName( 'Brand' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'Brand' ) . Value;
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( 'Denier' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'Denier' ) . Value;
Post;
end ;
end ;
end ;
finally
frmYarnInfoSel. Free;
end ;
end ;
procedure TfrmTatGYInPut. cxGridDBColumn3PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmYarnInfoSel : = TfrmYarnInfoSel. Create( Application) ;
with frmYarnInfoSel do
begin
if ShowModal = 1 then
begin
with self. CDS_1 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 ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
end ;
finally
frmYarnInfoSel. Free;
end ;
end ;
procedure TfrmTatGYInPut. JSJS( ) ;
var
GS, ZGS, MF, DS, WM, TW: double ;
begin
if CDS_1. IsEmpty then
exit;
with CDS_1 do
begin
DisableControls;
first;
while not eof do
begin
with CDS_1 do
begin
if FieldByName( 'YarnQty' ) . Value = null then
begin
GS : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
GS : = FieldByName( 'YarnQty' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
if FieldByName( 'CycleYarnQty' ) . Value = null then
begin
ZGS : = 0 ; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end
else
begin
ZGS : = FieldByName( 'CycleYarnQty' ) . Value; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
MF : = strtofloatdef( C_ReedWidth. text , 0 ) ; //<2F> ط<EFBFBD>
TW : = strtofloatdef( C_YarnQty. text , 0 ) ; //ͷ<> <CDB7>
if FieldByName( 'TestDenier' ) . Value = null then
begin
DS : = 0 ; //D<> <44>
end
else
begin
DS : = FieldByName( 'TestDenier' ) . Value; //D<> <44>
end ;
WM : = strtofloatdef( C_FinishLatitudeDensity. text , 0 ) ; //γ <> <CEB3>
end ;
if ZGS < > 0 then
begin
with CDS_1 do
begin
Edit;
FieldByName( 'MeterQty' ) . Value : = roundfloat( GS / ZGS * TW * DS / 9 0 0 0 , 2 ) ;
Post;
end ;
end ;
next;
end ;
First;
EnableControls;
end ;
end ;
procedure TfrmTatGYInPut. JSWS( ) ;
var
GS, ZGS, MF, DS, WM: double ;
begin
if CDS_2. IsEmpty then
exit;
with CDS_2 do
begin
DisableControls;
first;
while not eof do
begin
with CDS_2 do
begin
if FieldByName( 'YarnQty' ) . Value = null then
begin
GS : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
GS : = FieldByName( 'YarnQty' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
if FieldByName( 'CycleYarnQty' ) . Value = null then
begin
ZGS : = 0 ; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end
else
begin
ZGS : = FieldByName( 'CycleYarnQty' ) . Value; //ѭ<> <D1AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
2025-05-28 09:28:35 +08:00
MF : = strtofloatdef( C_ReedWidth. text , 0 ) ; //<2F> ط<EFBFBD>
2025-03-11 15:26:40 +08:00
if FieldByName( 'TestDenier' ) . Value = null then
begin
DS : = 0 ; //D<> <44>
end
else
begin
DS : = FieldByName( 'TestDenier' ) . Value; //D<> <44>
end ;
WM : = strtofloatdef( C_FinishLatitudeDensity. text , 0 ) ; //γ <> <CEB3>
end ;
if ZGS < > 0 then
begin
with CDS_2 do
begin
Edit;
FieldByName( 'MeterQty' ) . Value : = roundfloat( GS / ZGS * MF * DS * WM / 9 0 0 0 , 2 ) ;
Post;
end ;
end ;
next;
end ;
First;
EnableControls;
end ;
end ;
2025-07-05 09:59:21 +08:00
//procedure TfrmTatGYInPut.JSKZ();
//var
// SumJS, SumWS: double;
//begin
// ToolBar1.SetFocus;
//
// if Tv1.DataController.Summary.FooterSummaryValues[0] <> null then
// begin
// SumJS := Tv1.DataController.Summary.FooterSummaryValues[0];
// end
// else
// begin
// SumJS := 0;
// end;
//
// if Tv2.DataController.Summary.FooterSummaryValues[0] <> null then
// begin
// SumWS := Tv2.DataController.Summary.FooterSummaryValues[0];
// end
// else
// begin
// SumWS := 0;
// end;
//
// C_GramWeight.text := floattostr(roundfloat((SumJS + SumWS) / 3, 2));
//end;
2025-03-11 15:26:40 +08:00
procedure TfrmTatGYInPut. JSKZ( ) ;
var
2025-07-05 09:59:21 +08:00
SumJS, SumWS, ReedWidthValue: Double ;
ErrCode: Integer ;
ReedWidthStr: string ;
IsInch: Boolean ;
2025-03-11 15:26:40 +08:00
begin
2025-07-05 16:25:58 +08:00
if Tv1. DataController. Summary. FooterSummaryValues[ 0 ] < > NULL then
begin
SumJS : = IfThen( VarIsNull( Tv1. DataController. Summary. FooterSummaryValues[ 0 ] ) , 0 , Tv1. DataController. Summary. FooterSummaryValues[ 0 ] ) ;
end ;
if Tv2. DataController. Summary. FooterSummaryValues[ 0 ] < > NULL then
begin
SumWS : = IfThen( VarIsNull( Tv2. DataController. Summary. FooterSummaryValues[ 0 ] ) , 0 , Tv2. DataController. Summary. FooterSummaryValues[ 0 ] ) ;
end ;
2025-07-05 09:59:21 +08:00
2025-07-05 16:25:58 +08:00
// SumWS := IfThen(VarIsNull(Tv2.DataController.Summary.FooterSummaryValues[0]), 0, Tv2.DataController.Summary.FooterSummaryValues[0]);
2025-07-05 09:59:21 +08:00
ReedWidthStr : = Trim( C_ReedWidth. Text ) ;
IsInch : = ContainsText( ReedWidthStr, '"' ) ;
ReedWidthStr : = StringReplace( ReedWidthStr, 'CM' , '' , [ rfReplaceAll, rfIgnoreCase] ) ;
ReedWidthStr : = StringReplace( ReedWidthStr, '"' , '' , [ rfReplaceAll, rfIgnoreCase] ) ;
ReedWidthStr : = Trim( ReedWidthStr) ;
Val( ReedWidthStr, ReedWidthValue, ErrCode) ;
if ( ErrCode = 0 ) and ( ReedWidthValue > 0 ) then
2025-03-11 15:26:40 +08:00
begin
2025-07-05 09:59:21 +08:00
if IsInch then
2025-07-05 16:25:58 +08:00
begin
C_GramWeight. Text : = FloatToStr( roundfloat( ( ( SumJS + SumWS) / ReedWidthValue * 2.54 * 1 0 0 ) , 0 ) ) ;
end
else
begin
C_GramWeight. Text : = FloatToStr( roundfloat( ( ( SumJS + SumWS) / ReedWidthValue * 1 0 0 ) , 0 ) ) ;
end ;
2025-03-11 15:26:40 +08:00
end
else
2025-07-05 09:59:21 +08:00
C_GramWeight. Text : = '0.00' ;
2025-03-11 15:26:40 +08:00
end ;
procedure TfrmTatGYInPut. cxGridDBColumn4PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmYarnInfoSel : = TfrmYarnInfoSel. Create( Application) ;
with frmYarnInfoSel do
begin
if ShowModal = 1 then
begin
with self. CDS_1 do
begin
Append;
FieldByName( 'Brand' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'Brand' ) . Value;
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( 'Denier' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'Denier' ) . Value;
Post;
end ;
end ;
end ;
finally
frmYarnInfoSel. Free;
end ;
end ;
procedure TfrmTatGYInPut. v2Column10PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmYarnInfoSel : = TfrmYarnInfoSel. Create( Application) ;
with frmYarnInfoSel do
begin
if ShowModal = 1 then
begin
with self. CDS_2 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 ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
end ;
finally
frmYarnInfoSel. Free;
end ;
end ;
procedure TfrmTatGYInPut. v2Column11PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmCompanySel : = TfrmCompanySel. Create( Application) ;
with frmCompanySel do
begin
if ShowModal = 1 then
begin
with Self. CDS_1 do
begin
Edit;
FieldByName( 'GYSName' ) . Value : = Trim( CDS_1. fieldbyname( 'CoName' ) . AsString) ;
end ;
end ;
end ;
finally
frmCompanySel. Free;
end ;
end ;
2025-03-12 16:13:21 +08:00
procedure TfrmTatGYInPut. 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 : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_Code' ) . AsString) ;
Self. WB_Name. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_Name' ) . AsString) ;
Self. C_YarnQty. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_YarnQty' ) . AsString) ;
Self. C_ReedNo. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_ReedNo' ) . AsString) ;
Self. C_ReedWidth. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_Width' ) . AsString) ;
Self. Y_Note_PLJ. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_YarnArrNote' ) . AsString) ;
with ADOQuery1 do
begin
Close;
sql. Clear;
sql. Add( ' select * from Tat_WB_Formula ' ) ;
sql. Add( ' where WBSID=' '' + Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WBSID' ) . AsString) + '' '' ) ;
sql. Add( ' Order by RowNo ' ) ;
Open;
end ;
self. CDS_1. EmptyDataSet;
self. ADOQuery1. First;
while not ADOQuery1. eof do
begin
with self. CDS_1 do
begin
APpend;
FieldByName( 'RowNo' ) . Value : = ADOQuery1. fieldbyname( 'RowNo' ) . Value;
FieldByName( 'Y_Code' ) . Value : = ADOQuery1. fieldbyname( 'Y_Code' ) . Value;
FieldByName( 'Y_Name' ) . Value : = ADOQuery1. fieldbyname( 'Y_Name' ) . Value;
FieldByName( 'Y_Color' ) . Value : = ADOQuery1. fieldbyname( 'Y_Color' ) . Value;
FieldByName( 'Y_Spec' ) . Value : = ADOQuery1. fieldbyname( 'Y_Spec' ) . Value;
FieldByName( 'YarnQty' ) . Value : = ADOQuery1. fieldbyname( 'YarnQty' ) . Value;
FieldByName( 'CycleYarnQty' ) . Value : = ADOQuery1. fieldbyname( 'CycleYarnQty' ) . Value;
FieldByName( 'TestDenier' ) . Value : = ADOQuery1. fieldbyname( 'Denier' ) . Value;
FieldByName( 'FF' ) . Value : = ADOQuery1. fieldbyname( 'FF' ) . Value;
FieldByName( 'ND' ) . Value : = ADOQuery1. fieldbyname( 'ND' ) . Value;
Post;
end ;
ADOQuery1. next;
end ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
end ;
finally
frmWBSpecSel. Free;
end ;
end ;
2025-03-11 15:26:40 +08:00
procedure TfrmTatGYInPut. OrdPieceLenChange( Sender: TObject) ;
var
FOrdQty, FOrdPieceLen: Double ;
begin
FOrdQty : = StrToFloatDef( OrdQty. Text , 0 ) ;
FOrdPieceLen : = StrToFloatDef( OrdPieceLen. Text , 0 ) ;
if FOrdPieceLen > 0 then
OrdPiece. Text : = IntToStr( Ceil( FOrdQty / FOrdPieceLen) ) ;
end ;
procedure TfrmTatGYInPut. OrdPiecePropertiesEditValueChanged( Sender: TObject) ;
begin
OrdQty. text : = floattostr( strtofloatdef( OrdPiece. text , 0 ) * strtofloatdef( OrdPieceLen. text , 0 ) ) ;
end ;
procedure TfrmTatGYInPut. OurCoNameDblClick( Sender: TObject) ;
begin
TcxButtonEdit( Sender) . Properties. LookupItems. Text : = '' ;
TcxButtonEdit( Sender) . Text : = '' ;
end ;
procedure TfrmTatGYInPut. OurCoNamePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmCompanySel : = TfrmCompanySel. Create( Application) ;
with frmCompanySel do
begin
FCoType : = '<27> <> ˾' ;
if ShowModal = 1 then
begin
OurCoName. Properties. LookupItems. Text : = Trim( CDS_1. fieldbyname( 'CoCode' ) . AsString) ;
OurCoName. Text : = Trim( CDS_1. fieldbyname( 'CoAbbrName' ) . AsString) ;
FtyCoName. Properties. LookupItems. Text : = Trim( CDS_1. fieldbyname( 'CoCode' ) . AsString) ;
FtyCoName. Text : = Trim( CDS_1. fieldbyname( 'CoAbbrName' ) . AsString) ;
end ;
end ;
finally
frmCompanySel. Free;
end ;
end ;
procedure TfrmTatGYInPut. OrdPieceChange( Sender: TObject) ;
var
FOrdQty, FOrdPieceLen, FOrdPiece: Double ;
begin
FOrdPieceLen : = StrToFloatDef( OrdPieceLen. Text , 0 ) ;
FOrdPiece : = StrToFloatDef( OrdPiece. Text , 0 ) ;
if FOrdPiece > 0 then
OrdQty. Text : = FloatToStr( FOrdPieceLen * FOrdPiece)
else
OrdQty. Text : = '0' ;
end ;
procedure TfrmTatGYInPut. C_CodeKeyPress( Sender: TObject; var Key: Char ) ;
begin
if Key = #13 then
begin
Key : = #0 ;
SelectNext( ActiveControl as TWinControl, True , True ) ;
end ;
end ;
procedure TfrmTatGYInPut. C_CodePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmTatClothInfoSel : = TfrmTatClothInfoSel. Create( Application) ;
with frmTatClothInfoSel do
begin
if ShowModal = 1 then
begin
InitClothYarn( frmTatClothInfoSel. CDS_1. fieldbyname( 'C_Code' ) . AsString) ;
Initexcel( ) ;
end ;
end ;
finally
frmTatClothInfoSel. Free;
end ;
end ;
procedure TfrmTatGYInPut. C_YarnQtyPropertiesEditValueChanged( Sender: TObject) ;
begin
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
procedure TfrmTatGYInPut. Edit1KeyPress( Sender: TObject; var Key: Char ) ;
var
i, j: Integer ;
begin
// if Key = #13 then
// begin
//
// if Edit1.Text <> '' then
// begin
// i := CDS_QZ.RecordCount;
// i := i + 1;
// with CDS_QZ do
// begin
// Append;
// FieldByName('SSEL').Value := FALSE;
// FieldByName('XuNO').Value := i;
// FieldByName('DZZQZGL').Value := Trim(Edit1.Text);
// Post;
// end;
// Edit1.Text := '';
// end;
//
// end;
end ;
procedure TfrmTatGYInPut. MCTypeBtnUpClick( Sender: TObject) ;
var
fsj: string ;
FWZ: Integer ;
begin
fsj : = Trim( TBtnEditC( 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
TBtnEditC( Sender) . Text : = Trim( ClientDataSet1. fieldbyname( 'ZDYName' ) . AsString) ;
end ;
end ;
finally
frmZDYHelp. Free;
end ;
end ;
procedure TfrmTatGYInPut. ConNoKeyPress( Sender: TObject; var Key: Char ) ;
begin
if Key = #13 then
begin
Key : = #0 ;
SelectNext( ActiveControl as TWinControl, True , True ) ;
end ;
end ;
procedure TfrmTatGYInPut. ConNoPropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
var
FConMainId, FMPRTCode: string ;
begin
try
frmTradeSalesContractSel : = TfrmTradeSalesContractSel. Create( Application) ;
with frmTradeSalesContractSel do
begin
fconNo : = self. ConNo. Text ;
fC_Code : = self. C_Code. Text ;
FLX : = '<27> <> ֯<EFBFBD> <D6AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
if ShowModal = 1 then
begin
self. CustName. Properties. LookupItems. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'BuyNo' ) . AsString) ;
self. CustName. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'BuyName' ) . AsString) ;
self. OurCoName. Properties. LookupItems. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'Sellno' ) . AsString) ;
self. OurCoName. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'Sellname' ) . AsString) ;
self. FtyCoName. Properties. LookupItems. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'Sellno' ) . AsString) ;
self. FtyCoName. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'Sellname' ) . AsString) ;
self. ConNo. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'ConNo' ) . AsString) ;
self. ConMId. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'ConMId' ) . AsString) ;
self. ConSId. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'ConSId' ) . AsString) ;
self. Saleser. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'Saleser' ) . AsString) ;
self. C_Code. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'C_Code' ) . AsString) ;
self. C_Width. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'C_Width' ) . AsString) ;
self. C_GramWeight. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'C_GramWeight' ) . AsString) ;
self. BBNO. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'BBNO' ) . AsString) ;
self. C_Color. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'C_Color' ) . AsString) ;
self. OrdQty. Text : = Trim( frmTradeSalesContractSel. CDS_1. fieldbyname( 'ConQty' ) . AsString) ;
InitClothYarn( frmTradeSalesContractSel. CDS_1. fieldbyname( 'C_Code' ) . AsString) ;
Initexcel( ) ;
end ;
end ;
finally
frmTradeSalesContractSel. Free;
end ;
end ;
procedure TfrmTatGYInPut. CustNamePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmCompanySel : = TfrmCompanySel. Create( Application) ;
with frmCompanySel do
begin
FCoType : = '<27> ͻ<EFBFBD> ' ;
if ShowModal = 1 then
begin
CustName. Properties. LookupItems. Text : = Trim( CDS_1. fieldbyname( 'CoCode' ) . AsString) ;
CustName. Text : = Trim( CDS_1. fieldbyname( 'CoAbbrName' ) . AsString) ;
end ;
end ;
finally
frmCompanySel. Free;
end ;
end ;
end .