2025-04-16 09:11:01 +08:00
|
|
|
|
unit U_ClothContractInPut_CG;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Windows, Messages, strUtils, SysUtils, cxTextEdit, Variants, Classes, Graphics,
|
|
|
|
|
Controls, Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
2025-04-16 09:11:01 +08:00
|
|
|
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
2025-04-27 16:59:54 +08:00
|
|
|
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
|
|
|
|
|
cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer, cxMaskEdit, cxButtonEdit,
|
|
|
|
|
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxDropDownEdit,
|
|
|
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels, cxLookAndFeelPainters,
|
|
|
|
|
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
|
|
|
|
|
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
|
|
|
|
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
|
|
|
|
|
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
|
|
|
|
|
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
2025-04-16 09:11:01 +08:00
|
|
|
|
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
|
|
|
|
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
|
|
|
|
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
2025-04-27 16:59:54 +08:00
|
|
|
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
|
|
|
|
|
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
|
|
|
|
|
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
|
|
|
|
|
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
|
|
|
|
|
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
TfrmClothContractInPut_CG = class(TForm)
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
ConNo: TEdit;
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
DeliveryDate: TDateTimePicker;
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
ToolBar2: TToolBar;
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
v1PRTSpec: TcxGridDBColumn;
|
|
|
|
|
v1PRTColor: TcxGridDBColumn;
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
|
|
v1PRTKZ: TcxGridDBColumn;
|
|
|
|
|
v1ClothQty: TcxGridDBColumn;
|
|
|
|
|
v1PRTQty: TcxGridDBColumn;
|
|
|
|
|
v1Price: TcxGridDBColumn;
|
|
|
|
|
v1ClothUnit: TcxGridDBColumn;
|
|
|
|
|
ADOTemp: TADOQuery;
|
|
|
|
|
ADOCmd: TADOQuery;
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
Order_Sub: TClientDataSet;
|
|
|
|
|
DataSource2: TDataSource;
|
|
|
|
|
ADOZDY: TADOQuery;
|
|
|
|
|
CDS_ZDY: TClientDataSet;
|
|
|
|
|
FactoryNoName: TcxButtonEdit;
|
|
|
|
|
ADOQueryTmp: TADOQuery;
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
PanZDY: TPanel;
|
|
|
|
|
CXGridZDY: TcxGrid;
|
|
|
|
|
TVZDY: TcxGridDBTableView;
|
|
|
|
|
VHelpZDYName: TcxGridDBColumn;
|
|
|
|
|
CXGridZDYLevel1: TcxGridLevel;
|
|
|
|
|
Button1: TButton;
|
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
QDTime: TDateTimePicker;
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
CompanyName: TcxButtonEdit;
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
v1Column5: TcxGridDBColumn;
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
LXPerson: TEdit;
|
|
|
|
|
LXTel: TEdit;
|
|
|
|
|
JHPlace: TcxButtonEdit;
|
|
|
|
|
QDPalce: TcxButtonEdit;
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure Button1Click(Sender: TObject);
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure PRTCodeNameKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure TVZDYKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure FactoryNoNamePropertiesChange(Sender: TObject);
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
procedure JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure v1Column1PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
procedure v1PricePropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
private
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FXS: Integer;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure InitData();
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
function YFData(fMainID, FsubID: string): Boolean;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
2025-04-27 16:59:54 +08:00
|
|
|
|
PState: Integer;
|
|
|
|
|
FMainId: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frmClothContractInPut_CG: TfrmClothContractInPut_CG;
|
|
|
|
|
|
|
|
|
|
implementation
|
2025-04-27 16:59:54 +08:00
|
|
|
|
|
2025-04-16 09:11:01 +08:00
|
|
|
|
uses
|
2025-04-27 16:59:54 +08:00
|
|
|
|
U_DataLink, U_ZDYHelp, U_Fun, U_ZdyAttachGYS, U_ZdyAttachCP;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
2025-04-27 16:59:54 +08:00
|
|
|
|
function TfrmClothContractInPut_CG.YFData(fMainID, FsubID: string): Boolean;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
var
|
2025-04-27 16:59:54 +08:00
|
|
|
|
CRID, OrdMainId, YFID, FComTaiTou, FCRID, FFactoryName: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Result := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
try
|
|
|
|
|
with ADOQueryTmp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(FactoryNoName.Text) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
if not ADOQueryTmp.IsEmpty then
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
CRID := ADOQueryTmp.fieldbyname('CRID').AsString;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('Update YF_Money_CRID set CRID=CRID+1');
|
|
|
|
|
sql.Add('select * from YF_Money_CRID ');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
CRID := ADOCmd.fieldbyname('CRID').AsString;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
sql.Add('select * from YF_Money_KC ');
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.add('where CRID=' + quotedstr(trim(CRID)));
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Append;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|
|
|
|
FieldByName('FactoryName').Value := Trim(FactoryNoName.Text);
|
|
|
|
|
FieldByName('ZdyStr1').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
with ADOQueryTmp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('select * from YF_Money_CR where mainID=''' + Trim(fMainID) + '''');
|
|
|
|
|
sql.Add('and subID=''' + Trim(FsubID) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
sql.Add('and YFName=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
if ADOQueryTmp.IsEmpty then
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if GetLSNo(ADOCmd, YFID, 'YF', 'YF_Money_CR', 3, 1) = False then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
YFID := Trim(ADOQueryTmp.fieldbyname('YFID').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('select * from YF_Money_CR where YFID=''' + Trim(YFID) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
if ADOQueryTmp.IsEmpty then
|
|
|
|
|
Append
|
|
|
|
|
else
|
|
|
|
|
Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('YFID').Value := Trim(YFID);
|
|
|
|
|
FieldByName('YFTypeId').Value := Trim(ConNo.Text);
|
|
|
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
FieldByName('CRType').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>';
|
|
|
|
|
FieldByName('CRFlag').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|
|
|
|
FieldByName('QtyFlag').Value := 1;
|
|
|
|
|
FieldByName('FactoryName').Value := Trim(FactoryNoName.Text);
|
|
|
|
|
FieldByName('CRTime').Value := formatDateTime('yyyy-MM-dd', DeliveryDate.Date);
|
|
|
|
|
FieldByName('Qty').Value := Order_Sub.fieldbyname('C_Qty').Value;
|
|
|
|
|
FieldByName('PS').Value := Order_Sub.fieldbyname('Qty1').Value;
|
|
|
|
|
FieldByName('YFType').Value := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
FieldByName('Price').Value := Order_Sub.fieldbyname('Price').asfloat;
|
|
|
|
|
FieldByName('HuiLv').Value := 1;
|
|
|
|
|
FieldByName('BZType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
FieldByName('ComTaiTou').Value := Trim(FComTaiTou);
|
|
|
|
|
FieldByName('QtyUnit').Value := Trim(Order_Sub.fieldbyname('C_Unit').AsString);
|
|
|
|
|
FieldByName('YFName').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
FieldByName('MainId').Value := Trim(fMainID);
|
|
|
|
|
FieldByName('subID').Value := Trim(FsubID);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('Update YF_Money_CR Set Money=Price*Qty,BBMoney=Price*Qty');
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add(' where YFID=''' + Trim(YFID) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add(' Update YF_Money_KC Set KCMoney=(select isnull(Sum(Money*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
|
|
|
|
|
sql.Add(',KCBBMoney=(select isnull(Sum(BBMoney*QtyFlag),0) from YF_Money_CR A where A.CRID=YF_Money_KC.CRID)');
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add(' where CRID=' + CRID);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Result := True;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
except
|
|
|
|
|
end;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.TBCloseClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.InitData();
|
|
|
|
|
begin
|
|
|
|
|
with ADOQueryTmp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
sql.Add(' exec ClothContract_QryList :MainId,:WSql');
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if PState = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
ADOQueryTmp.Parameters.ParamByName('MainId').Value := Trim(fMainID);
|
|
|
|
|
ADOQueryTmp.Parameters.ParamByName('WSQl').Value := '';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if PState = 0 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
ADOQueryTmp.Parameters.ParamByName('MainId').Value := Trim(fMainID);
|
|
|
|
|
ADOQueryTmp.Parameters.ParamByName('WSql').Value := ' and 1<>1 ';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
SCreateCDS20(ADOQueryTmp, Order_Sub);
|
|
|
|
|
SInitCDSData20(ADOQueryTmp, Order_Sub);
|
|
|
|
|
SCSHData(ADOQueryTmp, ScrollBox1, 0);
|
|
|
|
|
if PState = 0 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
sql.Add('select Top 1* from Contract_Main order by FillTime desc ');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
QDTime.DateTime := SGetServerDate(ADOTemp);
|
|
|
|
|
DeliveryDate.DateTime := SGetServerDate(ADOTemp);
|
|
|
|
|
QDTime.Checked := True;
|
|
|
|
|
DeliveryDate.Checked := False;
|
|
|
|
|
ConNo.Text := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
PanZDY.Visible := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
var
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FType, ZDYName, FText: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
PanZDY.Visible := True;
|
|
|
|
|
PanZDY.Left := FButn.Left;
|
|
|
|
|
PanZDY.Top := FButn.Top + FButn.Height;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with ADOZDY do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Filtered := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
SQL.Add('select RTrim(ZDYNo) ZDYNo,RTrim(ZDYName) ZDYName from KH_ZDY where Type=''' + Trim(LType) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FText := Trim(FButn.Text);
|
|
|
|
|
if FText <> '' then
|
|
|
|
|
SDofilter(ADOZDY, ' ZDYName like ' + QuotedStr('%' + Trim(FText) + '%'))
|
2025-04-16 09:11:01 +08:00
|
|
|
|
else
|
2025-04-27 16:59:54 +08:00
|
|
|
|
SDofilter(ADOZDY, '');
|
|
|
|
|
VHelpZDYName.Summary.GroupFormat := Trim(FButn.Name);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.TVZDYCellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
var
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FName: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if ADOZDY.IsEmpty then
|
|
|
|
|
Exit;
|
|
|
|
|
FName := Trim(VHelpZDYName.Summary.GroupFormat);
|
|
|
|
|
TcxButtonEdit(FindComponent(FName)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString);
|
|
|
|
|
TcxButtonEdit(FindComponent(FName)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString);
|
|
|
|
|
PanZDY.Visible := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.Button1Click(Sender: TObject);
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
PanZDY.Visible := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.PRTCodeNameKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
{if (key=vk_return) or (Key=vk_Down) then
|
|
|
|
|
begin
|
|
|
|
|
if ADOZDY.Active then
|
|
|
|
|
CXGridZDY.SetFocus;
|
|
|
|
|
end; }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.TVZDYKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Key = #13 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if ADOZDY.IsEmpty then
|
|
|
|
|
Exit;
|
|
|
|
|
TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Text := Trim(ADOZDY.fieldbyname('ZDYName').AsString);
|
|
|
|
|
TcxButtonEdit(FindComponent(VHelpZDYName.Summary.GroupFormat)).Hint := Trim(ADOZDY.fieldbyname('ZDYNO').AsString);
|
|
|
|
|
PanZDY.Visible := False;
|
|
|
|
|
ADOZDY.Active := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.FormShow(Sender: TObject);
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(DParameters1) = '1' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
v1Price.Visible := False;
|
|
|
|
|
v1ClothQty.Visible := False;
|
|
|
|
|
v1PRTQty.Visible := False;
|
|
|
|
|
end
|
|
|
|
|
else
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
v1Price.Visible := True;
|
|
|
|
|
v1ClothQty.Visible := True;
|
|
|
|
|
v1PRTQty.Visible := True;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
readCXgrid(self.Caption, tv1);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
InitData();
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
function TfrmClothContractInPut_CG.SaveData(): Boolean;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
var
|
2025-04-27 16:59:54 +08:00
|
|
|
|
maxno: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
SQL.Add('select * from Contract_Main where MainId=''' + Trim(fMainID) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(fMainID) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Append;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if GetLSNo(ADOTemp, maxno, 'C', 'Contract_Main', 3, 1) = False then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
exit;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
conNo.Text := trim(maxno);
|
|
|
|
|
if GetLSNo(ADOTemp, maxno, 'CM', 'Contract_Main', 3, 1) = False then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end
|
2025-04-27 16:59:54 +08:00
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
maxno := Trim(fMainID);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Edit;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('MainId').Value := Trim(maxno);
|
|
|
|
|
SSetsaveSql(ADOCmd, 'Contract_Main', ScrollBox1, 0);
|
|
|
|
|
FieldByName('LXPerson').Value := Trim(LXPerson.Text);
|
|
|
|
|
FieldByName('LXTel').Value := Trim(LXTel.Text);
|
|
|
|
|
if Trim(fMainID) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
end
|
|
|
|
|
else
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('ConType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9>ƻ<EFBFBD>';
|
|
|
|
|
FieldByName('status').Value := '0';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
fMainID := Trim(maxno);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
begin
|
|
|
|
|
First;
|
|
|
|
|
while not Eof do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(Order_Sub.fieldbyname('C_Unit').AsString) = 'Kg' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if GetLSNo(ADOTemp, maxno, 'CS', 'Contract_Sub', 3, 1) = False then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
end
|
|
|
|
|
else
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
maxno := Trim(Order_Sub.fieldbyname('SubId').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
SQL.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('select * from Contract_Sub where MainId=''' + Trim(fMainID) + '''');
|
|
|
|
|
sql.Add(' and SubId=''' + Trim(maxno) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(Order_Sub.fieldbyname('SubId').AsString) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Append
|
|
|
|
|
else
|
|
|
|
|
Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('MainId').Value := Trim(fMainID);
|
|
|
|
|
FieldByName('SubId').Value := Trim(maxno);
|
|
|
|
|
FieldByName('ConNo').Value := Trim(ConNo.Text);
|
|
|
|
|
RTSetSaveDataCDS(ADOCmd, Tv1, Order_Sub, 'Contract_Sub', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('C_status').Value := '0';
|
|
|
|
|
if Trim(Order_Sub.fieldbyname('C_Qty').AsString) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('C_Qty').Value := 0;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(Order_Sub.fieldbyname('Qty1').AsString) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('Qty1').Value := 0;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(Order_Sub.fieldbyname('Price').AsString) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('Price').Value := 0;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(Order_Sub.fieldbyname('C_Unit').AsString) = 'Kg' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Order_Sub.fieldbyname('MFQty').AsFloat * Order_Sub.fieldbyname('KZQty').AsFloat > 0 then
|
|
|
|
|
FieldByName('MQty').Value := Order_Sub.fieldbyname('C_Qty').Value * 1.00 * 1000 / (Order_Sub.fieldbyname('MFQty').Value * 1.00 / 100 * Order_Sub.fieldbyname('KZQty').Value);
|
|
|
|
|
end
|
|
|
|
|
else
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('MQty').Value := Order_Sub.fieldbyname('C_Qty').Value;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Order_Sub.FieldByName('SubId').Value := Trim(maxno);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
|
|
|
|
{ if not YFData(FMainId,maxno) then
|
|
|
|
|
begin
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
exit;
|
|
|
|
|
end; }
|
|
|
|
|
//Order_Sub.Post;
|
|
|
|
|
Next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Result := True;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
except
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Result := False;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.TBSaveClick(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
DeliveryDate.SetFocus;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(ConNo.Text) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(FactoryNoName.Text) = '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
exit;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Order_Sub.Locate('C_Qty', null, []) then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Order_Sub.Locate('C_Unit', null, []) then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
{ if Order_Sub.Locate('KZQty',null,[]) then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
if Order_Sub.Locate('MFQty',null,[]) then
|
|
|
|
|
begin
|
|
|
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|
|
|
|
Exit;
|
|
|
|
|
end; }
|
|
|
|
|
if SaveData() then
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
ConNo.Text := '<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
FactoryNoName.Text := '';
|
|
|
|
|
CompanyName.Text := '';
|
|
|
|
|
LXPerson.Text := '';
|
|
|
|
|
LXTel.Text := '';
|
|
|
|
|
JHPlace.Text := '';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Order_Sub.EmptyDataSet;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
PState := 0;
|
|
|
|
|
fMainID := '';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1OrderUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'OrdUnit';
|
|
|
|
|
flagname := '<27><>λ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('OrderUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1PRTUnitPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'OrdUnit';
|
|
|
|
|
flagname := '<27><>λ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('PRTUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1PRTColorPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'OrdColor';
|
|
|
|
|
flagname := '<27><>ɫ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('PRTColor').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.ToolButton1Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Append;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
fieldbyname('PriceUnit').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
fieldbyname('C_UNit').Value := 'M';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure TfrmClothContractInPut_CG.ToolButton2Click(Sender: TObject);
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
Exit;
|
|
|
|
|
if Trim(Order_Sub.fieldbyname('SubId').AsString) <> '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select * from Contract_sub ');
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('where fromsubID=''' + Trim(Order_Sub.fieldbyname('SubId').AsString) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
open;
|
|
|
|
|
end;
|
|
|
|
|
if not ADOCmd.IsEmpty then
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Application.MessageBox('<27>ѵ<EFBFBD><D1B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ɹ<EFBFBD><C9B9>ƻ<EFBFBD><C6BB><EFBFBD>', '<27><>ʾ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Exit
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
Exit;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with ADOCmd do
|
|
|
|
|
begin
|
|
|
|
|
Close;
|
|
|
|
|
sql.Clear;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('delete Contract_Sub where SubId=''' + Trim(Order_Sub.fieldbyname('SubId').AsString) + '''');
|
2025-04-16 09:11:01 +08:00
|
|
|
|
ExecSQL;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
Order_Sub.Delete;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.FactoryNoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ try
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
|
|
|
|
flag:='FactoryNo1Name';
|
|
|
|
|
flagname:='<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
MainType:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
begin
|
|
|
|
|
FXS:=99;
|
|
|
|
|
FactoryNoName.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
FactoryNoName.Hint:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end; }
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
try
|
|
|
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZdyAttachGYS do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FactoryNoName.Text := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
|
|
|
|
|
FactoryNoName.Hint := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
|
|
|
|
LXTel.Text := Trim(CDS_HZ.fieldbyname('DEFstr2').AsString);
|
|
|
|
|
LXPerson.Text := Trim(CDS_HZ.fieldbyname('DEFstr4').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZdyAttachGYS.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1Column1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
try
|
|
|
|
|
frmZdyAttachCP := TfrmZdyAttachCP.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZdyAttachCP do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FType := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('C_Code').Value := Trim(CDS_HZ.fieldbyname('ZdyCode').AsString);
|
|
|
|
|
Self.Order_Sub.FieldByName('C_CodeName').Value := Trim(CDS_HZ.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
// Self.Order_Sub.FieldByName('Color').Value:=Trim(CDS_HZ.fieldbyname('DEFstr3').AsString);
|
|
|
|
|
// Self.Order_Sub.FieldByName('SOrddefstr4').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
|
|
|
|
Self.Order_Sub.Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZdyAttachCP.Free;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
self.tv1.Controller.EditingController.ShowEdit();
|
2025-04-16 09:11:01 +08:00
|
|
|
|
{ try
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
|
|
|
|
flag:='MPRTCodeName';
|
|
|
|
|
flagname:='<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
|
|
|
|
V1Name.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
V1Note.Caption:='Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
// MainType:=Trim(DName);
|
|
|
|
|
fnote:=FALSE;
|
|
|
|
|
// flag:='Cloth';
|
|
|
|
|
// flagname:='<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
|
|
|
|
Self.Order_Sub.FieldByName('C_CodeName').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString)+'#';
|
|
|
|
|
Self.Order_Sub.FieldByName('C_Code').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;}
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1PRTMFPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'KZ';
|
|
|
|
|
flagname := '<27><><EFBFBD>ص<EFBFBD>λ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('KZUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1OrderQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'MF';
|
|
|
|
|
flagname := '<27>ŷ<EFBFBD><C5B7><EFBFBD>λ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('MFUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1ClothQtyPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'PriceUnit';
|
|
|
|
|
flagname := '<27>Ƽ۵<C6BC>λ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('PriceUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1Column2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'OrderUnit';
|
|
|
|
|
flagname := '<27><>λ';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
Self.Order_Sub.Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
Self.Order_Sub.FieldByName('C_Unit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.FactoryNoNamePropertiesChange(Sender: TObject);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
{if FXS=99 then
|
|
|
|
|
begin
|
|
|
|
|
PanZDY.Visible:=False;
|
|
|
|
|
FXS:=0;
|
|
|
|
|
Exit;
|
|
|
|
|
end;
|
|
|
|
|
ZDYHelp(FactoryNoName,'FactoryNo1Name'); }
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.CompanyNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
try
|
2025-04-27 16:59:54 +08:00
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
flag := 'OrdDefStr2';
|
|
|
|
|
flagname := '<27>跽';
|
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FXS := 99;
|
|
|
|
|
CompanyName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.JHPlacePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
|
|
|
|
{ try
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
begin
|
|
|
|
|
flag:='JHPLACEFLAG';
|
|
|
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>';
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
begin
|
|
|
|
|
// FXS:=99;
|
|
|
|
|
JHPlace.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
end; }
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
try
|
|
|
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with frmZdyAttachGYS do
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if ShowModal = 1 then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
QDPalce.Text := Trim(CDS_HZ.fieldbyname('zdyName').AsString);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
frmZdyAttachGYS.Free;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1Column1PropertiesEditValueChanged(Sender: TObject);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
var
|
2025-04-27 16:59:54 +08:00
|
|
|
|
mvalue: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if trim(mvalue) = '' then
|
|
|
|
|
exit;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if rightBstr(trim(mvalue), 1) <> '#' then
|
|
|
|
|
begin
|
|
|
|
|
mvalue := trim(mvalue) + '#';
|
|
|
|
|
end;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('C_CodeName').Value := Trim(mvalue);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
sql.Clear;
|
|
|
|
|
sql.Add('select * from KH_Zdy_Attachment A ');
|
2025-04-27 16:59:54 +08:00
|
|
|
|
sql.Add('where zdyName=' + quotedstr(trim(Order_Sub.fieldbyname('C_CodeName').AsString)));
|
2025-04-16 09:11:01 +08:00
|
|
|
|
open;
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if ADOTemp.IsEmpty then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with Order_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('C_CodeName').Value := '';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
self.tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.v1PricePropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
mvalue, fieldname: string;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
if Trim(TcxTextEdit(Sender).EditingText) <> '' then
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|
|
|
|
end
|
|
|
|
|
else
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
mvalue := '0';
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
with Order_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName(Trim(fieldname)).Value := mvalue;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
begin
|
|
|
|
|
Edit;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
FieldByName('money').Value := strtofloat(format('%.2f', [FieldByName('C_Qty').AsFloat * FieldByName('Price').AsFloat]));
|
2025-04-16 09:11:01 +08:00
|
|
|
|
Post;
|
|
|
|
|
end;
|
|
|
|
|
self.tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
end;
|
2025-04-27 16:59:54 +08:00
|
|
|
|
|
2025-04-16 09:11:01 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.FormCreate(Sender: TObject);
|
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
cxgrid1.Align := alclient;
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
|
2025-04-27 16:59:54 +08:00
|
|
|
|
procedure TfrmClothContractInPut_CG.FormClose(Sender: TObject; var Action: TCloseAction);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
begin
|
2025-04-27 16:59:54 +08:00
|
|
|
|
writeCXgrid(self.Caption, tv1);
|
2025-04-16 09:11:01 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|
2025-04-27 16:59:54 +08:00
|
|
|
|
|