2025-03-01 10:55:52 +08:00
unit U_TatClothInfoInput;
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, U_BaseList,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxDateRanges,
dxBarBuiltInMenu, cxPC, System. ImageList, Vcl. ImgList, U_BaseInput,
dxScrollbarAnnotations, cxContainer, cxMemo, cxMaskEdit, dxCore, dxCoreClasses,
dxHashUtils, dxSpreadSheetCore, dxSpreadSheetCoreFormulas,
dxSpreadSheetCoreHistory, dxSpreadSheetCoreStyles, dxSpreadSheetCoreStrs,
dxSpreadSheetConditionalFormatting, dxSpreadSheetConditionalFormattingRules,
dxSpreadSheetClasses, dxSpreadSheetContainers, dxSpreadSheetFormulas,
dxSpreadSheetHyperlinks, dxSpreadSheetFunctions, dxSpreadSheetStyles,
dxSpreadSheetGraphics, dxSpreadSheetPrinting, dxSpreadSheetTypes,
dxSpreadSheetUtils, dxSpreadSheetFormattedTextUtils, dxSpreadSheet, cxCheckBox,
2025-08-12 13:37:49 +08:00
dxSkinsCore, dxSkinsDefaultPainters, cxImageList, dxSkinOffice2013White,
dxSkinSharpPlus, dxSkinWXI, Vcl. Menus, cxDropDownEdit, cxImage, cxDBEdit;
2025-03-01 10:55:52 +08:00
type
TfrmTatClothInfoInput = class( TfrmBaseInput)
ToolBar1: TToolBar;
ToolButton1: TToolButton;
TBClose: TToolButton;
ADOQueryCmd: TADOQuery;
ADOQueryTemp: TADOQuery;
ScrollBox1: TScrollBox;
Label1: TLabel;
Label5: TLabel;
Label3: TLabel;
ToolButton6: TToolButton;
BCIID: TEdit;
CDS_1: TClientDataSet;
DS_1: TDataSource;
CDS_2: TClientDataSet;
DS_2: TDataSource;
ADOConnection1: TADOConnection;
ImageList1: TImageList;
Label55: TLabel;
cxPageControl3: TcxPageControl;
cxTabSheet1: TcxTabSheet;
GroupBox1: TGroupBox;
Y_Note_PLJ: TMemo;
Panel1: TPanel;
cxPageControl2: TcxPageControl;
cxGrid1: TcxGrid;
TV1: TcxGridDBTableView;
cxGridDBColumn3: TcxGridDBColumn;
cxGridDBColumn4: TcxGridDBColumn;
cxGridDBColumn8: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
cxTabSheet2: TcxTabSheet;
GroupBox2: TGroupBox;
Y_Note_PLW: TMemo;
Panel2: TPanel;
cxPageControl1: TcxPageControl;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
v2Column10: TcxGridDBColumn;
cxGridDBColumn1: TcxGridDBColumn;
v2Column6: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
cxTabSheet3: TcxTabSheet;
CDS_4: TClientDataSet;
DS_4: TDataSource;
GPM_1: TcxGridPopupMenu;
GPM_2: TcxGridPopupMenu;
GPM_4: TcxGridPopupMenu;
ToolButton11: TToolButton;
ThroughHealdOrder: TcxMemo;
C_Code: TcxTextEdit;
Label2: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
C_Name: TcxTextEdit;
C_YarnQty: TcxTextEdit;
2025-08-12 13:37:49 +08:00
C_Width: TcxTextEdit;
2025-03-01 10:55:52 +08:00
C_ReedNo: TcxTextEdit;
C_GramWeight: TcxTextEdit;
C_FinishLatitudeDensity: TcxTextEdit;
TV1Column7: TcxGridDBColumn;
Tv2Column7: TcxGridDBColumn;
TV1Column1: TcxGridDBColumn;
TV1Column2: TcxGridDBColumn;
TV1Column6: TcxGridDBColumn;
TV1Column8: TcxGridDBColumn;
TV1Column10: TcxGridDBColumn;
Tv2Column1: TcxGridDBColumn;
Tv2Column2: TcxGridDBColumn;
Tv2Column6: TcxGridDBColumn;
Tv2Column8: TcxGridDBColumn;
lbl1: TLabel;
lbl2: TLabel;
WB_Code: TcxButtonEdit;
WB_Name: TcxTextEdit;
cxTabSheet4: TcxTabSheet;
cxTabSheet5: TcxTabSheet;
CKF: TMemo;
TV1Column11: TcxGridDBColumn;
Tv2Column11: TcxGridDBColumn;
Label11: TLabel;
Label12: TLabel;
C_Color: TcxTextEdit;
C_ColorNo: TcxTextEdit;
Label13: TLabel;
C_Pattern: TcxTextEdit;
Label14: TLabel;
C_StyleNo: TcxTextEdit;
Label15: TLabel;
C_Spec: TcxTextEdit;
Label17: TLabel;
C_Composition: TcxTextEdit;
Tv2Column12: TcxGridDBColumn;
TV1Column13: TcxGridDBColumn;
Tv2Column13: TcxGridDBColumn;
ADOQuery1: TADOQuery;
ADOQueryTemp2: TADOQuery;
PM_1: TPopupMenu;
N1: TMenuItem;
PM_2: TPopupMenu;
MenuItem1: TMenuItem;
2025-05-19 17:31:51 +08:00
MFDW: TcxComboBox;
Label20: TLabel;
C_FinishLongitudeDensity: TcxTextEdit;
2025-05-28 09:28:35 +08:00
LPDW: TcxComboBox;
2025-07-05 09:59:21 +08:00
TV1Column14: TcxGridDBColumn;
Tv2Column14: TcxGridDBColumn;
2025-08-12 13:37:49 +08:00
Label19: TLabel;
GKBH: TcxTextEdit;
Label22: TLabel;
C_ReedWidth: TcxTextEdit;
Label23: TLabel;
C_KCQTY: TcxTextEdit;
Label24: TLabel;
BSQTY: TcxTextEdit;
Label25: TLabel;
DCRQTY: TcxTextEdit;
Label26: TLabel;
WB_ReedNote: TcxTextEdit;
Label27: TLabel;
ZYQTY: TcxTextEdit;
Label4: TLabel;
WYAMI: TcxTextEdit;
Label16: TLabel;
DAYQTY: TcxTextEdit;
Label18: TLabel;
LBQTY: TcxTextEdit;
Panel3: TPanel;
cxDBImage1: TcxDBImage;
Panel4: TPanel;
Label21: TLabel;
ATTNAME1: TcxButtonEdit;
DS_ImgHX: TDataSource;
Qry_ImgHX: TADOQuery;
Panel5: TPanel;
Label28: TLabel;
attname2: TcxButtonEdit;
cxDBImage2: TcxDBImage;
Qry_ImgHX2: TADOQuery;
DataSource1: TDataSource;
DS_ImgHX2: TDataSource;
GKDW: TcxComboBox;
LoomType: TcxComboBox;
Label31: TLabel;
Label29: TLabel;
Label30: TLabel;
2025-09-30 17:22:36 +08:00
Label32: TLabel;
ZS: TcxTextEdit;
TV1YarnFactor: TcxGridDBColumn;
Tv2YarnFactor: TcxGridDBColumn;
Label33: TLabel;
Label34: TLabel;
2025-03-01 10:55:52 +08:00
procedure FormShow( Sender: TObject) ;
procedure TBCloseClick( Sender: TObject) ;
procedure ToolButton1Click( Sender: TObject) ;
procedure CYColorKeyPress( Sender: TObject; var Key: Char ) ;
procedure CYMFExit( Sender: TObject) ;
procedure FormCreate( Sender: TObject) ;
procedure CYJGGYBtnDnClick( Sender: TObject) ;
procedure C_WidthBtnDnClick( Sender: TObject) ;
procedure C_WidthBtnUpClick( Sender: TObject) ;
procedure ToolButton6Click( Sender: TObject) ;
procedure ToolButton7Click( Sender: TObject) ;
procedure ToolButton9Click( Sender: TObject) ;
procedure ToolButton10Click( Sender: TObject) ;
2025-08-12 13:37:49 +08:00
2025-03-01 10:55:52 +08:00
procedure ToolButton11Click( Sender: TObject) ;
procedure cxGridDBColumn3PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure v2Column10PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure cxGridDBColumn4PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure cxGridDBColumn1PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure WB_CodePropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure Tv2Column1PropertiesEditValueChanged( Sender: TObject) ;
procedure C_ReedWidthPropertiesEditValueChanged( Sender: TObject) ;
procedure TV1Column1PropertiesEditValueChanged( Sender: TObject) ;
procedure C_YarnQtyPropertiesEditValueChanged( Sender: TObject) ;
procedure N1Click( Sender: TObject) ;
procedure MenuItem1Click( Sender: TObject) ;
2025-05-19 17:31:51 +08:00
procedure MFDWPropertiesEditValueChanged( Sender: TObject) ;
procedure C_FinishLongitudeDensityPropertiesEditValueChanged( Sender: TObject) ;
procedure C_CompositionPropertiesEditValueChanged( Sender: TObject) ;
2025-08-12 13:37:49 +08:00
procedure Panel4Click( Sender: TObject) ;
procedure cxButtonEdit1PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure attname2PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
procedure TV1Column10PropertiesEditValueChanged( Sender: TObject) ;
procedure C_ReedWidthExit( Sender: TObject) ;
2025-03-01 10:55:52 +08:00
private
canshu1: string ;
Fint: Integer ;
procedure InitGrid( ) ;
2025-08-12 13:37:49 +08:00
procedure InitImage( ) ;
2025-03-01 10:55:52 +08:00
procedure JSJS( ) ; //<2F> <> <EFBFBD> 㾭˿
procedure JSWS( ) ; //<2F> <> <EFBFBD> <EFBFBD> γ ˿
procedure JSKZ( ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
function SaveData( ) : Boolean ;
{ Private declarations }
public
2025-03-26 14:10:41 +08:00
FBCIID, FCTID, JSGG, WSGG, FC_Spec: string ;
2025-03-01 10:55:52 +08:00
CopyInt: Integer ;
{ Public declarations }
end ;
var
frmTatClothInfoInput: TfrmTatClothInfoInput;
implementation
uses
U_DataLink, U_HttpFun, U_RTFun, U_iniParam, U_ZDYHelp, U_AttachmentUpload,
2025-09-30 17:22:36 +08:00
U_YarnInfoSel, U_WBSpecSel, U_PictureUpload, U_LogInput;
2025-03-01 10:55:52 +08:00
{$R *.dfm}
2025-08-12 13:37:49 +08:00
procedure TfrmTatClothInfoInput. InitImage( ) ;
begin
if attname1. Text < > '' then
begin
with Qry_ImgHX do
begin
close;
sql. Clear;
sql. Add( 'select * from TP_File A' ) ;
sql. Add( 'where isnull(WBID,' '' ')<>' '' ' and wbid=' + quotedstr( Trim( attname1. Text ) ) ) ;
SQL. Add( 'AND TFTYPE=' 'ZC' ' ' ) ;
// ShowMessage(SQL.Text);
open;
end ;
end ;
if attname2. Text < > '' then
begin
with Qry_ImgHX2 do
begin
close;
sql. Clear;
sql. Add( 'select * from TP_File A' ) ;
sql. Add( 'where isnull(WBID,' '' ')<>' '' ' and wbid=' + quotedstr( Trim( attname2. Text ) ) ) ;
SQL. Add( 'AND TFTYPE=' 'qC' ' ' ) ;
// ShowMessage(SQL.Text);
open;
end ;
end ;
end ;
2025-03-01 10:55:52 +08:00
procedure TfrmTatClothInfoInput. InitGrid( ) ;
var
myStream: TMemoryStream;
2025-08-12 13:37:49 +08:00
mSql: string ;
2025-03-01 10:55:52 +08:00
begin
2025-08-12 13:37:49 +08:00
mSql : = 'select distinct name=A.mctype from Bs_Machine A ' ;
SInitTcxComBoxBySql( ADOQueryTemp, LoomType, false , mSql) ;
2025-03-01 10:55:52 +08:00
myStream : = TMemoryStream. Create( ) ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.* from BS_Cloth_Yarn A ' ) ;
sql. Add( ' where YRType=' '<27> <> ˿' ' and A.BCIID=' '' + Trim( FBCIID) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_1) ;
SInitCDSData( ADOQueryTemp, CDS_1) ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select A.* from BS_Cloth_Yarn A ' ) ;
sql. Add( ' where YRType=' 'γ˿' ' and A.BCIID=' '' + Trim( FBCIID) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_2) ;
SInitCDSData( ADOQueryTemp, CDS_2) ;
2025-03-26 14:10:41 +08:00
with ADOQueryTemp do
begin
Close;
SQL. Clear;
SQL. Add( 'select * from BS_Cloth_Info where BCIID=' '' + Trim( FBCIID) + '' '' ) ;
Open;
end ;
SCSHData( ADOQueryTemp, ScrollBox1, 2 ) ;
SCSHData( ADOQueryTemp, ScrollBox1, 0 ) ;
CKF. Text : = Trim( ADOQueryTemp. FieldByName( 'CKF' ) . AsString) ;
Y_Note_PLJ. Text : = Trim( ADOQueryTemp. FieldByName( 'Y_Note_PLJ' ) . AsString) ;
Y_Note_PLW. Text : = Trim( ADOQueryTemp. FieldByName( 'Y_Note_PLW' ) . AsString) ;
2025-08-12 13:37:49 +08:00
ATTNAME1. Text : = Trim( ADOQueryTemp. FieldByName( 'ATTNAME1' ) . AsString) ;
ATTNAME2. Text : = Trim( ADOQueryTemp. FieldByName( 'ATTNAME2' ) . AsString) ;
2025-03-01 10:55:52 +08:00
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //////////////////////////
// with ADOQueryTemp do
// begin
// close;
// sql.Clear;
// sql.Add(' select * from BS_Cloth_Info_Excel where BCIID=''' + Trim(FBCIID) + '''');
// open;
// end;
//
// if not ADOQueryTemp.IsEmpty then
// begin
//
// TBlobField(ADOQueryTemp.FieldByName('ExcelData')).SaveToStream(myStream);
// myStream.Position := 0;
// dxSpreadSheet1.LoadFromStream(myStream);
// end
// else
// begin
//
// with ADOQueryTemp2 do
// begin
// close;
// sql.Clear;
// sql.Add(' select * from BS_Cloth_Info_Excel2 ');
// open;
// end;
// TBlobField(ADOQueryTemp2.FieldByName('ExcelData')).SaveToStream(myStream);
// myStream.Position := 0;
// dxSpreadSheet1.LoadFromStream(myStream);
// end;
if FBCIID = '' 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;
2025-08-23 14:29:45 +08:00
2025-03-01 10:55:52 +08:00
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;
2025-08-23 14:29:45 +08:00
2025-03-01 10:55:52 +08:00
end ;
myStream. Free;
end ;
/////////////////ˢ<> <CBA2> <EFBFBD> <EFBFBD> <EFBFBD> ۹<EFBFBD> <DBB9> յ<EFBFBD> <D5B5> <EFBFBD> Ϣ/////////////////////////
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select * from BS_CLoth_QZ where BCIID=' '' + Trim( FBCIID) + '' '' ) ;
Open;
end ;
SCreateCDS( ADOQueryTemp, CDS_4) ;
SInitCDSData( ADOQueryTemp, CDS_4) ;
2025-08-12 13:37:49 +08:00
2025-03-01 10:55:52 +08:00
/////////////////ˢ<> <CBA2> <EFBFBD> <EFBFBD> <EFBFBD> ۹<EFBFBD> <DBB9> յ<EFBFBD> <D5B5> <EFBFBD> Ϣ/////////////////////////
///
end ;
procedure TfrmTatClothInfoInput. JSJS( ) ;
var
GS, ZGS, MF, DS, WM, TW: double ;
begin
2025-03-11 15:26:40 +08:00
// 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 / 9000, 2);
// Post;
// end;
// end;
// next;
// end;
// First;
// EnableControls;
// end;
2025-03-26 14:10:41 +08:00
JSGG : = '' ;
with CDS_1 do
begin
first;
while not eof do
begin
if Trim( CDS_1. fieldbyname( 'Y_Name' ) . AsString) < > '' then
begin
if POS( Trim( CDS_1. fieldbyname( 'Y_Name' ) . AsString) , JSGG) = 0 then
begin
JSGG : = JSGG + Trim( CDS_1. fieldbyname( 'Y_Name' ) . AsString) + '+' ;
end ;
end ;
next;
end ;
First;
end ;
JSGG : = Copy( JSGG, 1 , Length( JSGG) - 1 ) ;
2025-03-01 10:55:52 +08:00
end ;
procedure TfrmTatClothInfoInput. JSWS( ) ;
var
GS, ZGS, MF, DS, WM: double ;
begin
2025-03-11 15:26:40 +08:00
// 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;
//
// MF := strtofloatdef(C_ReedWidth.text, 0) + 15; //<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;
// FieldByName('MeterQty').Value := roundfloat(GS / ZGS * MF * DS * WM / 9000, 2);
// Post;
// end;
// end;
// next;
// end;
// First;
// EnableControls;
// end;
2025-03-26 14:10:41 +08:00
WSGG : = '' ;
with CDS_2 do
begin
first;
while not eof do
begin
if Trim( CDS_2. fieldbyname( 'Y_Name' ) . AsString) < > '' then
begin
if POS( Trim( CDS_2. fieldbyname( 'Y_Name' ) . AsString) , WSGG) = 0 then
begin
WSGG : = WSGG + Trim( CDS_2. fieldbyname( 'Y_Name' ) . AsString) + '+' ;
end ;
end ;
next;
end ;
First;
end ;
WSGG : = Copy( WSGG, 1 , Length( WSGG) - 1 ) ;
2025-03-01 10:55:52 +08:00
end ;
procedure TfrmTatClothInfoInput. MenuItem1Click( Sender: TObject) ;
begin
with CDS_2 do
begin
CDS_2. edit;
FieldByName( 'Y_Code' ) . Value : = null;
FieldByName( 'Y_Name' ) . Value : = null;
FieldByName( 'Y_Spec' ) . Value : = null;
FieldByName( 'Y_Color' ) . Value : = null;
FieldByName( 'YarnQty' ) . Value : = null;
FieldByName( 'CycleYarnQty' ) . Value : = null;
FieldByName( 'FF' ) . Value : = null;
FieldByName( 'ND' ) . Value : = null;
FieldByName( 'Dacron' ) . Value : = null;
FieldByName( 'Cotton' ) . Value : = null;
FieldByName( 'Linen' ) . Value : = null;
FieldByName( 'Brand' ) . Value : = null;
FieldByName( 'TestDenier' ) . Value : = null;
FieldByName( 'Y_Composition' ) . Value : = null;
FieldByName( 'MeterQty' ) . Value : = null;
FieldByName( 'PTNo' ) . Value : = null;
Post;
end ;
end ;
2025-05-19 17:31:51 +08:00
procedure TfrmTatClothInfoInput. MFDWPropertiesEditValueChanged( Sender: TObject) ;
begin
JSKZ( ) ;
end ;
2025-03-01 10:55:52 +08:00
procedure TfrmTatClothInfoInput. N1Click( Sender: TObject) ;
begin
with CDS_1 do
begin
CDS_1. edit;
FieldByName( 'Y_Code' ) . Value : = null;
FieldByName( 'Y_Name' ) . Value : = null;
FieldByName( 'Y_Spec' ) . Value : = null;
FieldByName( 'Y_Color' ) . Value : = null;
FieldByName( 'YarnQty' ) . Value : = null;
FieldByName( 'CycleYarnQty' ) . Value : = null;
FieldByName( 'FF' ) . Value : = null;
FieldByName( 'ND' ) . Value : = null;
FieldByName( 'Dacron' ) . Value : = null;
FieldByName( 'Cotton' ) . Value : = null;
FieldByName( 'Linen' ) . Value : = null;
FieldByName( 'Brand' ) . Value : = null;
FieldByName( 'TestDenier' ) . Value : = null;
FieldByName( 'Y_Composition' ) . Value : = null;
FieldByName( 'MeterQty' ) . Value : = null;
FieldByName( 'PTNo' ) . Value : = null;
Post;
end ;
end ;
2025-08-12 13:37:49 +08:00
procedure TfrmTatClothInfoInput. Panel4Click( Sender: TObject) ;
begin
try
frmPictureUpload : = TfrmPictureUpload. create( self) ;
with frmPictureUpload do
begin
fFlileFlag : = UserDataFlag + 'HX' ;
FDataId : = ATTNAME1. Text ;
FPictureName : = ATTNAME1. Text ;
FWidth : = 4 5 0 ;
FHeight : = 6 0 0 ;
FTFType : = 'ZC' ;
if showmodal = 1 then
begin
ATTNAME1. Text : = frmPictureUpload. FPictureName;
end ;
end ;
finally
frmPictureUpload. free;
end ;
initimage( ) ;
end ;
2025-03-01 10:55:52 +08:00
procedure TfrmTatClothInfoInput. JSKZ( ) ;
var
SumJS, SumWS: double ;
2025-05-19 17:31:51 +08:00
FJinSha, FWeiSha: string ;
2025-03-01 10:55:52 +08:00
begin
2025-03-11 15:26:40 +08:00
// C_GramWeight.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));
2025-03-26 14:10:41 +08:00
/////////////<2F> <> <EFBFBD> ɹ<EFBFBD> <C9B9> <EFBFBD> /////////////
2025-08-12 13:37:49 +08:00
2025-03-26 14:10:41 +08:00
FC_Spec : = '' ;
2025-09-30 17:22:36 +08:00
FC_Spec : = C_Composition. text + ' (' + JSGG + ')*(' + WSGG + ') ' + C_FinishLongitudeDensity. text + '*' + C_FinishLatitudeDensity. text + ' ' + C_Width. text + MFDW. text ;
2025-03-26 14:10:41 +08:00
C_Spec. text : = trim( FC_Spec) ;
/////////////<2F> <> <EFBFBD> ɹ<EFBFBD> <C9B9> <EFBFBD> /////////////
2025-03-01 10:55:52 +08:00
end ;
procedure TfrmTatClothInfoInput. FormShow( Sender: TObject) ;
begin
readCxGrid( self. Caption + 'TV11' , Tv1, '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ' ) ;
readCxGrid( self. Caption + 'TV22' , Tv2, '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ' ) ;
// readCxGrid(self.Caption + 'TV44', Tv4, '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ');
InitGrid( ) ;
2025-03-26 14:10:41 +08:00
JSJS( ) ;
JSWS( ) ;
2025-03-01 10:55:52 +08:00
JSKZ( ) ;
if CopyInt = 1 then
begin
FBCIID : = '' ;
BCIID. text : = '' ;
C_Code. text : = '' ;
2025-08-12 13:37:49 +08:00
ATTNAME1. Text : = '' ;
ATTNAME2. Text : = '' ;
2025-03-01 10:55:52 +08:00
with CDS_1 do
begin
First;
while not Eof do
begin
Edit;
FieldByName( 'BCIID' ) . Value : = '' ;
FieldByName( 'YRId' ) . Value : = '' ;
Post;
Next;
end ;
end ;
with CDS_2 do
begin
First;
while not Eof do
begin
Edit;
FieldByName( 'BCIID' ) . Value : = '' ;
FieldByName( 'YRId' ) . Value : = '' ;
Post;
Next;
end ;
end ;
end ;
2025-08-12 13:37:49 +08:00
InitImage( ) ;
2025-03-01 10:55:52 +08:00
end ;
procedure TfrmTatClothInfoInput. TBCloseClick( Sender: TObject) ;
begin
Close;
end ;
function TfrmTatClothInfoInput. SaveData( ) : Boolean ;
var
maxId, maxpbno, maxQZID, HZYRId, JsonStr: string ;
myStream: TADOBlobStream;
myStream1: TMemoryStream;
begin
try
ADOQueryCmd. Connection. BeginTrans;
2025-09-30 17:22:36 +08:00
try
if FBCIID < > '' then
begin
frmLogInput : = TfrmLogInput. Create( Application) ;
with frmLogInput do
begin
fC_Code : = Self. C_Code. Text ;
if ShowModal = 1 then
begin
end ;
end ;
end ;
finally
frmLogInput. Free;
end ;
2025-03-01 10:55:52 +08:00
if Trim( FBCIID) = '' then
begin
if GetLSNo( ADOQueryCmd, maxId, 'Y' , 'BS_Cloth_Info' , 4 , 1 ) = False then
begin
Result : = False ;
ADOQueryCmd. Connection. RollbackTrans;
Application. MessageBox( 'ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
BCIID. Text : = trim( maxId) ;
end
else
begin
maxId : = Trim( FBCIID) ;
end ;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from BS_Cloth_Info where BCIID=' '' + Trim( FBCIID) + '' '' ) ;
Open;
end ;
with ADOQueryCmd do
begin
if Trim( FBCIID) = '' then
begin
Append;
FieldByName( 'CTID' ) . Value : = Trim( FCTID) ;
FieldByName( 'FILLID' ) . Value : = Trim( DCode) ;
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( 'BCIID' ) . Value : = Trim( maxId) ;
FieldByName( 'CKF' ) . Value : = Trim( CKF. text ) ;
FieldByName( 'Y_Note_PLJ' ) . Value : = Trim( Y_Note_PLJ. text ) ;
FieldByName( 'Y_Note_PLW' ) . Value : = Trim( Y_Note_PLW. text ) ;
2025-08-12 13:37:49 +08:00
FieldByName( 'ATTNAME1' ) . Value : = Trim( ATTNAME1. text ) ;
FieldByName( 'ATTNAME2' ) . Value : = Trim( ATTNAME2. text ) ;
2025-03-01 10:55:52 +08:00
if trim( C_Code. Text ) = '' then
C_Code. Text : = Trim( maxId) ;
RTSetsavedata( ADOQueryCmd, 'BS_Cloth_Info' , ScrollBox1, 2 ) ;
Post;
end ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'select count(*) as AA from BS_Cloth_Info where C_Code=' '' + Trim( C_Code. Text ) + '' '' ) ;
Open;
if FieldByName( 'AA' ) . AsInteger > 1 then
begin
ADOQueryCmd. Connection. RollbackTrans;
Result : = False ;
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ظ<EFBFBD> <D8B8> <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
end ;
////////////////////////// <20> <> <EFBFBD> 澭˿<E6BEAD> <CBBF> <EFBFBD> ȱ<EFBFBD> //////////////////////////
with CDS_1 do
begin
First;
HZYRId : = '' ;
while not Eof do
begin
if Trim( CDS_1. fieldbyname( 'YRId' ) . AsString) = '' then
begin
if GetLSNo( ADOQueryTemp, maxpbno, 'RJ' , 'BS_Cloth_Yarn' , 4 , 1 ) = False then
begin
ADOQueryCmd. Connection. RollbackTrans;
Application. MessageBox( 'ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˮ<EFBFBD> <CBAE> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
end
else
begin
maxpbno : = Trim( CDS_1. fieldbyname( 'YRId' ) . AsString) ;
end ;
HZYRId : = HZYRId + ';' + maxpbno;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from BS_Cloth_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( 'BCIID' ) . Value : = Trim( maxId) ;
FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
2025-08-21 14:57:32 +08:00
RTSetSaveDataCDS( ADOQueryCmd, Tv1, CDS_1, 'BS_Cloth_Yarn' , 0 ) ;
2025-03-01 10:55:52 +08:00
Post;
end ;
CDS_1. Edit;
CDS_1. FieldByName( 'BCIID' ) . Value : = Trim( maxId) ;
CDS_1. FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
Next;
end ;
end ;
with ADOQueryTemp do
begin
Close;
sql. Clear;
sql. Add( 'update BS_Cloth_Yarn set BCIID = rtrim(BCIID) + ' 'ɾ' ' where YRType =' '<27> <> ˿' ' and BCIID=' '' + Trim( maxId) + '' '' ) ;
sql. Add( 'and YRId not in (select RTValue from [dbo].[F_Tool_SplitString](' '' + Trim( HZYRId) + '' '' ) ;
sql. Add( ', ' ';' ' ))' ) ;
ExecSQL;
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' , 'BS_Cloth_Yarn' , 4 , 1 ) = False then
begin
ADOQueryCmd. Connection. RollbackTrans;
Application. MessageBox( 'ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˮ<EFBFBD> <CBAE> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
end
else
begin
maxpbno : = Trim( CDS_2. fieldbyname( 'YRId' ) . AsString) ;
end ;
with ADOQueryCmd do
begin
Close;
SQL. Clear;
sql. Add( 'select * from BS_Cloth_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( 'BCIID' ) . Value : = Trim( maxId) ;
FieldByName( 'YRId' ) . Value : = Trim( maxpbno) ;
RTSetSaveDataCDS( ADOQueryCmd, Tv2, CDS_2, 'BS_Cloth_Yarn' , 0 ) ;
Post;
end ;
CDS_2. Edit;
CDS_2. FieldByName( 'BCIID' ) . Value : = Trim( maxId) ;
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_4 do
// begin
// First;
// while not Eof do
// begin
// if Trim(CDS_4.fieldbyname('QZID').AsString) = '' then
// begin
// if GetLSNo(ADOQueryTemp, maxQZID, 'QZ', 'BS_CLoth_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_4.fieldbyname('QZID').AsString);
// end;
// with ADOQueryCmd do
// begin
// Close;
// SQL.Clear;
// sql.Add('select * from BS_CLoth_QZ where ');
// sql.Add(' QZID=''' + Trim(maxQZID) + '''');
// Open;
// end;
// with ADOQueryCmd do
// begin
// if Trim(CDS_4.fieldbyname('QZID').AsString) = '' then
// begin
// Append;
// end
// else
// begin
// Edit;
// end;
// FieldByName('BCIID').Value := Trim(maxId);
// FieldByName('QZID').Value := Trim(maxQZID);
// RTSetSaveDataCDS(ADOQueryCmd, Tv4, CDS_4, 'BS_CLoth_QZ', 0);
// Post;
// end;
// CDS_4.Edit;
// CDS_4.FieldByName('BCIID').Value := Trim(maxId);
// CDS_4.FieldByName('QZID').Value := Trim(maxQZID);
//
// Next;
// end;
// end;
////////////////////////// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> //////////////////////////
// dxSpreadSheet1.SaveToFile('D:\FilesExcel.xlsx');
// with ADOQueryCmd do
// begin
// close;
// sql.Clear;
// sql.Add(' select * from BS_Cloth_Info_Excel where BCIID=''' + Trim(maxId) + '''');
// open;
// end;
// with ADOQueryCmd do
// begin
// if ADOQueryCmd.IsEmpty then
// begin
// Append;
// end
// else
// begin
// Edit;
// end;
// FieldByName('BCIID').Value := maxId;
// myStream := TADOBlobStream.Create(TBlobField(ADOQueryCmd.FieldByName('ExcelData')), bmWrite);
//
// myStream1 := TMemoryStream.Create();
// myStream1.LoadFromFile('D:\FilesExcel.xlsx');
//
// tblobfield(FieldByName('xlsx')).LoadFromStream(myStream1);
//
// dxSpreadSheet1.SaveToStream(myStream);
// myStream.Free;
// Post;
// end;
// if pos('<27> ӿ<EFBFBD> <D3BF> 쳣', JsonStr) > 0 then
// begin
// raise Exception.Create(pchar(JsonStr));
// end;
//
// if pos('ResultList', JsonStr) = 0 then
// begin
// Application.MessageBox(pchar('<27> <> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> :' + JsonGetChildObject(JsonStr, 'Info')), '<27> <> ʾ ', 0);
// end
// else
// begin
// JsonToCHDA(JsonStr, 'ResultList', CDS_2);
// end;
ADOQueryCmd. Connection. CommitTrans;
FBCIID : = maxId;
// JsonStr := RTGetRequest('http://139.224.118.114:8081/execltoimg/' + trim(maxId));
Result : = True ;
except
Result : = False ;
ADOQueryCmd. Connection. RollbackTrans;
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> !' , '<27> <> ʾ ' , 0 ) ;
end ;
end ;
procedure TfrmTatClothInfoInput. CYJGGYBtnDnClick( Sender: TObject) ;
begin
TBtnEditC( Sender) . Text : = '' ;
end ;
procedure TfrmTatClothInfoInput. ToolButton10Click( Sender: TObject) ;
begin
if CDS_4. IsEmpty then
exit;
if CDS_4. 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_4. DisableControls;
with CDS_4 do
begin
First;
while not Eof do
begin
if CDS_4. FieldByName( 'SSel' ) . AsBoolean = True then
begin
if Trim( CDS_4. fieldbyname( 'QZID' ) . AsString) < > '' then
with ADOQueryCmd do
begin
Close;
sql. Clear;
sql. Add( 'delete BS_CLoth_QZ where QZID=' '' + Trim( CDS_4. fieldbyname( 'QZID' ) . AsString) + '' '' ) ;
ExecSQL;
end ;
CDS_4. Delete;
end
else
Next;
end ;
end ;
CDS_4. EnableControls;
end ;
procedure TfrmTatClothInfoInput. ToolButton11Click( Sender: TObject) ;
begin
WriteCxGrid( self. Caption + 'TV11' , Tv1, '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ' ) ;
WriteCxGrid( self. Caption + 'TV22' , Tv2, '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ' ) ;
// WriteCxGrid(self.Caption + 'TV44', Tv4, '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ');
end ;
procedure TfrmTatClothInfoInput. ToolButton1Click( Sender: TObject) ;
var
MC_Code: string ;
begin
C_Name. SetFocus;
if C_Name. Text = '' then
begin
Application. MessageBox( '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> Ʋ<EFBFBD> <C6B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
2025-05-19 17:31:51 +08:00
if MFDW. Text = '' then
begin
Application. MessageBox( '<27> ŷ<EFBFBD> <C5B7> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
2025-08-12 13:37:49 +08:00
if C_Width. Text = '' then
begin
Application. MessageBox( '<27> ŷ<EFBFBD> <C5B7> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
2025-05-19 17:31:51 +08:00
2025-08-12 13:37:49 +08:00
if C_FinishLongitudeDensity. Text = '' then
begin
Application. MessageBox( '<27> <> <EFBFBD> ܲ<EFBFBD> <DCB2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if C_FinishLatitudeDensity. Text = '' then
begin
Application. MessageBox( 'γ <> ܲ<EFBFBD> <DCB2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if WB_Code. Text = '' then
begin
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ձ<EFBFBD> <D5B1> Ų<EFBFBD> <C5B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if WB_Name. Text = '' then
begin
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ʋ<EFBFBD> <C6B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if C_YarnQty. Text = '' then
begin
Application. MessageBox( '<27> <> ͷ<EFBFBD> Ʋ<EFBFBD> <C6B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if GKBH. Text = '' then
begin
Application. MessageBox( '<27> <> <EFBFBD> ر<EFBFBD> <D8B1> Ų<EFBFBD> <C5B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if C_ReedNo. Text = '' then
begin
Application. MessageBox( '<27> غŲ<D8BA> <C5B2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if C_ReedWidth. Text = '' then
begin
Application. MessageBox( '<27> ط<EFBFBD> <D8B7> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if DCRQTY. Text = '' then
begin
Application. MessageBox( '<27> ش<EFBFBD> <D8B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
if DAYQTY. Text = '' then
begin
Application. MessageBox( '<27> ղ<EFBFBD> <D5B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
2025-08-20 16:06:38 +08:00
if LoomType. Text = '' then
begin
Application. MessageBox( '<27> <> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
2025-03-01 10:55:52 +08:00
2025-09-30 17:22:36 +08:00
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 龭˿<E9BEAD> <CBBF> <EFBFBD> <EFBFBD> (CDS_1)
CDS_1. First;
while not CDS_1. Eof do
begin
// ֻ<> е <EFBFBD> Y_Code<64> <65> ֵʱ<D6B5> ż<EFBFBD> <C5BC> <EFBFBD> YarnFactor
if ( CDS_1. FieldByName( 'Y_Code' ) . AsString < > '' ) and ( CDS_1. FieldByName( 'Y_Code' ) . AsString < > null) then
begin
if ( CDS_1. FieldByName( 'YarnFactor' ) . AsString = '' ) or ( CDS_1. FieldByName( 'YarnFactor' ) . AsString = null) then
begin
Application. MessageBox( '<27> <> ˿ɴ<CBBF> <C9B4> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit; // ֱ<> ӽ<EFBFBD> <D3BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
end ;
CDS_1. Next;
end ;
// <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> γ ˿<CEB3> <CBBF> <EFBFBD> <EFBFBD> (CDS_2)
CDS_2. First;
while not CDS_2. Eof do
begin
// ֻ<> е <EFBFBD> Y_Code<64> <65> ֵʱ<D6B5> ż<EFBFBD> <C5BC> <EFBFBD> YarnFactor
if ( CDS_2. FieldByName( 'Y_Code' ) . AsString < > '' ) and ( CDS_2. FieldByName( 'Y_Code' ) . AsString < > null) then
begin
if ( CDS_2. FieldByName( 'YarnFactor' ) . AsString = '' ) or ( CDS_2. FieldByName( 'YarnFactor' ) . AsString = null) then
begin
Application. MessageBox( 'γ ˿ɴ<CBBF> <C9B4> ϵ<EFBFBD> <CFB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> գ <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
Exit; // ֱ<> ӽ<EFBFBD> <D3BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
end ;
CDS_2. Next;
end ;
2025-03-01 10:55:52 +08:00
if trim( C_Code. Text ) = '' then
begin
if GetLSNo( ADOQueryCmd, MC_Code, 'C' , 'BS_Cloth_Info' , 4 , 0 ) = False then
begin
Application. MessageBox( 'ȡ<> <C8A1> <EFBFBD> <EFBFBD> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ʧ<EFBFBD> <CAA7> !' , '<27> <> ʾ ' , 0 ) ;
Exit;
end ;
C_Code. Text : = MC_Code;
end ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
if SaveData( ) then
begin
Application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> <C9B9> <EFBFBD> ' , '<27> <> ʾ ' , 0 ) ;
ModalResult : = 1 ;
end ;
end ;
2025-08-12 13:37:49 +08:00
procedure TfrmTatClothInfoInput. attname2PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmPictureUpload : = TfrmPictureUpload. create( self) ;
with frmPictureUpload do
begin
fFlileFlag : = UserDataFlag + 'HX' ;
FDataId : = AttName2. Text ;
FPictureName : = AttName2. Text ;
FWidth : = 6 0 0 ;
FHeight : = 6 0 0 ;
FTFType : = 'QC' ;
if showmodal = 1 then
begin
AttName2. Text : = frmPictureUpload. FPictureName;
end ;
end ;
finally
frmPictureUpload. free;
end ;
initimage( ) ;
end ;
procedure TfrmTatClothInfoInput. cxButtonEdit1PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmPictureUpload : = TfrmPictureUpload. create( self) ;
with frmPictureUpload do
begin
fFlileFlag : = UserDataFlag + 'HX' ;
FDataId : = AttName1. Text ;
FPictureName : = AttName1. Text ;
FWidth : = 6 0 0 ;
FHeight : = 6 0 0 ;
FTFType : = 'ZC' ;
if showmodal = 1 then
begin
AttName1. Text : = frmPictureUpload. FPictureName;
end ;
end ;
finally
frmPictureUpload. free;
end ;
initimage( ) ;
end ;
2025-03-01 10:55:52 +08:00
procedure TfrmTatClothInfoInput. cxGridDBColumn1PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmZDYHelp : = TfrmZDYHelp. Create( Application) ;
with frmZDYHelp do
begin
flag : = 'Y_Name' ;
flagname : = 'ԭ<> <D4AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
if ShowModal = 1 then
begin
Self. CDS_2. Edit;
Self. CDS_2. FieldByName( 'Y_Name' ) . Value : = Trim( ClientDataSet1. fieldbyname( 'ZDYName' ) . AsString) ;
end ;
end ;
finally
frmZDYHelp. Free;
end ;
end ;
procedure TfrmTatClothInfoInput. 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;
2025-09-30 17:22:36 +08:00
FieldByName( 'YarnFactor' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'YarnFactor' ) . Value;
2025-03-01 10:55:52 +08:00
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;
2025-08-12 13:37:49 +08:00
FieldByName( 'Z_Number' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'ZS' ) . Value;
2025-03-01 10:55:52 +08:00
Post;
2025-09-30 17:22:36 +08:00
TV1Column10PropertiesEditValueChanged( Sender) ;
2025-03-01 10:55:52 +08:00
end ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
end ;
finally
frmYarnInfoSel. Free;
end ;
end ;
procedure TfrmTatClothInfoInput. cxGridDBColumn4PropertiesButtonClick( Sender: TObject; AButtonIndex: Integer ) ;
begin
try
frmZDYHelp : = TfrmZDYHelp. Create( Application) ;
with frmZDYHelp do
begin
flag : = 'Y_Name' ;
flagname : = 'ԭ<> <D4AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ' ;
if ShowModal = 1 then
begin
Self. CDS_1. Edit;
Self. CDS_1. FieldByName( 'Y_Name' ) . Value : = Trim( ClientDataSet1. fieldbyname( 'ZDYName' ) . AsString) ;
end ;
end ;
finally
frmZDYHelp. Free;
end ;
end ;
procedure TfrmTatClothInfoInput. CYColorKeyPress( Sender: TObject; var Key: Char ) ;
begin
if Key = #13 then
begin
Key : = #0 ;
SelectNext( ActiveControl as TWinControl, True , True ) ;
end ;
end ;
2025-05-19 17:31:51 +08:00
procedure TfrmTatClothInfoInput. C_CompositionPropertiesEditValueChanged( Sender: TObject) ;
begin
JSKZ( ) ;
end ;
procedure TfrmTatClothInfoInput. C_FinishLongitudeDensityPropertiesEditValueChanged( Sender: TObject) ;
begin
JSKZ( ) ;
end ;
2025-08-12 13:37:49 +08:00
procedure TfrmTatClothInfoInput. C_ReedWidthExit( Sender: TObject) ;
var
mvalue, FFieldName: string ;
GS, ZGS, MF, DS, WM, fsh: double ;
begin
with CDS_2 do
begin
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( 'Y_loss' ) . Value = null then
begin
fsh : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
fsh : = FieldByName( 'Y_loss' ) . 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>
if FieldByName( 'Z_Number' ) . Value = null then
begin
DS : = 0 ; //֧
end
else
begin
DS : = FieldByName( 'Z_Number' ) . Value; //֧<> <D6A7>
end ;
WM : = strtofloatdef( C_FinishLatitudeDensity. text , 0 ) ; //γ <> <CEB3>
end ;
if ( ZGS < > 0 ) and ( DS < > 0 ) then
begin
with CDS_2 do
begin
Edit;
FieldByName( 'MeterQty' ) . Value : = roundfloat( WM * ( MF + fsh) * 0.059 / DS * GS / ZGS * 1.08 , 2 ) ;
Post;
end ;
end ;
next;
end ;
end ;
end ;
2025-03-01 10:55:52 +08:00
procedure TfrmTatClothInfoInput. C_ReedWidthPropertiesEditValueChanged( Sender: TObject) ;
begin
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
procedure TfrmTatClothInfoInput. C_WidthBtnDnClick( Sender: TObject) ;
begin
TBtnEditC( Sender) . Text : = '' ;
TBtnEditC( Sender) . TxtCode : = '' ;
end ;
procedure TfrmTatClothInfoInput. C_WidthBtnUpClick( Sender: TObject) ;
var
fsj: string ;
FWZ: Integer ;
begin
fsj : = Trim( TEdit( 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
TEdit( Sender) . Text : = Trim( ClientDataSet1. fieldbyname( 'ZDYName' ) . AsString) ;
end ;
end ;
finally
frmZDYHelp. Free;
end ;
end ;
procedure TfrmTatClothInfoInput. C_YarnQtyPropertiesEditValueChanged( Sender: TObject) ;
begin
JSJS( ) ;
JSWS( ) ;
end ;
procedure TfrmTatClothInfoInput. CYMFExit( Sender: TObject) ;
begin
// if pos('"', trim(CYMF.Text)) = 0 then
// begin
// if pos('CM', trim(CYMF.Text)) = 0 then
// CYMF.Text := trim(CYMF.Text) + 'CM';
// end;
end ;
procedure TfrmTatClothInfoInput. FormCreate( Sender: TObject) ;
begin
inherited ;
try
with ADOConnection1 do
begin
Connected : = false ;
ConnectionString : = DConString;
Connected : = true ;
end ;
ADOQueryBaseCmd. Connection : = ADOConnection1;
ADOQueryBaseTemp. Connection : = ADOConnection1;
except
application. MessageBox( '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʧ<EFBFBD> ܣ<EFBFBD> ' , '<27> <> ʾ <EFBFBD> <CABE> Ϣ' ) ;
end ;
// LaYangDate.DateTime := SGetServerDateTime(ADOQueryTemp);
end ;
procedure TfrmTatClothInfoInput. ToolButton6Click( Sender: TObject) ;
begin
if trim( C_Code. Text ) = '' then
Exit;
try
frmAttachmentUpload : = TfrmAttachmentUpload. Create( Application) ;
with frmAttachmentUpload do
begin
FEditAuthority : = True ;
fkeyNO : = trim( C_Code. Text ) ;
fType : = '<27> <> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ' ;
if ShowModal = 1 then
begin
end ;
end ;
finally
frmAttachmentUpload. Free;
end ;
end ;
procedure TfrmTatClothInfoInput. ToolButton7Click( Sender: TObject) ;
begin
// if CDS_2.IsEmpty then
// Exit;
// if Trim(CDS_2.fieldbyname('YRId').AsString) <> '' then
// begin
// if Application.MessageBox('ȷ<> <C8B7> Ҫɾ<D2AA> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ', '<27> <> ʾ ', 32 + 4) <> IDYES then
// Exit;
// with ADOQueryCmd do
// begin
// Close;
// sql.Clear;
// sql.Add('delete BS_Cloth_Yarn where YRId=''' + Trim(CDS_2.fieldbyname('YRId').AsString) + '''');
// ExecSQL;
// end;
// end;
// CDS_2.Delete;
end ;
procedure TfrmTatClothInfoInput. ToolButton9Click( Sender: TObject) ;
var
i, j: Integer ;
begin
for j : = 0 to 5 do
begin
i : = CDS_4. RecordCount;
i : = i + 1 ;
with CDS_4 do
begin
Append;
FieldByName( 'SSEL' ) . Value : = FALSE ;
FieldByName( 'XuNO' ) . Value : = i;
Post;
end ;
end ;
end ;
2025-08-12 13:37:49 +08:00
procedure TfrmTatClothInfoInput. TV1Column10PropertiesEditValueChanged( Sender: TObject) ;
2025-03-01 10:55:52 +08:00
var
mvalue, FFieldName: string ;
2025-09-30 17:22:36 +08:00
mZ_Number, ZGS: double ;
mYarnFactor, mZS: double ;
2025-03-01 10:55:52 +08:00
begin
2025-09-30 17:22:36 +08:00
if not CDS_1. IsEmpty then
begin
CDS_1. First;
while ( CDS_1. FieldByName( 'Y_Code' ) . asString < > '' ) and ( CDS_1. FieldByName( 'Y_Code' ) . asString < > null) do
begin
mvalue : = TcxTextEdit( Sender) . EditingText;
FFieldName : = Trim( Tv1. Controller. FocusedColumn. DataBinding. FilterFieldName) ;
2025-03-01 10:55:52 +08:00
2025-09-30 17:22:36 +08:00
with CDS_1 do
begin
Edit;
FieldByName( FFieldName) . Value : = mvalue;
Post;
2025-03-01 10:55:52 +08:00
2025-09-30 17:22:36 +08:00
if FieldByName( 'QFYARNQTY' ) . Value = null then
begin
ZGS : = 0 ; //QUANFU<46> <55> <EFBFBD> <EFBFBD>
end
else
begin
ZGS : = FieldByName( 'QFYARNQTY' ) . Value; //ȫ<> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
end ;
2025-03-01 10:55:52 +08:00
2025-09-30 17:22:36 +08:00
if FieldByName( 'Z_Number' ) . Value = null then
begin
mZ_Number : = 0 ; //֧<> <D6A7>
end
else
begin
mZ_Number : = FieldByName( 'Z_Number' ) . Value; //֧<> <D6A7>
end ;
2025-03-01 10:55:52 +08:00
2025-09-30 17:22:36 +08:00
if FieldByName( 'YarnFactor' ) . Value = null then
begin
mYarnFactor : = 0 ; //ɴ<> <C9B4> ϵ<EFBFBD> <CFB5>
end
else
begin
mYarnFactor : = FieldByName( 'YarnFactor' ) . Value; //ɴ<> <C9B4> ϵ<EFBFBD> <CFB5>
end ;
2025-03-01 10:55:52 +08:00
2025-09-30 17:22:36 +08:00
mZS : = strtofloatdef( ZS. Text , 0 ) ;
end ;
if mZ_Number < > 0 then
begin
with CDS_1 do
begin
Edit;
FieldByName( 'MeterQty' ) . Value : = roundfloat( ( 1 + mZS / 1 0 0 ) * ZGS * mYarnFactor / mZ_Number, 2 ) ;
Post;
end ;
end ;
CDS_1. next;
2025-03-01 10:55:52 +08:00
end ;
2025-09-30 17:22:36 +08:00
2025-03-01 10:55:52 +08:00
end ;
2025-09-30 17:22:36 +08:00
2025-08-12 13:37:49 +08:00
end ;
procedure TfrmTatClothInfoInput. TV1Column1PropertiesEditValueChanged( Sender: TObject) ;
var
mvalue, FFieldName: string ;
GS, ZGS, MF, DS, WM, TW: double ;
begin
mvalue : = TcxTextEdit( Sender) . EditingText;
FFieldName : = Trim( Tv1. Controller. FocusedColumn. DataBinding. FilterFieldName) ;
// if mvalue = '' then
// begin
// mvalue := '0';
// end;
//
// 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;
//
// 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;
// FieldByName('MeterQty').Value := roundfloat(GS / ZGS * TW * DS / 9000, 2);
// Post;
// end;
// end;
// JSKZ();
2025-03-01 10:55:52 +08:00
end ;
procedure TfrmTatClothInfoInput. Tv2Column1PropertiesEditValueChanged( Sender: TObject) ;
var
mvalue, FFieldName: string ;
2025-08-12 13:37:49 +08:00
GS, ZGS, MF, DS, WM, fsh: double ;
2025-09-30 17:22:36 +08:00
mYarnFactor: double ;
2025-03-01 10:55:52 +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 ;
2025-08-12 13:37:49 +08:00
if FieldByName( 'Y_loss' ) . Value = null then
begin
fsh : = 0 ; //<2F> <> <EFBFBD> <EFBFBD>
end
else
begin
fsh : = FieldByName( 'Y_loss' ) . Value; //<2F> <> <EFBFBD> <EFBFBD>
end ;
2025-03-01 10:55:52 +08:00
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>
2025-08-12 13:37:49 +08:00
if FieldByName( 'Z_Number' ) . Value = null then
2025-03-01 10:55:52 +08:00
begin
2025-08-12 13:37:49 +08:00
DS : = 0 ; //֧
2025-03-01 10:55:52 +08:00
end
else
begin
2025-08-12 13:37:49 +08:00
DS : = FieldByName( 'Z_Number' ) . Value; //֧<> <D6A7>
2025-03-01 10:55:52 +08:00
end ;
WM : = strtofloatdef( C_FinishLatitudeDensity. text , 0 ) ; //γ <> <CEB3>
2025-09-30 17:22:36 +08:00
if FieldByName( 'YarnFactor' ) . Value = null then
begin
mYarnFactor : = 0 ; //ɴ<> <C9B4> ϵ<EFBFBD> <CFB5>
end
else
begin
mYarnFactor : = FieldByName( 'YarnFactor' ) . Value; //ɴ<> <C9B4> ϵ<EFBFBD> <CFB5>
end ;
2025-03-01 10:55:52 +08:00
end ;
2025-08-12 13:37:49 +08:00
if ( ZGS < > 0 ) and ( DS < > 0 ) then
2025-03-01 10:55:52 +08:00
begin
with CDS_2 do
begin
Edit;
2025-09-30 17:22:36 +08:00
FieldByName( 'MeterQty' ) . Value : = roundfloat( WM * ( MF + 4.2 ) * mYarnFactor / DS * GS / ZGS, 2 ) ;
2025-03-01 10:55:52 +08:00
Post;
end ;
end ;
JSKZ( ) ;
end ;
procedure TfrmTatClothInfoInput. 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;
2025-09-30 17:22:36 +08:00
FieldByName( 'YarnFactor' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'YarnFactor' ) . Value;
2025-03-01 10:55:52 +08:00
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;
2025-07-05 09:59:21 +08:00
FieldByName( 'Z_Number' ) . Value : = frmYarnInfoSel. CDS_1. fieldbyname( 'ZS' ) . Value;
2025-03-01 10:55:52 +08:00
Post;
2025-09-30 17:22:36 +08:00
Tv2Column1PropertiesEditValueChanged( Sender) ;
2025-03-01 10:55:52 +08:00
end ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
end ;
finally
frmYarnInfoSel. Free;
end ;
end ;
procedure TfrmTatClothInfoInput. 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) ;
2025-08-12 13:37:49 +08:00
DCRQTY. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'DCRQTY' ) . AsString) ;
C_KCQTY. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'C_KCQTY' ) . AsString) ;
WB_ReedNote. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'WB_ReedNote' ) . AsString) ;
BSQTY. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'BSQTY' ) . AsString) ;
GKBH. Text : = Trim( frmWBSpecSel. CDS_1. fieldbyname( 'GKBH' ) . AsString) ;
2025-03-01 10:55:52 +08:00
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
2025-08-23 14:29:45 +08:00
if ( ADOQuery1. FieldByName( 'RowNo' ) . AsString = 'A' ) or ( ADOQuery1. FieldByName( 'RowNo' ) . AsString = 'B' ) or ( ADOQuery1. FieldByName( 'RowNo' ) . AsString = 'C' ) or ( ADOQuery1. FieldByName( 'RowNo' ) . AsString = 'D' ) or ( ADOQuery1. FieldByName( 'RowNo' ) . AsString = 'E' ) or ( ADOQuery1. FieldByName( 'RowNo' ) . AsString = 'F' ) then
2025-03-01 10:55:52 +08:00
begin
2025-08-23 14:29:45 +08:00
with self. CDS_1 do
begin
APpend;
FieldByName( 'RowNo' ) . Value : = ADOQuery1. fieldbyname( 'RowNo' ) . Value;
2025-03-01 10:55:52 +08:00
2025-08-23 14:29:45 +08:00
FieldByName( 'Y_Code' ) . Value : = ADOQuery1. fieldbyname( 'Y_Code' ) . Value;
FieldByName( 'Y_Name' ) . Value : = ADOQuery1. fieldbyname( 'Y_Name' ) . Value;
2025-03-01 10:55:52 +08:00
2025-08-23 14:29:45 +08:00
FieldByName( 'Y_Color' ) . Value : = ADOQuery1. fieldbyname( 'Y_Color' ) . Value;
FieldByName( 'Y_Spec' ) . Value : = ADOQuery1. fieldbyname( 'Y_Spec' ) . Value;
2025-03-01 10:55:52 +08:00
2025-08-23 14:29:45 +08:00
FieldByName( 'YarnQty' ) . Value : = ADOQuery1. fieldbyname( 'YarnQty' ) . Value;
FieldByName( 'CycleYarnQty' ) . Value : = ADOQuery1. fieldbyname( 'CycleYarnQty' ) . Value;
2025-03-01 10:55:52 +08:00
2025-08-23 14:29:45 +08:00
FieldByName( 'TestDenier' ) . Value : = ADOQuery1. fieldbyname( 'Denier' ) . Value;
2025-03-01 10:55:52 +08:00
2025-08-23 14:29:45 +08:00
FieldByName( 'Z_Number' ) . Value : = ADOQuery1. fieldbyname( 'ZS' ) . Value;
2025-08-12 13:37:49 +08:00
2025-08-23 14:29:45 +08:00
FieldByName( 'QFYARNQTY' ) . Value : = ADOQuery1. fieldbyname( 'QFYARNQTY' ) . Value;
FieldByName( 'MeterQty' ) . Value : = ADOQuery1. fieldbyname( 'MeterQty' ) . Value;
2025-08-12 13:37:49 +08:00
2025-08-23 14:29:45 +08:00
Post;
end ;
2025-03-01 10:55:52 +08:00
end ;
ADOQuery1. next;
end ;
JSJS( ) ;
JSWS( ) ;
JSKZ( ) ;
end ;
end ;
finally
frmWBSpecSel. Free;
end ;
end ;
end .