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,
|
|
|
|
|
|
dxScrollbarAnnotations, cxMemo, dxSkinsCore, dxSkinsDefaultPainters;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmClothInfoInput = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
C_Code: TcxTextEdit;
|
|
|
|
|
|
C_Name: TcxTextEdit;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
ToolButton6: TToolButton;
|
|
|
|
|
|
BCIID: TcxTextEdit;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
C_GramWeight: TcxButtonEdit;
|
|
|
|
|
|
C_Composition: TcxButtonEdit;
|
|
|
|
|
|
C_Spec: TcxButtonEdit;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
C_FromName: TcxButtonEdit;
|
|
|
|
|
|
C_Width: TcxButtonEdit;
|
|
|
|
|
|
C_Pattern: TcxButtonEdit;
|
|
|
|
|
|
CINote: TcxMemo;
|
|
|
|
|
|
GC_Name: TcxTextEdit;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
C_EComposition: TcxButtonEdit;
|
|
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
C_YarnSpec: TcxTextEdit;
|
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
|
CraftCode: TcxTextEdit;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
FtyNo: TcxTextEdit;
|
|
|
|
|
|
FtyName: TcxTextEdit;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
DyeingMethod: TcxTextEdit;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
ToolBar2: TToolBar;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
TV1: TcxGridDBTableView;
|
|
|
|
|
|
TV1Column1: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column2: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column3: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column4: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel2: TcxGridLevel;
|
|
|
|
|
|
DS_1: TDataSource;
|
|
|
|
|
|
CDS_1: TClientDataSet;
|
|
|
|
|
|
GPM_1: TcxGridPopupMenu;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
2024-12-30 22:05:29 +08:00
|
|
|
|
CostPrice: TcxCurrencyEdit;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
distributionCoefficient: TcxCurrencyEdit;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
quota: TcxCurrencyEdit;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
Label14: TLabel;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
StkPosition: TcxButtonEdit;
|
|
|
|
|
|
TV1Column5: TcxGridDBColumn;
|
|
|
|
|
|
TV1Column6: TcxGridDBColumn;
|
2024-12-31 16:22:23 +08:00
|
|
|
|
C_FromName2: TcxButtonEdit;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
Label24: TLabel;
|
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);
|
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();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
function SaveData(): Boolean;
|
2025-01-14 16:18:44 +08:00
|
|
|
|
procedure setName();
|
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
|
|
|
|
|
|
U_DataLink, U_RTFun, U_iniParam, U_ZDYHelp, U_AttachmentUpload, U_ClothInfoSel;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
2025-01-14 16:18:44 +08:00
|
|
|
|
procedure TfrmClothInfoInput.setName();
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if (Trim(C_FromName.Text) <> '') and (Trim(C_FromName2.Text) <> '') then
|
|
|
|
|
|
C_Name.Text := Trim(C_FromName.Text) + '+' + Trim(C_FromName2.Text);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-30 22:05:29 +08:00
|
|
|
|
procedure TfrmClothInfoInput.InitGrid1();
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select A.* from BS_Cloth_Info_Sub A ');
|
|
|
|
|
|
sql.Add(' where A.BCIID=''' + Trim(FBCIID) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQueryTemp, CDS_1);
|
|
|
|
|
|
SInitCDSData(ADOQueryTemp, CDS_1);
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
SCSHData(ADOQueryTemp, ScrollBox1, 2);
|
|
|
|
|
|
// 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>
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
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();
|
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-01-14 16:18:44 +08:00
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
InitGrid();
|
2024-12-30 22:05:29 +08:00
|
|
|
|
InitGrid1();
|
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.Enabled := False;
|
|
|
|
|
|
// CostPrice.ParentFont := False;
|
|
|
|
|
|
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
|
|
|
|
|
|
MaxBCIID, MaxBCPID, maxId2: string;
|
|
|
|
|
|
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);
|
|
|
|
|
|
if trim(C_Code.Text) = '' then
|
|
|
|
|
|
C_Code.Text := Trim(MaxBCIID);
|
|
|
|
|
|
RTSetsavedata(ADOQueryCmd, 'BS_Cloth_Info', ScrollBox1, 2);
|
|
|
|
|
|
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>
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-12-31 16:22:23 +08:00
|
|
|
|
end;
|
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>
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-12-31 16:22:23 +08:00
|
|
|
|
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> //////////////////////////
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
2024-12-30 22:05:29 +08:00
|
|
|
|
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');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
if FieldByName('AA').AsInteger > 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
Application.MessageBox('<27><>ɫɫ<C9AB><C9AB><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-12-14 17:23:12 +08:00
|
|
|
|
////////////////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////////
|
|
|
|
|
|
///
|
|
|
|
|
|
///
|
|
|
|
|
|
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;
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
if CDS_1.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>ɫ<EFBFBD><C9AB>ϸ!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Trim(C_Name.Text) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CDS_1.Locate('C_Color', null, []) = True then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CDS_1.Locate('C_ColorNo', null, []) = True then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
setName();
|
2024-12-14 17:23:12 +08:00
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
ModalResult := 1;
|
|
|
|
|
|
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
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
CopyAddRow(Tv1, CDS_1);
|
|
|
|
|
|
|
|
|
|
|
|
with CDS_1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
fieldbyname('BCISID').Value := trim(maxno);
|
2025-01-14 16:18:44 +08:00
|
|
|
|
fieldbyname('floatPrice').Value := 0;
|
2024-12-14 17:23:12 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|