2024-12-14 17:23:12 +08:00
|
|
|
|
unit U_ClothInfoInput;
|
|
|
|
|
|
|
|
|
|
|
|
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, cxCheckBox, cxDropDownEdit, cxContainer, cxMaskEdit,
|
2025-05-26 14:27:08 +08:00
|
|
|
|
dxScrollbarAnnotations, cxMemo, dxSkinsCore, dxSkinsDefaultPainters, cxMRUEdit,
|
|
|
|
|
|
ComObj;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmClothInfoInput = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
2025-02-25 16:04:43 +08:00
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
ToolButton6: TToolButton;
|
|
|
|
|
|
BCIID: TcxTextEdit;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
ToolBar2: TToolBar;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
TV1: TcxGridDBTableView;
|
|
|
|
|
|
TV1Column1: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column2: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel2: TcxGridLevel;
|
|
|
|
|
|
DS_1: TDataSource;
|
|
|
|
|
|
CDS_1: TClientDataSet;
|
|
|
|
|
|
GPM_1: TcxGridPopupMenu;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
|
TV1Column5: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column6: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column3: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column4: TcxGridDBColumn;
|
|
|
|
|
|
Panel2: TPanel;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label9: TLabel;
|
2025-02-25 16:04:43 +08:00
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
Label14: TLabel;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
Label24: TLabel;
|
|
|
|
|
|
Label25: TLabel;
|
|
|
|
|
|
C_Code: TcxTextEdit;
|
|
|
|
|
|
C_Name: TcxTextEdit;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
C_GramWeight: TcxButtonEdit;
|
|
|
|
|
|
C_Composition: TcxButtonEdit;
|
|
|
|
|
|
C_Spec: TcxButtonEdit;
|
|
|
|
|
|
C_FromName: TcxButtonEdit;
|
|
|
|
|
|
C_Width: TcxButtonEdit;
|
|
|
|
|
|
C_Pattern: TcxButtonEdit;
|
|
|
|
|
|
CINote: TcxMemo;
|
|
|
|
|
|
GC_Name: TcxTextEdit;
|
|
|
|
|
|
C_EComposition: TcxButtonEdit;
|
|
|
|
|
|
CraftCode: TcxTextEdit;
|
|
|
|
|
|
FtyNo: TcxTextEdit;
|
|
|
|
|
|
FtyName: TcxTextEdit;
|
2025-02-25 16:04:43 +08:00
|
|
|
|
C_EName: TcxTextEdit;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
DyeingMethod: TcxTextEdit;
|
2024-12-30 22:05:29 +08:00
|
|
|
|
CostPrice: TcxCurrencyEdit;
|
|
|
|
|
|
distributionCoefficient: TcxCurrencyEdit;
|
|
|
|
|
|
quota: TcxCurrencyEdit;
|
2024-12-31 16:22:23 +08:00
|
|
|
|
C_FromName2: TcxButtonEdit;
|
2025-02-17 12:31:41 +08:00
|
|
|
|
StkPosition: TcxMRUEdit;
|
2025-02-19 15:18:00 +08:00
|
|
|
|
qtyunit: TcxMRUEdit;
|
2025-02-25 16:04:43 +08:00
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
C_YarnSpec: TcxTextEdit;
|
|
|
|
|
|
Panel3: TPanel;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
CDS_2: TClientDataSet;
|
|
|
|
|
|
DS_2: TDataSource;
|
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
|
ADO_2: TADOQuery;
|
|
|
|
|
|
ADO_1: TADOQuery;
|
|
|
|
|
|
Panel4: TPanel;
|
2025-02-25 16:04:43 +08:00
|
|
|
|
ToolBar3: TToolBar;
|
|
|
|
|
|
ToolButton5: TToolButton;
|
|
|
|
|
|
ToolButton7: TToolButton;
|
|
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
|
TV2: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
Panel5: TPanel;
|
|
|
|
|
|
ToolBar4: TToolBar;
|
|
|
|
|
|
ToolButton8: TToolButton;
|
|
|
|
|
|
ToolButton9: TToolButton;
|
|
|
|
|
|
cxGrid3: TcxGrid;
|
|
|
|
|
|
TV3: TcxGridDBTableView;
|
|
|
|
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel3: TcxGridLevel;
|
|
|
|
|
|
ADO_3: TADOQuery;
|
|
|
|
|
|
DS_3: TDataSource;
|
|
|
|
|
|
CDS_3: TClientDataSet;
|
|
|
|
|
|
DS_4: TDataSource;
|
|
|
|
|
|
CDS_4: TClientDataSet;
|
|
|
|
|
|
ADO_4: TADOQuery;
|
|
|
|
|
|
ToolButton10: TToolButton;
|
2025-05-26 14:27:08 +08:00
|
|
|
|
ToolButton11: TToolButton;
|
|
|
|
|
|
OpenDialog1: TOpenDialog;
|
|
|
|
|
|
CDS_LM: TClientDataSet;
|
|
|
|
|
|
ToolButton12: TToolButton;
|
|
|
|
|
|
Label26: TLabel;
|
|
|
|
|
|
C_FromName3: TcxButtonEdit;
|
|
|
|
|
|
Label27: TLabel;
|
|
|
|
|
|
C_FromName4: TcxButtonEdit;
|
|
|
|
|
|
Label28: TLabel;
|
|
|
|
|
|
C_FromName5: TcxButtonEdit;
|
|
|
|
|
|
Label29: TLabel;
|
|
|
|
|
|
Process2: TcxButtonEdit;
|
|
|
|
|
|
Label30: TLabel;
|
|
|
|
|
|
Process3: TcxButtonEdit;
|
|
|
|
|
|
Label31: TLabel;
|
|
|
|
|
|
Process4: TcxButtonEdit;
|
|
|
|
|
|
Label32: TLabel;
|
|
|
|
|
|
Process5: TcxButtonEdit;
|
|
|
|
|
|
Label33: TLabel;
|
|
|
|
|
|
Process: TcxButtonEdit;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure CYColorKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure CYJGGYBtnDnClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton6Click(Sender: TObject);
|
|
|
|
|
|
procedure C_GramWeightDblClick(Sender: TObject);
|
|
|
|
|
|
procedure C_FromNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton4Click(Sender: TObject);
|
2024-12-30 22:05:29 +08:00
|
|
|
|
procedure TV1Column5PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure C_WidthPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2024-12-31 16:22:23 +08:00
|
|
|
|
procedure C_FromName2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-02-17 12:31:41 +08:00
|
|
|
|
procedure CostPricePropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure StkPositionPropertiesButtonClick(Sender: TObject);
|
2025-02-25 16:04:43 +08:00
|
|
|
|
procedure ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton7Click(Sender: TObject);
|
|
|
|
|
|
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-05-08 10:12:23 +08:00
|
|
|
|
procedure ToolButton8Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton9Click(Sender: TObject);
|
|
|
|
|
|
procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure Button1Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton10Click(Sender: TObject);
|
2025-05-26 14:27:08 +08:00
|
|
|
|
|
|
|
|
|
|
procedure ToolButton11Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton12Click(Sender: TObject);
|
|
|
|
|
|
procedure C_FromName3PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
2024-12-14 17:23:12 +08:00
|
|
|
|
private
|
|
|
|
|
|
canshu1: string;
|
|
|
|
|
|
Fint: Integer;
|
|
|
|
|
|
procedure InitGrid();
|
2024-12-30 22:05:29 +08:00
|
|
|
|
procedure InitGrid1();
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// procedure InitGrid2();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
function SaveData(): Boolean;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
procedure setName();
|
2025-03-20 16:38:30 +08:00
|
|
|
|
procedure addColor();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
FBCIID, FCTID: string;
|
|
|
|
|
|
TypeInt: Integer; //0<><30><EFBFBD><EFBFBD>_1<5F><31><EFBFBD><EFBFBD>_2<5F><EFBFBD>
|
2025-01-14 16:18:44 +08:00
|
|
|
|
fbuzhongedit, canshu3: string;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmClothInfoInput: TfrmClothInfoInput;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
2025-02-25 16:04:43 +08:00
|
|
|
|
U_DataLink, U_RTFun, U_iniParam, U_ZDYHelp, U_AttachmentUpload, U_ClothInfoSel,
|
2025-05-26 14:27:08 +08:00
|
|
|
|
U_CompanySel, U_Edit;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
2025-03-20 16:38:30 +08:00
|
|
|
|
procedure TfrmClothInfoInput.addColor();
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select A.* from BS_Cloth_Info_Sub A where A.BCIID=' + QuotedStr(Trim(C_FromName.Properties.LookupItems.Text)));
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
DisableControls;
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
fieldbyname('C_Color').Value := ADOQueryTemp.fieldbyname('C_Color').Value;
|
|
|
|
|
|
fieldbyname('C_ColorNo').Value := ADOQueryTemp.fieldbyname('C_ColorNo').Value;
|
|
|
|
|
|
fieldbyname('floatPrice').Value := 0;
|
|
|
|
|
|
fieldbyname('referencePrice').value := StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-01-14 16:18:44 +08:00
|
|
|
|
procedure TfrmClothInfoInput.setName();
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if (Trim(C_FromName.Text) <> '') and (Trim(C_FromName2.Text) <> '') then
|
2025-03-20 16:38:30 +08:00
|
|
|
|
C_Name.Text := Trim(C_FromName.Text) + '<27><>' + Trim(C_FromName2.Text);
|
2025-01-14 16:18:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-17 12:31:41 +08:00
|
|
|
|
procedure TfrmClothInfoInput.StkPositionPropertiesButtonClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TcxmruEdit(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
|
|
|
|
|
|
TcxmruEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-30 22:05:29 +08:00
|
|
|
|
procedure TfrmClothInfoInput.InitGrid1();
|
2025-02-25 12:17:25 +08:00
|
|
|
|
var
|
|
|
|
|
|
SqlStr: string;
|
2024-12-30 22:05:29 +08:00
|
|
|
|
begin
|
2025-02-25 12:17:25 +08:00
|
|
|
|
SqlStr := 'select A.* from BS_Cloth_Info_Sub A ';
|
|
|
|
|
|
SqlStr := SqlStr + ' where A.BCIID=''' + Trim(FBCIID) + '''';
|
2025-03-20 16:38:30 +08:00
|
|
|
|
SqlStr := SqlStr + ' ORDER BY CASE WHEN C_COLORNO NOT LIKE ''%[^0-9]%'' THEN dbo.getNum(C_Colorno) ELSE 9999999999 ';
|
2025-02-25 12:17:25 +08:00
|
|
|
|
SqlStr := SqlStr + ' END ,C_ColorNo';
|
|
|
|
|
|
|
|
|
|
|
|
InitCDSData(ADO_1, CDS_1, Tv1, SqlStr, '', '');
|
|
|
|
|
|
|
2025-02-25 16:04:43 +08:00
|
|
|
|
SqlStr := 'select A.* from BS_Cloth_Info_GYSCP A ';
|
|
|
|
|
|
SqlStr := SqlStr + ' where A.BCIID=''' + Trim(FBCIID) + '''';
|
2025-02-25 16:16:25 +08:00
|
|
|
|
|
2025-02-25 16:04:43 +08:00
|
|
|
|
InitCDSData(ADO_2, CDS_2, Tv2, SqlStr, '', '');
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
SqlStr := 'select A.* from Bs_Cloth_Info_Coefficient A ';
|
|
|
|
|
|
SqlStr := SqlStr + ' where A.BCIID=''' + Trim(FBCIID) + '''';
|
|
|
|
|
|
|
|
|
|
|
|
InitCDSData(ADO_3, CDS_3, Tv3, SqlStr, '', '');
|
2024-12-30 22:05:29 +08:00
|
|
|
|
end;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.InitGrid();
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
SQL.Add('select *,CJDATE=DATEDIFF(dd,FILLTIME,GETDATE()) from V_BS_Cloth_Info where BCIID=''' + Trim(FBCIID) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-25 16:04:43 +08:00
|
|
|
|
SCSHData(ADOQueryTemp, panel2, 2);
|
2025-02-17 12:31:41 +08:00
|
|
|
|
StkPosition.Text := ADOQueryTemp.FieldByName('StkPosition').AsString;
|
2025-02-20 11:38:13 +08:00
|
|
|
|
qtyunit.Text := ADOQueryTemp.FieldByName('qtyunit').AsString;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
// SCSHData(ADOQueryTemp, ScrollBox1, 0);
|
|
|
|
|
|
C_FromName.Properties.LookupItems.Text := Trim(ADOQueryTemp.fieldbyname('FromBCIID').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
C_FromName.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2024-12-31 16:22:23 +08:00
|
|
|
|
|
|
|
|
|
|
C_FromName2.Properties.LookupItems.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName2').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
C_FromName2.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName2').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-05-26 14:27:08 +08:00
|
|
|
|
Process2.Text :=Trim(ADOQueryTemp.fieldbyname('Process2').AsString); //<2F>ӹ<EFBFBD><D3B9><EFBFBD>ʽ
|
|
|
|
|
|
|
|
|
|
|
|
C_FromName3.Properties.LookupItems.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName3').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
C_FromName3.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName3').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
Process3.Text :=Trim(ADOQueryTemp.fieldbyname('Process3').AsString); //<2F>ӹ<EFBFBD><D3B9><EFBFBD>ʽ
|
|
|
|
|
|
|
|
|
|
|
|
C_FromName4.Properties.LookupItems.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName4').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
C_FromName4.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName4').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
Process4.Text :=Trim(ADOQueryTemp.fieldbyname('Process4').AsString); //<2F>ӹ<EFBFBD><D3B9><EFBFBD>ʽ
|
|
|
|
|
|
|
|
|
|
|
|
C_FromName5.Properties.LookupItems.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName5').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
C_FromName5.Text := Trim(ADOQueryTemp.fieldbyname('C_FromName5').AsString); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
Process5.Text :=Trim(ADOQueryTemp.fieldbyname('Process5').AsString); //<2F>ӹ<EFBFBD><D3B9><EFBFBD>ʽ
|
2024-12-31 16:22:23 +08:00
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
if ADOQueryTemp.fieldbyname('CJDATE').AsInteger <= 7 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if TypeInt = 2 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if fbuzhongedit = '<27>༭' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_Spec.Enabled := True;
|
|
|
|
|
|
C_Composition.Enabled := True;
|
|
|
|
|
|
GC_Name.Enabled := True;
|
|
|
|
|
|
C_EComposition.Enabled := True;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_Spec.Enabled := False;
|
|
|
|
|
|
C_Composition.Enabled := False;
|
|
|
|
|
|
GC_Name.Enabled := False;
|
|
|
|
|
|
C_EComposition.Enabled := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
2024-12-30 22:05:29 +08:00
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-31 16:22:23 +08:00
|
|
|
|
procedure TfrmClothInfoInput.C_FromName2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(Application);
|
|
|
|
|
|
with frmClothInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
// FCTType := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_FromName2.Properties.LookupItems.Text := Trim(CDS_1.fieldbyname('BCIID').AsString);
|
|
|
|
|
|
C_FromName2.Text := Trim(CDS_1.fieldbyname('C_Name').AsString);
|
2025-01-14 16:18:44 +08:00
|
|
|
|
setName();
|
2024-12-31 16:22:23 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmClothInfoSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-26 14:27:08 +08:00
|
|
|
|
procedure TfrmClothInfoInput.C_FromName3PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(Application);
|
|
|
|
|
|
with frmClothInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
// FCTType := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_FromName3.Properties.LookupItems.Text := Trim(CDS_1.fieldbyname('BCIID').AsString);
|
|
|
|
|
|
C_FromName3.Text := Trim(CDS_1.fieldbyname('C_Name').AsString);
|
|
|
|
|
|
setName();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmClothInfoSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
procedure TfrmClothInfoInput.C_FromNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(Application);
|
|
|
|
|
|
with frmClothInfoSel do
|
|
|
|
|
|
begin
|
2024-12-31 16:22:23 +08:00
|
|
|
|
// FCTType := '<27><><EFBFBD><EFBFBD>';
|
2024-12-14 17:23:12 +08:00
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_FromName.Properties.LookupItems.Text := Trim(CDS_1.fieldbyname('BCIID').AsString);
|
|
|
|
|
|
C_FromName.Text := Trim(CDS_1.fieldbyname('C_Name').AsString);
|
2025-01-14 16:18:44 +08:00
|
|
|
|
setName();
|
2025-03-20 16:38:30 +08:00
|
|
|
|
addColor();
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmClothInfoSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.C_GramWeightDblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TcxButtonEdit(Sender).Text := '';
|
|
|
|
|
|
TcxButtonEdit(Sender).Properties.LookupItems.Text := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-30 22:05:29 +08:00
|
|
|
|
procedure TfrmClothInfoInput.C_WidthPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2024-12-14 17:23:12 +08:00
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TcxButtonEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TcxButtonEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
readCxGrid(self.Caption + 'TV1', Tv1, '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
2025-03-20 16:38:30 +08:00
|
|
|
|
|
|
|
|
|
|
if FCTID = 'CT2412300005' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_Name.Enabled := False;
|
|
|
|
|
|
C_FromName.Enabled := True;
|
|
|
|
|
|
C_FromName2.Enabled := True;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
C_Name.Enabled := True;
|
|
|
|
|
|
C_FromName.Enabled := False;
|
|
|
|
|
|
C_FromName2.Enabled := False;
|
|
|
|
|
|
end;
|
2025-02-17 12:31:41 +08:00
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from KH_ZDY where type=''StkPosition''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
if isEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
StkPosition.Properties.LookupItems.Clear;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
StkPosition.Properties.LookupItems.Add(Trim(fieldByName('zdyName').AsString));
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
StkPosition.ItemIndex := -1;
|
|
|
|
|
|
end;
|
2025-02-19 15:18:00 +08:00
|
|
|
|
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from KH_ZDY where type=''qtyunit''');
|
|
|
|
|
|
|
|
|
|
|
|
Open;
|
|
|
|
|
|
if isEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
qtyunit.Properties.LookupItems.Clear;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
qtyunit.Properties.LookupItems.Add(Trim(fieldByName('zdyName').AsString));
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
qtyunit.ItemIndex := -1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-26 14:27:08 +08:00
|
|
|
|
with CDS_LM do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldDefs.Clear;
|
|
|
|
|
|
FieldDefs.Add('LXH', ftInteger, 0);
|
|
|
|
|
|
FieldDefs.Add('lCode', ftString, 40);
|
|
|
|
|
|
FieldDefs.Add('LName', ftString, 40);
|
|
|
|
|
|
close;
|
|
|
|
|
|
CreateDataSet;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// InitGrid2();
|
2024-12-30 22:05:29 +08:00
|
|
|
|
InitGrid1();
|
2025-02-17 12:31:41 +08:00
|
|
|
|
InitGrid();
|
2025-01-14 16:18:44 +08:00
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
if TypeInt = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FBCIID := '';
|
|
|
|
|
|
BCIID.text := '';
|
|
|
|
|
|
C_Code.text := '';
|
|
|
|
|
|
end;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
if canshu3 = '<27><>Ȩ<EFBFBD><C8A8>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
HiddenTVColumn(TV1, 'floatPrice');
|
|
|
|
|
|
HiddenTVColumn(TV1, 'referencePrice');
|
|
|
|
|
|
CostPrice.Properties.ReadOnly := True;
|
|
|
|
|
|
CostPrice.Properties.EchoMode := eemPassword;
|
|
|
|
|
|
end;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmClothInfoInput.SaveData(): Boolean;
|
|
|
|
|
|
var
|
2025-05-08 10:12:23 +08:00
|
|
|
|
MaxBCIID, MaxBCPID, maxId2, MAXID3, MAXID4: string;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
|
|
|
|
|
if Trim(FBCIID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQueryCmd, MaxBCIID, '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(MaxBCIID);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
MaxBCIID := Trim(FBCIID);
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('update BS_Cloth_Info set DelId=' + quotedstr(DCode) + ',Deler=' + quotedstr(DName) + ',Deltime=GETDATE() where BCIID=''' + Trim(MaxBCIID) + '''');
|
|
|
|
|
|
sql.Add('insert into Bs_Cloth_Info_Log select * from BS_Cloth_Info where BCIID=''' + Trim(MaxBCIID) + '''');
|
|
|
|
|
|
sql.Add('update BS_Cloth_Info set DelId=null,Deler=null,Deltime=null where BCIID=''' + Trim(MaxBCIID) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
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(MaxBCIID);
|
2025-02-17 12:31:41 +08:00
|
|
|
|
|
|
|
|
|
|
FieldByName('StkPosition').Value := Trim(StkPosition.text);
|
2025-02-20 11:38:13 +08:00
|
|
|
|
FieldByName('QTYUNIT').Value := Trim(QTYUNIT.text);
|
2025-02-19 15:18:00 +08:00
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
if trim(C_Code.Text) = '' then
|
|
|
|
|
|
C_Code.Text := Trim(MaxBCIID);
|
2025-02-25 16:04:43 +08:00
|
|
|
|
RTSetsavedata(ADOQueryCmd, 'BS_Cloth_Info', panel2, 2);
|
2024-12-14 17:23:12 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('delete BS_Cloth_Info_Link where ToID=''' + Trim(MaxBCIID) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
if Trim(C_FromName.Properties.LookupItems.Text) <> '' then
|
2024-12-31 16:22:23 +08:00
|
|
|
|
begin
|
2025-01-14 16:18:44 +08:00
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from BS_Cloth_Info_Link where 1=2');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('ToID').Value := Trim(MaxBCIID);
|
|
|
|
|
|
FieldByName('SerialNo').Value := 1;
|
|
|
|
|
|
FieldByName('FromID').Value := Trim(C_FromName.Properties.LookupItems.Text); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-05-26 14:27:08 +08:00
|
|
|
|
FieldByName('Process').Value := Trim(Process.Text); // <20><><EFBFBD><EFBFBD>
|
2025-01-14 16:18:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-12-31 16:22:23 +08:00
|
|
|
|
end;
|
2025-05-26 14:27:08 +08:00
|
|
|
|
|
2025-01-14 16:18:44 +08:00
|
|
|
|
if Trim(C_FromName2.Properties.LookupItems.Text) <> '' then
|
2024-12-31 16:22:23 +08:00
|
|
|
|
begin
|
2025-01-14 16:18:44 +08:00
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from BS_Cloth_Info_Link where 1=2');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('ToID').Value := Trim(MaxBCIID);
|
|
|
|
|
|
FieldByName('SerialNo').Value := 2;
|
|
|
|
|
|
FieldByName('FromID').Value := Trim(C_FromName2.Properties.LookupItems.Text); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-05-26 14:27:08 +08:00
|
|
|
|
FieldByName('Process').Value := Trim(Process2.Text); // <20><><EFBFBD><EFBFBD>
|
2025-01-14 16:18:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-12-31 16:22:23 +08:00
|
|
|
|
end;
|
2025-05-26 14:27:08 +08:00
|
|
|
|
|
|
|
|
|
|
if Trim(C_FromName3.Properties.LookupItems.Text) <> '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from BS_Cloth_Info_Link where 1=2');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('ToID').Value := Trim(MaxBCIID);
|
|
|
|
|
|
FieldByName('SerialNo').Value := 3;
|
|
|
|
|
|
FieldByName('FromID').Value := Trim(C_FromName3.Properties.LookupItems.Text); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
FieldByName('Process').Value := Trim(Process3.Text); // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(C_FromName4.Properties.LookupItems.Text) <> '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from BS_Cloth_Info_Link where 1=2');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('ToID').Value := Trim(MaxBCIID);
|
|
|
|
|
|
FieldByName('SerialNo').Value := 4;
|
|
|
|
|
|
FieldByName('FromID').Value := Trim(C_FromName4.Properties.LookupItems.Text); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
FieldByName('Process').Value := Trim(Process4.Text); // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(C_FromName5.Properties.LookupItems.Text) <> '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add('select * from BS_Cloth_Info_Link where 1=2');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('ToID').Value := Trim(MaxBCIID);
|
|
|
|
|
|
FieldByName('SerialNo').Value := 5;
|
|
|
|
|
|
FieldByName('FromID').Value := Trim(C_FromName5.Properties.LookupItems.Text); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
FieldByName('Process').Value := Trim(Process5.Text); // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
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><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////////
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// with CDS_1 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// First;
|
|
|
|
|
|
// while not Eof do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Trim(CDS_1.fieldbyname('BCISID').AsString) = '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if GetLSNo(ADOQueryTemp, maxId2, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
// Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// maxId2 := Trim(CDS_1.fieldbyname('BCISID').AsString);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// with ADOQueryCmd do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// SQL.Clear;
|
|
|
|
|
|
// sql.Add(' select * from BS_Cloth_Info_Sub where ');
|
|
|
|
|
|
// sql.Add(' BCISID=''' + Trim(maxId2) + '''');
|
|
|
|
|
|
// Open;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// with ADOQueryCmd do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Trim(CDS_1.fieldbyname('BCISID').AsString) = '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Append;
|
|
|
|
|
|
// FieldByName('FillID').Value := Trim(DCode);
|
|
|
|
|
|
// FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
// FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
|
|
|
|
|
// FieldByName('EditID').Value := Trim(DCode);
|
|
|
|
|
|
// FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
// FieldByName('EditTime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// FieldByName('BCIID').Value := Trim(MaxBCIID);
|
|
|
|
|
|
// FieldByName('BCISID').Value := Trim(maxId2);
|
|
|
|
|
|
// RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_1, 'BS_Cloth_Info_Sub', 0);
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Next;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// with ADOQueryTemp do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('select count(BCISID) as AA from BS_Cloth_Info_Sub where BCIID=''' + Trim(MaxBCIID) + '''');
|
|
|
|
|
|
// sql.Add(' group by C_Color,C_ColorNo having count(BCISID)>1');
|
|
|
|
|
|
//// ShowMessage(sql.Text);
|
|
|
|
|
|
// Open;
|
|
|
|
|
|
//
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if StrToFloatDef(ADOQueryTemp.fieldbyname('AA').asstring, 1) > 1 then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
// Result := False;
|
|
|
|
|
|
// Application.MessageBox('<27><>ɫɫ<C9AB><C9AB><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
///
|
|
|
|
|
|
///
|
|
|
|
|
|
///
|
|
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
with CDS_2 do
|
2024-12-14 17:23:12 +08:00
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if Trim(CDS_2.fieldbyname('BCIGID').AsString) = '' then
|
2024-12-14 17:23:12 +08:00
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if GetLSNo(ADOQueryTemp, MAXID3, 'GS', 'BS_Cloth_Info_GYSCP', 4, 1) = False then
|
2024-12-14 17:23:12 +08:00
|
|
|
|
begin
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
MAXID3 := Trim(CDS_2.fieldbyname('BCIGID').AsString);
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
sql.Add(' select * from BS_Cloth_Info_GYSCP where ');
|
|
|
|
|
|
sql.Add(' BCIGID=''' + Trim(MAXID3) + '''');
|
2024-12-14 17:23:12 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if Trim(CDS_2.fieldbyname('BCIGID').AsString) = '' then
|
2024-12-14 17:23:12 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('FillID').Value := Trim(DCode);
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('BCIID').Value := Trim(MaxBCIID);
|
2025-05-08 10:12:23 +08:00
|
|
|
|
FieldByName('BCIGID').Value := Trim(MAXID3);
|
|
|
|
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv2, CDS_2, 'BS_Cloth_Info_GYSCP', 0);
|
2024-12-14 17:23:12 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
////////////////////////// <20><><EFBFBD>浥λϵ<CEBB><CFB5><EFBFBD>ӱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
with CDS_3 do
|
2025-02-25 16:04:43 +08:00
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if Trim(CDS_3.fieldbyname('CICID').AsString) = '' then
|
2025-02-25 16:04:43 +08:00
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if GetLSNo(ADOQueryTemp, MAXID4, 'CIC', 'Bs_Cloth_Info_Coefficient', 4, 1) = False then
|
2025-02-25 16:04:43 +08:00
|
|
|
|
begin
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
MAXID4 := Trim(CDS_3.fieldbyname('CICID').AsString);
|
2025-02-25 16:04:43 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
sql.Add(' select * from Bs_Cloth_Info_Coefficient where ');
|
|
|
|
|
|
sql.Add(' CICID=''' + Trim(MAXID4) + '''');
|
2025-02-25 16:04:43 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if Trim(CDS_3.fieldbyname('CICID').AsString) = '' then
|
2025-02-25 16:04:43 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// FieldByName('FillID').Value := Trim(DCode);
|
|
|
|
|
|
// FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
// FieldByName('FillTime').Value := SGetServerDateTime(ADOQueryTemp);
|
2025-02-25 16:04:43 +08:00
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('BCIID').Value := Trim(MaxBCIID);
|
2025-05-08 10:12:23 +08:00
|
|
|
|
FieldByName('CICID').Value := Trim(MAXID4);
|
|
|
|
|
|
RTSetSaveDataCDS(ADOQueryCmd, Tv3, CDS_3, 'Bs_Cloth_Info_Coefficient', 0);
|
2025-02-25 16:04:43 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
|
2024-12-30 22:05:29 +08:00
|
|
|
|
// with ADOQueryCmd do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// SQL.Clear;
|
|
|
|
|
|
// sql.Add(' exec P_BS_CloInfo_UpAllTab @BCIID=' + QuotedStr(trim(MaxBCIID)));
|
|
|
|
|
|
// Sql.Add(',@UpId=' + quotedstr(Trim(DCode)));
|
|
|
|
|
|
// Sql.Add(',@Uper=' + quotedstr(Trim(DName)));
|
|
|
|
|
|
// ExecSQL;
|
|
|
|
|
|
// end;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
|
|
|
|
|
|
FBCIID := MaxBCIID;
|
2025-02-17 12:31:41 +08:00
|
|
|
|
InitGrid1();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
2024-12-30 22:05:29 +08:00
|
|
|
|
InitGrid1();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.CYJGGYBtnDnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBtnEditC(Sender).Text := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
procedure TfrmClothInfoInput.ToolButton10Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-05-26 14:27:08 +08:00
|
|
|
|
// maxno: string;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
SqlStr: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if FBCIID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-05-26 14:27:08 +08:00
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
frmEdit := TfrmEdit.Create(Application);
|
|
|
|
|
|
with frmEdit do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FBCIID := Self.FBCIID;
|
|
|
|
|
|
FBCISID := CDS_1.FieldByName('BCISID').Value;
|
|
|
|
|
|
FPrice :=StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid1();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmEdit.Free;
|
|
|
|
|
|
end;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// if GetLSNo(ADOQueryCmd, maxno, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('ȡ<><C8A1>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
2025-05-26 14:27:08 +08:00
|
|
|
|
// SqlStr := 'select A.* from BS_Cloth_Info_Sub A ';
|
|
|
|
|
|
// SqlStr := SqlStr + ' where A.BCIID=''' + Trim(FBCIID) + '''';
|
|
|
|
|
|
// SqlStr := SqlStr + ' ORDER BY CASE WHEN C_COLORNO NOT LIKE ''%[^0-9]%'' THEN dbo.getNum(C_Colorno) ELSE 9999999999 ';
|
|
|
|
|
|
// SqlStr := SqlStr + ' END ,C_ColorNo';
|
|
|
|
|
|
//
|
|
|
|
|
|
// InitCDSData(ADO_4, CDS_4, Tv4, SqlStr, '', '');
|
|
|
|
|
|
//
|
|
|
|
|
|
// Panel6.Visible := True;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// CopyAddRow(Tv4, CDS_4);
|
|
|
|
|
|
// with CDS_4 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// append;
|
|
|
|
|
|
// fieldbyname('BCIID').Value := FBCIID;
|
|
|
|
|
|
// fieldbyname('BCISID').Value := maxno;
|
|
|
|
|
|
// fieldbyname('floatPrice').Value := 0;
|
|
|
|
|
|
// fieldbyname('referencePrice').value := StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// TV1Column5PropertiesEditValueChanged(Sender);
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-26 14:27:08 +08:00
|
|
|
|
procedure TfrmClothInfoInput.ToolButton11Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
excelApp, WorkBook: Variant;
|
|
|
|
|
|
i, j, k, LX, ExcelRowCount: integer;
|
|
|
|
|
|
maxId, FCPID, FCPName, t1, t2, t3, FFID: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
excelApp := CreateOleObject('Excel.Application');
|
|
|
|
|
|
openDialog1.Filter := '*.CSV;*.xls';
|
|
|
|
|
|
if opendialog1.Execute then
|
|
|
|
|
|
begin
|
|
|
|
|
|
WorkBook := excelApp.WorkBooks.Open(OpenDialog1.FileName);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
exit;
|
|
|
|
|
|
excelApp.Visible := false;
|
|
|
|
|
|
ExcelRowCount := WorkBook.WorkSheets[1].UsedRange.Rows.Count;
|
|
|
|
|
|
except
|
|
|
|
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>EXCEL<45><4C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ', MB_ICONERROR);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
CDS_LM.EmptyDataSet;
|
|
|
|
|
|
|
|
|
|
|
|
for j := 0 to Tv1.ColumnCount - 1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_LM do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('LCode').Value := trim(Tv1.Columns[j].DataBinding.FieldName);
|
|
|
|
|
|
FieldByName('LName').Value := trim(Tv1.Columns[j].Caption);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
for i := 1 to 50 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if trim(WorkBook.WorkSheets[1].Cells[1, i].value) = '' then
|
|
|
|
|
|
continue;
|
|
|
|
|
|
if CDS_LM.Locate('LName', trim(WorkBook.WorkSheets[1].Cells[1, i].value), []) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_LM do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('LXH').Value := i;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
except
|
|
|
|
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ', MB_ICONERROR);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
for i := 2 to ExcelRowCount do
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
CDS_LM.First;
|
|
|
|
|
|
while not CDS_LM.Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_LM.FieldByName('LXH').AsInteger > 0 then
|
|
|
|
|
|
CDS_1.fieldbyname(CDS_LM.FieldByName('LCode').AsString).Value := WorkBook.WorkSheets[1].Cells[i, CDS_LM.FieldByName('LXH').AsInteger].Value;
|
|
|
|
|
|
CDS_LM.Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
WorkBook.Close;
|
|
|
|
|
|
excelApp.Quit;
|
|
|
|
|
|
excelApp := Unassigned;
|
|
|
|
|
|
WorkBook := Unassigned;
|
|
|
|
|
|
except
|
|
|
|
|
|
WorkBook.Close;
|
|
|
|
|
|
excelApp.Quit;
|
|
|
|
|
|
excelApp := Unassigned;
|
|
|
|
|
|
WorkBook := Unassigned;
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.ToolButton12Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_1.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫȫ<D2AA><C8AB>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
if Application.MessageBox('ȷ<>Ϻ<CFBA>ȫ<EFBFBD><C8AB>ɾ<EFBFBD><C9BE><EFBFBD>Ƿ<EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
with ADOQueryCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('delete from BS_Cloth_Info_Sub where BCIID=''' + Trim(FBCIID) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
CDS_1.EmptyDataSet;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
procedure TfrmClothInfoInput.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
MC_Code: string;
|
|
|
|
|
|
begin
|
2024-12-30 22:05:29 +08:00
|
|
|
|
ToolBar1.SetFocus;
|
2024-12-14 17:23:12 +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;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
|
2025-05-26 14:27:08 +08:00
|
|
|
|
// if CDS_1.IsEmpty then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>ɫ<EFBFBD><C9AB>ϸ!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
2025-03-20 16:38:30 +08:00
|
|
|
|
|
|
|
|
|
|
if FCTID = 'CT2412300005' then
|
2025-01-14 16:18:44 +08:00
|
|
|
|
begin
|
2025-03-20 16:38:30 +08:00
|
|
|
|
if Trim(C_FromName.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Trim(C_FromName2.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
setName();
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(C_Name.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
end;
|
2025-03-20 16:38:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 12:31:41 +08:00
|
|
|
|
// if CDS_1.Locate('C_Color', null, []) = True then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
// if CDS_1.Locate('C_ColorNo', null, []) = True then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
setName();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
2025-05-26 14:27:08 +08:00
|
|
|
|
if not CDS_1.IsEmpty then
|
|
|
|
|
|
ModalResult := 1;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
WriteCxGrid(self.Caption + 'TV1', Tv1, '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
var
|
2025-05-08 10:12:23 +08:00
|
|
|
|
SqlStr: string;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
begin
|
2025-05-08 10:12:23 +08:00
|
|
|
|
if FBCIID = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ȱ<EFBFBD><C8B1><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-26 14:27:08 +08:00
|
|
|
|
try
|
|
|
|
|
|
frmEdit := TfrmEdit.Create(Application);
|
|
|
|
|
|
with frmEdit do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FBCIID := Self.FBCIID;
|
|
|
|
|
|
FBCISID := '';
|
|
|
|
|
|
FPrice :=StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
InitGrid1();
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmEdit.Free;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-26 14:27:08 +08:00
|
|
|
|
// SqlStr := 'select A.* from BS_Cloth_Info_Sub A ';
|
|
|
|
|
|
// SqlStr := SqlStr + ' where 1<>1 ';
|
|
|
|
|
|
//
|
|
|
|
|
|
// InitCDSData(ADO_4, CDS_4, Tv4, SqlStr, '', '');
|
|
|
|
|
|
// Panel6.Visible := True;
|
|
|
|
|
|
// CopyAddRow(Tv4, CDS_4);
|
|
|
|
|
|
// with CDS_4 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// append;
|
|
|
|
|
|
// fieldbyname('BCIID').Value := FBCIID;
|
|
|
|
|
|
//// fieldbyname('BCISID').Value := maxno;
|
|
|
|
|
|
// fieldbyname('floatPrice').Value := 0;
|
|
|
|
|
|
// fieldbyname('referencePrice').value := StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// end;
|
2025-02-17 12:31:41 +08:00
|
|
|
|
// TV1Column5PropertiesEditValueChanged(Sender);
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_1.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(CDS_1.fieldbyname('BCISID').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 from BS_Cloth_Info_Sub where BCISID=''' + Trim(CDS_1.fieldbyname('BCISID').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
CDS_1.Delete;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-25 16:04:43 +08:00
|
|
|
|
procedure TfrmClothInfoInput.ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
// if GetLSNo(ADOQueryCmd, maxno, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('ȡ<><C8A1>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with CDS_2 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
APPEND;
|
|
|
|
|
|
fieldbyname('BCIGID').Value := NULL;
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
procedure TfrmClothInfoInput.Button1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-05-26 14:27:08 +08:00
|
|
|
|
CDS_4.EmptyDataSet;
|
|
|
|
|
|
// Panel6.Visible := False;
|
2025-05-08 10:12:23 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-17 12:31:41 +08:00
|
|
|
|
procedure TfrmClothInfoInput.CostPricePropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue, FFieldName: string;
|
|
|
|
|
|
MCostPrice, MfloatPrice: Double;
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
MCostPrice := StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
MfloatPrice := Fieldbyname('floatPrice').AsFloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('referencePrice').Value := MfloatPrice + MCostPrice;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-25 16:04:43 +08:00
|
|
|
|
procedure TfrmClothInfoInput.cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmCompanySel := TfrmCompanySel.Create(Application);
|
|
|
|
|
|
with frmCompanySel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
FCoType := '<27><>Ӧ<EFBFBD><D3A6>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with CDS_2 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
edit;
|
|
|
|
|
|
FieldByName('FACTORYNAME').AsString := Trim(CDS_1.fieldbyname('CoName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmCompanySel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
procedure TfrmClothInfoInput.cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'CICUnit';
|
|
|
|
|
|
flagname := '<27><>λ';
|
|
|
|
|
|
MainType := '<27><>λϵ<CEBB><CFB5>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('CICUnit').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
procedure TfrmClothInfoInput.CYColorKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = #13 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
SelectNext(ActiveControl as TWinControl, True, True);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.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><>ƷƷ<C6B7><C6B7><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmAttachmentUpload.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-02-25 16:04:43 +08:00
|
|
|
|
procedure TfrmClothInfoInput.ToolButton7Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_2.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(CDS_2.fieldbyname('BCIGID').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 from BS_Cloth_Info_GYSCP where BCIGID=''' + Trim(CDS_1.fieldbyname('BCIGID').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
CDS_2.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2025-05-08 10:12:23 +08:00
|
|
|
|
procedure TfrmClothInfoInput.ToolButton8Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
// if GetLSNo(ADOQueryCmd, maxno, 'YS', 'BS_Cloth_Info_Sub', 4, 1) = False then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('ȡ<><C8A1>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with CDS_3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
APPEND;
|
|
|
|
|
|
fieldbyname('CICID').Value := NULL;
|
|
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothInfoInput.ToolButton9Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_3.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(CDS_3.fieldbyname('CICID').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 from Bs_Cloth_Info_Coefficient where CICID=''' + Trim(CDS_1.fieldbyname('CICID').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
CDS_3.Delete;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-30 22:05:29 +08:00
|
|
|
|
procedure TfrmClothInfoInput.TV1Column5PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue, FFieldName: string;
|
|
|
|
|
|
MCostPrice, MfloatPrice: Double; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۣ<EFBFBD><DBA3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|
|
|
|
|
if Trim(mvalue) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := '0';
|
|
|
|
|
|
end;
|
|
|
|
|
|
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|
|
|
|
|
MCostPrice := StrToFloatDef(CostPrice.Text, 0);
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
MfloatPrice := Fieldbyname('floatPrice').AsFloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('referencePrice').Value := MfloatPrice + MCostPrice;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
end.
|
|
|
|
|
|
|