2025-03-01 15:39:32 +08:00
|
|
|
|
unit U_TatWBPlanInPut;
|
|
|
|
|
|
|
|
|
|
|
|
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, dxScrollbarAnnotations,
|
2025-07-18 15:42:53 +08:00
|
|
|
|
cxImageList, dxSkinsCore, dxSkinOffice2013White, dxSkinSharpPlus,
|
|
|
|
|
|
dxSkinsDefaultPainters, dxSkinWXI;
|
2025-03-01 15:39:32 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmTatWBPlanInPut = class(TfrmBaseInput)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ToolButton8: TToolButton;
|
|
|
|
|
|
Panel2: TPanel;
|
|
|
|
|
|
cxPageControl1: TcxPageControl;
|
|
|
|
|
|
Panel5: TPanel;
|
|
|
|
|
|
Panel6: TPanel;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
ToolBar3: TToolBar;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
CDS_1: TClientDataSet;
|
|
|
|
|
|
DS_1: TDataSource;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
Label14: TLabel;
|
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
|
Label47: TLabel;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
OrdNote: TRichEdit;
|
|
|
|
|
|
WB_Spec: TEdit;
|
|
|
|
|
|
CustName: TBtnEditC;
|
2025-07-18 15:42:53 +08:00
|
|
|
|
WB_Code: TBtnEditC;
|
2025-03-01 15:39:32 +08:00
|
|
|
|
WB_YarnTotalLen: TEdit;
|
|
|
|
|
|
WB_Qty: TEdit;
|
|
|
|
|
|
WB_YarnLen: TEdit;
|
|
|
|
|
|
WB_Qty_YJJZZS: TEdit;
|
|
|
|
|
|
WB_Qty_YJMJZGS: TEdit;
|
|
|
|
|
|
WB_Qty_YJMJZMS: TEdit;
|
2025-07-18 15:42:53 +08:00
|
|
|
|
Label13: TLabel;
|
2025-07-19 09:52:09 +08:00
|
|
|
|
TWPId: TEdit;
|
2025-07-18 15:42:53 +08:00
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
WB_Name: TEdit;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
WB_YarnQty: TEdit;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
WB_Width: TEdit;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
gkbh: TBtnEditC;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
WB_ReedNo: TEdit;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
WB_ReedNote: TEdit;
|
|
|
|
|
|
Label24: TLabel;
|
|
|
|
|
|
WB_YarnDensity: TEdit;
|
|
|
|
|
|
gyno: TBtnEditC;
|
2025-07-19 09:52:09 +08:00
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
|
v1Column18: TcxGridDBColumn;
|
|
|
|
|
|
v1Column15: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column2: TcxGridDBColumn;
|
|
|
|
|
|
v1SPName: TcxGridDBColumn;
|
|
|
|
|
|
v1SPSpec: TcxGridDBColumn;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
v1Column10: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column1: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column7: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column8: TcxGridDBColumn;
|
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column4: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column9: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column6: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column5: TcxGridDBColumn;
|
|
|
|
|
|
v1Column12: TcxGridDBColumn;
|
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
2025-03-01 15:39:32 +08:00
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
|
|
|
|
|
procedure C_CodeKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure ConNoKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure MCTypeBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure CustNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure CustNameBtnDnClick(Sender: TObject);
|
2025-07-18 15:42:53 +08:00
|
|
|
|
|
2025-03-01 15:39:32 +08:00
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton4Click(Sender: TObject);
|
2025-07-19 09:52:09 +08:00
|
|
|
|
procedure gynoBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure WB_CodeBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure gkbhBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure gynoDblClick(Sender: TObject);
|
|
|
|
|
|
procedure Tv1Column7PropertiesEditValueChanged(Sender: TObject);
|
2025-03-01 15:39:32 +08:00
|
|
|
|
private
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
function SaveData(): Boolean;
|
2025-07-19 09:52:09 +08:00
|
|
|
|
procedure JSJS();
|
2025-03-01 15:39:32 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
PState, FCopyInt: Integer;
|
|
|
|
|
|
FConNo, FTWPId, FSubId: string;
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmTatWBPlanInPut: TfrmTatWBPlanInPut;
|
|
|
|
|
|
newh: hwnd;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
2025-07-19 09:52:09 +08:00
|
|
|
|
U_DataLink, U_ZDYHelp, U_RTFun, U_CompanySel, U_YarnInfoSel, U_TatPlanSel2,
|
|
|
|
|
|
U_WBSpecSel, U_GKManageSel;
|
2025-03-01 15:39:32 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
ModalResult := 1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.InitData();
|
|
|
|
|
|
var
|
|
|
|
|
|
PBNO, PBFlag: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if PState = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from Tat_WB_Plan A where A.TWPId=''' + Trim(FTWPId) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCSHData(ADOQueryTemp, ScrollBox1, 0);
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select A.* from Tat_WB_Plan_Yarn A ');
|
|
|
|
|
|
sql.Add(' where YRType=''<27><><EFBFBD>ᾭ˿'' and A.TWPId=''' + Trim(FTWPId) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQueryTemp, CDS_1);
|
|
|
|
|
|
SInitCDSData(ADOQueryTemp, CDS_1);
|
|
|
|
|
|
|
|
|
|
|
|
if FCopyInt = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FConNo := '';
|
|
|
|
|
|
FTWPId := '';
|
|
|
|
|
|
FSubId := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-19 09:52:09 +08:00
|
|
|
|
procedure TfrmTatWBPlanInPut.gkbhBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmGKManageSel := tfrmGKManageSel.Create(Application);
|
|
|
|
|
|
with frmGKManageSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
SELF.GKBH.Text := CDS_HZ.FieldByName('GKBH').AsString;
|
|
|
|
|
|
SELF.WB_ReedNo.Text := CDS_HZ.FieldByName('GKKH').AsString;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmGKManageSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.gynoBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
try
|
|
|
|
|
|
frmTatPlanSel2 := TfrmTatPlanSel2.Create(Application);
|
|
|
|
|
|
with frmTatPlanSel2 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FISSJ := '<27><>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Self.GYNo.Text := CDS_1.FieldByName('OrderNo').asstring;
|
|
|
|
|
|
// Self.GYNo.Properties.LookupItems.Text := CDS_1.FieldByName('Subid').asstring;
|
|
|
|
|
|
Self.CustName.Text := CDS_1.FieldByName('CustName').asstring;
|
|
|
|
|
|
|
|
|
|
|
|
Self.WB_Code.Text := CDS_1.FieldByName('WB_Code').asstring;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add(' select A.* ');
|
|
|
|
|
|
sql.Add(' from Tat_WB_Spec A');
|
|
|
|
|
|
sql.Add(' where WB_Code=''' + trim(WB_Code.Text) + ''' ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
Self.WB_Code.Text := Trim(ADOQueryTemp.fieldbyname('WB_Code').AsString);
|
|
|
|
|
|
Self.WB_Name.Text := Trim(ADOQueryTemp.fieldbyname('WB_Name').AsString);
|
|
|
|
|
|
Self.WB_Spec.Text := Trim(ADOQueryTemp.fieldbyname('WB_Spec').AsString);
|
|
|
|
|
|
Self.WB_YarnQty.Text := ADOQueryTemp.fieldbyname('WB_YarnQty').asstring;
|
|
|
|
|
|
Self.WB_Width.Text := Trim(ADOQueryTemp.fieldbyname('WB_Width').AsString);
|
|
|
|
|
|
Self.WB_ReedNo.Text := Trim(ADOQueryTemp.fieldbyname('WB_ReedNo').AsString);
|
|
|
|
|
|
Self.WB_ReedNote.Text := Trim(ADOQueryTemp.fieldbyname('WB_ReedNote').AsString);
|
|
|
|
|
|
|
|
|
|
|
|
Self.WB_YarnDensity.Text := Trim(ADOQueryTemp.fieldbyname('WB_YarnDensity').AsString);
|
|
|
|
|
|
Self.OrdNote.Text := Trim(ADOQueryTemp.fieldbyname('Note').AsString);
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmTatPlanSel2.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.gynoDblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
inherited;
|
|
|
|
|
|
TcxButtonEdit(Sender).Text := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 15:39:32 +08:00
|
|
|
|
function TfrmTatWBPlanInPut.SaveData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno, maxsubno, maxpbno, maxpzno, maxsjno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
if Trim(FTWPId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, maxno, 'SZ', 'Tat_WB_Plan', 4, 1) = False then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>');
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
maxno := Trim(FTWPId);
|
|
|
|
|
|
end;
|
|
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////////
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
SQL.Add('select * from Tat_WB_Plan where TWPId=''' + Trim(FTWPId) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(FTWPId) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('TWPId').Value := Trim(maxno);
|
|
|
|
|
|
RTSetsavedata(ADOQueryCmd, 'Tat_WB_Plan', ScrollBox1, 0);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD><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, 'WY', 'Tat_WB_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_WB_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><><EFBFBD>ᾭ˿';
|
|
|
|
|
|
FieldByName('TWPId').Value := Trim(maxno);
|
|
|
|
|
|
FieldByName('YRId').Value := Trim(maxpbno);
|
2025-07-19 09:52:09 +08:00
|
|
|
|
RTSetsavedataCDS(ADOQueryCmd, Tv1, CDS_1, 'Tat_WB_Plan_Yarn', 0);
|
2025-03-01 15:39:32 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
CDS_1.Edit;
|
|
|
|
|
|
CDS_1.FieldByName('TWPId').Value := Trim(maxno);
|
|
|
|
|
|
CDS_1.FieldByName('YRId').Value := Trim(maxpbno);
|
|
|
|
|
|
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
////////////////////////// <20><><EFBFBD>澭˿<E6BEAD><CBBF><EFBFBD>ȱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
FTWPId := Trim(maxno);
|
|
|
|
|
|
FSubId := Trim(maxsubno);
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.TBSaveClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FReal: Double;
|
|
|
|
|
|
maxConNo: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(CustName.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
ModalResult := 1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmYarnInfoSel := TfrmYarnInfoSel.Create(Application);
|
|
|
|
|
|
with frmYarnInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with self.CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
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;
|
2025-07-19 09:52:09 +08:00
|
|
|
|
|
|
|
|
|
|
FieldByName('ZS').Value := frmYarnInfoSel.CDS_1.fieldbyname('ZS').Value;
|
|
|
|
|
|
FieldByName('FF').Value := frmYarnInfoSel.CDS_1.fieldbyname('FF').Value;
|
|
|
|
|
|
FieldByName('ND').Value := frmYarnInfoSel.CDS_1.fieldbyname('ND').Value;
|
|
|
|
|
|
FieldByName('NOTE').Value := frmYarnInfoSel.CDS_1.fieldbyname('NOTE').Value;
|
2025-03-01 15:39:32 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmYarnInfoSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_1.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(CDS_1.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 Tat_WB_Plan_Yarn where YRId=''' + Trim(CDS_1.fieldbyname('YRId').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
CDS_1.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-07-19 09:52:09 +08:00
|
|
|
|
procedure TfrmTatWBPlanInPut.Tv1Column7PropertiesEditValueChanged(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue, FFieldName: string;
|
|
|
|
|
|
GS, ZGS, MF, DS, WM, TW, SUNHAO: double;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
// if FieldByName('SH').Value = null then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// SUNHAO := 0; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// SUNHAO := FieldByName('SH').Value; //<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
|
// end;
|
|
|
|
|
|
|
|
|
|
|
|
if FieldByName('Denier').Value = null then
|
|
|
|
|
|
begin
|
|
|
|
|
|
DS := 0; //D<><44>
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
DS := FieldByName('Denier').Value; //D<><44>
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
TW := strtofloatdef(WB_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;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.WB_CodeBtnUpClick(Sender: TObject);
|
|
|
|
|
|
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.WB_YarnQty.Text := frmWBSpecSel.CDS_1.fieldbyname('WB_YarnQty').value;
|
|
|
|
|
|
Self.WB_Width.Text := Trim(frmWBSpecSel.CDS_1.fieldbyname('WB_Width').AsString);
|
|
|
|
|
|
Self.WB_ReedNo.Text := Trim(frmWBSpecSel.CDS_1.fieldbyname('WB_ReedNo').AsString);
|
|
|
|
|
|
Self.WB_ReedNote.Text := Trim(frmWBSpecSel.CDS_1.fieldbyname('WB_ReedNote').AsString);
|
|
|
|
|
|
Self.WB_YarnDensity.Text := Trim(frmWBSpecSel.CDS_1.fieldbyname('WB_YarnDensity').AsString);
|
|
|
|
|
|
Self.gkbh.Text := Trim(frmWBSpecSel.CDS_1.fieldbyname('gkbh').AsString);
|
|
|
|
|
|
Self.OrdNote.Text := Trim(frmWBSpecSel.CDS_1.fieldbyname('Note').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmWBSpecSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 15:39:32 +08:00
|
|
|
|
procedure TfrmTatWBPlanInPut.C_CodeKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = #13 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
SelectNext(ActiveControl as TWinControl, True, True);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.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;
|
|
|
|
|
|
|
2025-07-19 09:52:09 +08:00
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.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(WB_Width.text, 0); //<2F>ط<EFBFBD>
|
|
|
|
|
|
|
|
|
|
|
|
TW := strtofloatdef(WB_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(WB_YarnDensity.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;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-03-01 15:39:32 +08:00
|
|
|
|
procedure TfrmTatWBPlanInPut.ConNoKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = #13 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
SelectNext(ActiveControl as TWinControl, True, True);
|
2025-07-19 09:52:09 +08:00
|
|
|
|
|
2025-03-01 15:39:32 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.CustNameBtnDnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBtnEditC(Sender).TxtCode := '';
|
|
|
|
|
|
TBtnEditC(Sender).Text := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmTatWBPlanInPut.CustNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|
|
|
|
|
with frmCompanySel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCoType := '<27>ͻ<EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
CustName.TxtCode := Trim(CDS_1.fieldbyname('CoCode').AsString);
|
|
|
|
|
|
CustName.Text := Trim(CDS_1.fieldbyname('CoAbbrName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmCompanySel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|