2024-08-10 17:13:44 +08:00
|
|
|
|
unit U_BaoguanInPut;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
|
|
|
|
|
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
|
|
|
|
|
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
|
|
|
|
|
|
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
|
|
|
|
|
|
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils,
|
|
|
|
|
|
cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
|
|
|
|
|
|
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
|
|
|
|
|
|
dxDateRanges, dxBarBuiltInMenu, dxDateTimeWheelPicker, dxGDIPlusClasses,
|
|
|
|
|
|
Vcl.Menus, MovePanel, cxCheckBox, cxImage, cxDBEdit, Vcl.DBCtrls, U_BaseInput,
|
|
|
|
|
|
System.ImageList, Vcl.ImgList, IdBaseComponent, IdComponent, IdTCPConnection,
|
|
|
|
|
|
IdTCPClient, IdExplicitTLSClientServerBase, IdFTP, ShellAPI, cxSplitter,
|
|
|
|
|
|
dxSkinWXI, dxScrollbarAnnotations;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmBaoguanInPut = class(TfrmBaseInput)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
ADOTemp: TADOQuery;
|
|
|
|
|
|
ADOCmd: TADOQuery;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
DS_2: TDataSource;
|
|
|
|
|
|
BG_Sub: TClientDataSet;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
ConNo: TEdit;
|
|
|
|
|
|
Label14: TLabel;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
CKS: TBtnEditC;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
cxgrdpmn1: TcxGridPopupMenu;
|
|
|
|
|
|
pm_sub: TPopupMenu;
|
|
|
|
|
|
N1: TMenuItem;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
ADOQueryImage: TADOQuery;
|
|
|
|
|
|
DS_ImgHX: TDataSource;
|
|
|
|
|
|
Qry_ImgHX: TADOQuery;
|
|
|
|
|
|
IdFTP1: TIdFTP;
|
|
|
|
|
|
N2: TMenuItem;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
ADOQuery1: TADOQuery;
|
|
|
|
|
|
ADOQuery2: TADOQuery;
|
|
|
|
|
|
ADOQuery3: TADOQuery;
|
|
|
|
|
|
ToolBar3: TToolBar;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
ToolButton5: TToolButton;
|
|
|
|
|
|
DataSource2: TDataSource;
|
|
|
|
|
|
Sub_CB: TClientDataSet;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOGY1: TADOQuery;
|
|
|
|
|
|
ADOGY2: TADOQuery;
|
|
|
|
|
|
ADOGY3: TADOQuery;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
|
TV2: TcxGridDBTableView;
|
|
|
|
|
|
v1XHNo: TcxGridDBColumn;
|
|
|
|
|
|
VC_SCSCode: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|
|
|
|
|
v1Column7: TcxGridDBColumn;
|
|
|
|
|
|
v1PRTOrderQty: TcxGridDBColumn;
|
|
|
|
|
|
v1OrderUnit: TcxGridDBColumn;
|
|
|
|
|
|
v1PRTPrice: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn9: TcxGridDBColumn;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
TV2Column1: TcxGridDBColumn;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
TV2Column2: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column3: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column4: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column5: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column6: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column7: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column8: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column9: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column10: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column11: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column12: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column13: TcxGridDBColumn;
|
|
|
|
|
|
TV2Column14: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
FPNO: TEdit;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
FPDate: TDateTimePicker;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
ZMXZ: TBtnEditC;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
PONO: TEdit;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
HTDate: TDateTimePicker;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
HB: TBtnEditC;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
LJKA: TBtnEditC;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
ChuyunG: TBtnEditC;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
BZType: TBtnEditC;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
MYType: TBtnEditC;
|
|
|
|
|
|
Label24: TLabel;
|
|
|
|
|
|
SBDate: TDateTimePicker;
|
|
|
|
|
|
Label25: TLabel;
|
|
|
|
|
|
BGTK: TBtnEditC;
|
|
|
|
|
|
Label26: TLabel;
|
|
|
|
|
|
Label27: TLabel;
|
|
|
|
|
|
HYDL: TBtnEditC;
|
|
|
|
|
|
Label28: TLabel;
|
|
|
|
|
|
Label30: TLabel;
|
|
|
|
|
|
CGS: TBtnEditC;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Label32: TLabel;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
CustName: TBtnEditC;
|
|
|
|
|
|
Label33: TLabel;
|
|
|
|
|
|
Label35: TLabel;
|
|
|
|
|
|
ZZMDG: TBtnEditC;
|
|
|
|
|
|
DPNo: TEdit;
|
|
|
|
|
|
HGCode: TBtnEditC;
|
|
|
|
|
|
YunFee: TEdit;
|
|
|
|
|
|
BANo: TEdit;
|
|
|
|
|
|
BaoFee: TEdit;
|
|
|
|
|
|
Note: TEdit;
|
|
|
|
|
|
TDNo: TEdit;
|
|
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
KHDate: TDateTimePicker;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
batchNo: TEdit;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
HG: TBtnEditC;
|
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
|
YSType: TBtnEditC;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
DYG: TBtnEditC;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
MYG: TBtnEditC;
|
|
|
|
|
|
Label36: TLabel;
|
|
|
|
|
|
DaohuoG: TBtnEditC;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
JHType: TBtnEditC;
|
|
|
|
|
|
TV2Column15: TcxGridDBColumn;
|
2024-11-02 16:32:38 +08:00
|
|
|
|
TV2Column16: TcxGridDBColumn;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBSaveClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton5Click(Sender: TObject);
|
2024-08-21 14:03:11 +08:00
|
|
|
|
procedure CKSBtnDnClick(Sender: TObject);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
procedure v1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v1Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v1Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure SalesmanBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure v1Column15PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure v1PRTOrderQtyPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure QiYunBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure N1Click(Sender: TObject);
|
|
|
|
|
|
procedure Pic_Image1DblClick(Sender: TObject);
|
|
|
|
|
|
procedure cxDBImage1DblClick(Sender: TObject);
|
|
|
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure ExchangeRateKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure ShippMentKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
2024-08-21 14:03:11 +08:00
|
|
|
|
procedure YunFeeKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
procedure BaoFeeKeyPress(Sender: TObject; var Key: Char);
|
2024-11-02 16:32:38 +08:00
|
|
|
|
procedure cxGridDBColumn2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
procedure CKSBtnUpClick(Sender: TObject);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// procedure PBPriceKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
// procedure Button1Click(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
FLeft, FTop: Integer;
|
|
|
|
|
|
fuserName, Fstatus: string;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// procedure InitGX();
|
|
|
|
|
|
procedure JSMoney();
|
|
|
|
|
|
procedure JSCB();
|
|
|
|
|
|
procedure CBMX();
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
|
function TestData(): Boolean;
|
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
|
function SaveCB(): Boolean;
|
|
|
|
|
|
function GetLSNo1(ADOQueryTmp: TADOQuery; // ȡ<><C8A1><EFBFBD><EFBFBD>
|
|
|
|
|
|
var mMaxNo: string; mFlag: string; mTable: string; mlen: Integer; mtype: Integer = 0): Boolean;
|
|
|
|
|
|
procedure SetXH();
|
|
|
|
|
|
procedure LookImage(FileName: string);
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
CopyInt: Integer;
|
|
|
|
|
|
PState: string;
|
|
|
|
|
|
fFlileFlag: string;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FBGMId: string;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FAuthority, FGSTT: string;
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmBaoguanInPut: TfrmBaoguanInPut;
|
|
|
|
|
|
newh: hwnd;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
2024-11-02 16:32:38 +08:00
|
|
|
|
U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_ClothInfoSel, U_PictureUpload,
|
|
|
|
|
|
U_ZDYHelp_Img;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
function TfrmBaoguanInPut.GetLSNo1(ADOQueryTmp: TADOQuery; var mMaxNo: string; mFlag: string; mTable: string; mlen: Integer; mtype: Integer = 0): Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
with ADOQueryTmp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('exec Get_SY_MaxBH1 ');
|
|
|
|
|
|
sql.Add(' ' + quotedStr(mFlag));
|
|
|
|
|
|
sql.Add(',' + quotedStr(mTable));
|
|
|
|
|
|
sql.Add(',' + intTostr(mlen));
|
|
|
|
|
|
sql.Add(',' + intTostr(mtype));
|
|
|
|
|
|
// ShowMessage(SQL.Text);
|
|
|
|
|
|
Open;
|
|
|
|
|
|
|
|
|
|
|
|
if Recordcount > 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mMaxNo := Trim(fieldByName('MaxBH').AsString);
|
|
|
|
|
|
if mMaxNo <> '' then
|
|
|
|
|
|
Result := true
|
|
|
|
|
|
else
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
if not Result then
|
|
|
|
|
|
application.MessageBox(PWideChar('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>(' + mFlag + ')'), '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONINFORMATION);
|
|
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
application.MessageBox(PWideChar('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>(' + mFlag + ')'), '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONINFORMATION);
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.SetXH();
|
|
|
|
|
|
var
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
i := 1;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('XHNoTemp').Value := i;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.IndexFieldNames := '';
|
2024-08-10 17:13:44 +08:00
|
|
|
|
First;
|
|
|
|
|
|
i := 1;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('SerialNo').Value := FieldByName('XHNoTemp').AsInteger;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.IndexFieldNames := 'SerialNo';
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ShippMentKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end
|
|
|
|
|
|
else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = '.' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
//procedure TfrmSalesConInPut.InitGX();
|
|
|
|
|
|
//var
|
|
|
|
|
|
// i: Integer;
|
|
|
|
|
|
// xh: string;
|
|
|
|
|
|
//begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// if BG_Sub.IsEmpty then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// exit;
|
|
|
|
|
|
// with ADOQuery1 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('select * from BS_Cloth_Glide A ');
|
|
|
|
|
|
// sql.Add('left join Bs_Cloth_Info B on A.BCIID=B.BCIID');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// sql.Add('where B.C_Code =' + quotedstr((BG_Sub.fieldbyname('C_Code').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// open;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// i := 1;
|
|
|
|
|
|
// xh := '1';
|
|
|
|
|
|
//// if ADOQuery1.ISEmpty = False then
|
|
|
|
|
|
//// begin
|
|
|
|
|
|
//
|
|
|
|
|
|
// while i <= 3 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// with ADOQuery2 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('select A.* from (select X.ProcessName+''-''+X.ProcessTypeName AS GX,X.BCIID,X.GlideIdx from BS_Cloth_Glide X) A ');
|
|
|
|
|
|
// sql.Add('left join Bs_Cloth_Info B on A.BCIID=B.BCIID');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// sql.Add('where B.C_Code =' + quotedstr((BG_Sub.fieldbyname('C_Code').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// sql.Add('and A.GlideIdx =''' + Trim(xh) + '''');
|
|
|
|
|
|
//// showmessage(SQL.text);
|
|
|
|
|
|
// open;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// case i of
|
|
|
|
|
|
// 1:
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Trim(ADOQuery2.fieldbyname('GX').AsString) <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Label36.Caption := Trim(ADOQuery2.fieldbyname('GX').AsString) + '<27>ӹ<EFBFBD><D3B9><EFBFBD>:';
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Label36.Caption := '<27><><EFBFBD><EFBFBD>1<EFBFBD>ӹ<EFBFBD><D3B9>ѣ<EFBFBD>';
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// 2:
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Trim(ADOQuery2.fieldbyname('GX').AsString) <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Label37.Caption := Trim(ADOQuery2.fieldbyname('GX').AsString) + '<27>ӹ<EFBFBD><D3B9><EFBFBD>:';
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Label37.Caption := '<27><><EFBFBD><EFBFBD>2<EFBFBD>ӹ<EFBFBD><D3B9>ѣ<EFBFBD>';
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// 3:
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Trim(ADOQuery2.fieldbyname('GX').AsString) <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Label38.Caption := Trim(ADOQuery2.fieldbyname('GX').AsString) + '<27>ӹ<EFBFBD><D3B9><EFBFBD>:';
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Label38.Caption := '<27><><EFBFBD><EFBFBD>3<EFBFBD>ӹ<EFBFBD><D3B9>ѣ<EFBFBD>';
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// i := i + 1;
|
|
|
|
|
|
// xh := IntToStr(i);
|
|
|
|
|
|
//// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
//end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.JSMoney();
|
|
|
|
|
|
var
|
|
|
|
|
|
FConQty, FConPrice, FC_Money: Double;
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
FConQty := Fieldbyname('ConQty').AsFloat;
|
|
|
|
|
|
FConPrice := Fieldbyname('ConPrice').AsFloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEA3AC><EFBFBD><EFBFBD>2λС<CEBB><D0A1>
|
|
|
|
|
|
FC_Money := RoundFloat(FConQty * FConPrice, 2);
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('ConTotalAmount').Value := FC_Money;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
tv2.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.BaoFeeKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end
|
|
|
|
|
|
else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = '.' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.CBMX();
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQuery2 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select COUNT(A.BCIID) S from BS_Cloth_Glide A ');
|
|
|
|
|
|
sql.Add('left join Bs_Cloth_Info B on B.BCIID =A.BCIID');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('where B.C_Code =' + quotedstr((BG_Sub.fieldbyname('C_Code').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>1
|
|
|
|
|
|
with ADOGY1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select ISNULL(A.ProcessName, '''')+ISNULL(''_''+A.ProcessTypeName, '''') GY from BS_Cloth_Glide A ');
|
|
|
|
|
|
sql.Add('left join Bs_Cloth_Info B on B.BCIID =A.BCIID');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('where B.C_Code =' + quotedstr((BG_Sub.fieldbyname('C_Code').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
sql.Add('and A.GlideIdx=1 ');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>2
|
|
|
|
|
|
with ADOGY2 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select ISNULL(A.ProcessName, '''')+ISNULL(''_''+A.ProcessTypeName, '''') GY from BS_Cloth_Glide A ');
|
|
|
|
|
|
sql.Add('left join Bs_Cloth_Info B on B.BCIID =A.BCIID');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('where B.C_Code =' + quotedstr((BG_Sub.fieldbyname('C_Code').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
sql.Add('and A.GlideIdx=2 ');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>3
|
|
|
|
|
|
with ADOGY3 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select ISNULL(A.ProcessName, '''')+ISNULL(''_''+A.ProcessTypeName, '''') GY from BS_Cloth_Glide A ');
|
|
|
|
|
|
sql.Add('left join Bs_Cloth_Info B on B.BCIID =A.BCIID');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('where B.C_Code =' + quotedstr((BG_Sub.fieldbyname('C_Code').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
sql.Add('and A.GlideIdx=3 ');
|
|
|
|
|
|
open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
sql.Add(' select * from BS_Contract_Sub_CB ');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('where ConSid=' + quotedstr(trim(BG_Sub.fieldbyname('Consid').AsString)));
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// sql.Add(' order by SerialNo ');
|
|
|
|
|
|
// ShowMessage(sql.text);
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQuery1, Sub_CB);
|
|
|
|
|
|
SInitCDSData(ADOQuery1, Sub_CB);
|
|
|
|
|
|
|
|
|
|
|
|
if ADOQuery1.IsEmpty then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Sub_CB do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Sub_CB.EmptyDataSet;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 1;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 2;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD>(%)';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 3;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := 'Ⱦ<><C8BE>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 4;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27>׳<EFBFBD>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '1';
|
|
|
|
|
|
post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 5;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(%)';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 6;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27>沼<EFBFBD><E6B2BC>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 7;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
if ADOQuery2.fieldbyname('S').AsInteger > 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('CB_Name').Value := Trim(ADOGY1.fieldbyname('GY').AsString);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD>1<EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>';
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 8;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
if ADOQuery2.fieldbyname('S').AsInteger > 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('CB_Name').Value := Trim(ADOGY2.fieldbyname('GY').AsString);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD>2<EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>';
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 9;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
if ADOQuery2.fieldbyname('S').AsInteger > 2 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('CB_Name').Value := Trim(ADOGY3.fieldbyname('GY').AsString);
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD>3<EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>';
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 10;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27><>װ<EFBFBD><D7B0>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 11;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27><><EFBFBD><EFBFBD>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '1';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 12;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := '<27>˷<EFBFBD>';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('SerialNo').Value := 13;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('ConSid').Value := Trim(BG_Sub.fieldbyname('ConSid').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
FieldByName('CB_Name').Value := 'Ӷ<><D3B6>(%)';
|
|
|
|
|
|
FieldByName('CB_Price').Value := '0';
|
|
|
|
|
|
post;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.JSCB();
|
|
|
|
|
|
var
|
|
|
|
|
|
FLRL, FSYGCB: string;
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
FPBPrice, Fsl, Frf, FMQty, FMBPrice, FGY1, FGY2, FGY3: Double;
|
|
|
|
|
|
Fbzf, Fhl, Fyf, Fyj, FXSPrice, FYGCB, FLR, FGYSL: Double;
|
|
|
|
|
|
begin
|
|
|
|
|
|
i := 1;
|
|
|
|
|
|
with Sub_CB do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
case i of
|
|
|
|
|
|
1:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FPBPrice := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
2:
|
|
|
|
|
|
begin
|
|
|
|
|
|
Fsl := (100 - Sub_CB.fieldbyname('CB_Price').Asfloat) / 100;
|
|
|
|
|
|
end;
|
|
|
|
|
|
3:
|
|
|
|
|
|
begin
|
|
|
|
|
|
Frf := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
4:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FMQty := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
5:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FGYSL := (100 - Sub_CB.fieldbyname('CB_Price').Asfloat) / 100;
|
|
|
|
|
|
end;
|
|
|
|
|
|
6:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FMBPrice := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
7:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FGY1 := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
8:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FGY2 := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
9:
|
|
|
|
|
|
begin
|
|
|
|
|
|
FGY3 := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
10:
|
|
|
|
|
|
begin
|
|
|
|
|
|
Fbzf := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
11:
|
|
|
|
|
|
begin
|
|
|
|
|
|
Fhl := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
12:
|
|
|
|
|
|
begin
|
|
|
|
|
|
Fyf := Sub_CB.fieldbyname('CB_Price').Asfloat;
|
|
|
|
|
|
end;
|
|
|
|
|
|
13:
|
|
|
|
|
|
begin
|
|
|
|
|
|
Fyj := (100 - Sub_CB.fieldbyname('CB_Price').Asfloat) / 100;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
i := i + 1;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FXSPrice := BG_Sub.fieldbyname('ConPrice').Asfloat;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
if FPBPrice = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ0!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Fsl = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD>Ϊ0!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if FGYSL = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD>Ϊ0!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if FMQty = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27>׳<EFBFBD><D7B3><EFBFBD><EFBFBD><EFBFBD>Ϊ0!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Fhl = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD>Ϊ0!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Fyj = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('Ӷ<><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
FYGCB := RoundFloat((((((FPBPrice / Fsl + Frf) / FMQty + FMBPrice + FGY1 + FGY2 + FGY3) / FGYSL + Fbzf) / Fhl + Fyf) / Fyj), 2);
|
|
|
|
|
|
FLR := RoundFloat((FXSPrice - FYGCB) / FYGCB, 3) * 100;
|
|
|
|
|
|
|
|
|
|
|
|
FSYGCB := floatToStr(FYGCB);
|
|
|
|
|
|
FLRL := floatToStr(FLR) + '%';
|
|
|
|
|
|
|
|
|
|
|
|
// showmessage('Ԥ<><D4A4><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD>'+TRIM(FSYGCB)+'<27><><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD>'+tRIM(FLRL)+'<27>Ƿ<EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>棡');
|
|
|
|
|
|
if Application.MessageBox(PChar('Ԥ<><D4A4><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD>' + TRIM(FSYGCB) + '<27><><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD>' + tRIM(FLRL) + '<27>Ƿ<EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>棡'), '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if SaveCb() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
// Sub_CB.post;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Estimated').Value := FloatToStr(FYGCB);
|
|
|
|
|
|
FieldByName('ProfitRate').Value := FLRL;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('Ԥ<><D4A4><EFBFBD>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//begin
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
//// tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
//end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmBaoguanInPut.TestData(): Boolean;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
if Trim(ConNo.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><>ͬ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if Trim(CKS.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(FPNo.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><>Ʊ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(ChuyunG.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>˸۲<CBB8><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(DaohuoG.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(MYG.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('ó<><EFBFBD><D7B9><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(DYG.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>˹<EFBFBD><CBB9><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(YSType.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>䷽ʽ<E4B7BD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(MYType.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('ó<><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(YunFee.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27>˷Ѳ<CBB7><D1B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(BaoFee.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>Ѳ<EFBFBD><D1B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(CustName.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if Trim(ZZMDG.Text) = '' then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>Ŀ<EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if BG_Sub.IsEmpty then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
raise Exception.Create('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
2024-11-02 16:32:38 +08:00
|
|
|
|
// if BG_Sub.Locate('C_Code', null, []) then
|
|
|
|
|
|
// raise Exception.Create('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if BG_Sub.Locate('C_Name', null, []) then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
raise Exception.Create('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if BG_Sub.Locate('C_EName', '', []) then
|
|
|
|
|
|
raise Exception.Create('Ӣ<><D3A2>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if BG_Sub.Locate('C_Composition', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27>ɷֲ<C9B7><D6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('ZZFF', null, []) then
|
|
|
|
|
|
raise Exception.Create('֯<>췽<EFBFBD><ECB7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('RZType', '', []) then
|
|
|
|
|
|
raise Exception.Create('Ⱦ<><C8BE><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if BG_Sub.Locate('C_Width', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('brand', null, []) then
|
|
|
|
|
|
raise Exception.Create('Ʒ<>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('manufacturer', '', []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if BG_Sub.Locate('HSNO', null, []) then
|
|
|
|
|
|
raise Exception.Create('HSNO<4E><4F><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('BGQty', null, []) then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if BG_Sub.Locate('BGUnit', '', []) then
|
|
|
|
|
|
raise Exception.Create('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if BG_Sub.Locate('BGPrice', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('BGMoney', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD><EFBFBD><EEB2BB>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('BZQty', Null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
if BG_Sub.Locate('BZUnit', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><>װ<EFBFBD><D7B0>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('Size', null, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('GrossWeight', NULL, []) then
|
|
|
|
|
|
raise Exception.Create('ë<>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('NetWeight', NULL, []) then
|
|
|
|
|
|
raise Exception.Create('<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>');
|
|
|
|
|
|
if BG_Sub.Locate('BGUnit;ZSQty', VarArrayOf(['Kg', Null]), [loPartialKey]) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λΪKGʱ<47><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.InitData();
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
//ˢ<>²<EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add(' select * from BaoGuan_Sub ');
|
|
|
|
|
|
sql.Add('where BGMId=''' + Trim(FBGMId) + '''');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// sql.Add(' order by SerialNo ');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
SCreateCDS(ADOTemp, BG_Sub);
|
|
|
|
|
|
SInitCDSData(ADOTemp, BG_Sub);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
//ˢ<><CBA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('select * from BaoGuan_Main where BGMId=''' + Trim(FBGMId) + '''');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCSHData(ADOTemp, ScrollBox1, 2);
|
2024-08-21 14:03:11 +08:00
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Fstatus := Trim(ADOTemp.FieldByName('status').AsString);
|
|
|
|
|
|
|
|
|
|
|
|
if PState = '<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FPDate.DateTime := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
HTDate.DateTime := FPDate.DateTime;
|
|
|
|
|
|
KHDate.DateTime := FPDate.DateTime;
|
|
|
|
|
|
SBDate.DateTime := FPDate.DateTime;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if PState = '<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
PState := '<27><><EFBFBD><EFBFBD>';
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FBGMId := '';
|
2024-11-02 16:32:38 +08:00
|
|
|
|
FPDate.DateTime := SGetServerDateTime(ADOTemp);
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if GetLSNo(ADOCmd, maxno, 'BGS', 'BaoGuan_Sub', 4, 1) = False then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Edit;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('BGMId').Value := '';
|
|
|
|
|
|
FieldByName('BGSId').Value := maxno;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.N1Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FValue, FFValue, FColumn, FFColumn, MHXSID: string;
|
|
|
|
|
|
MXHNO: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
// if Fstatus = '1' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
// exit;
|
|
|
|
|
|
// end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// MXHNO := BG_Sub.FieldByName('XHNo').ASInteger;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// FColumn := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// FValue := Trim(BG_Sub.fieldbyname(FColumn).AsString);
|
|
|
|
|
|
// MHXSID := Trim(BG_Sub.fieldbyname('HXSID').AsString);
|
|
|
|
|
|
// with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// begin
|
|
|
|
|
|
// DisableControls;
|
|
|
|
|
|
// First;
|
|
|
|
|
|
// while not Eof do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if FieldByName('SSel').AsBoolean then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
|
|
|
|
|
//
|
|
|
|
|
|
// if FValue = '' then
|
|
|
|
|
|
// begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// BG_Sub.FieldByName(FColumn).Value := null;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// BG_Sub.FieldByName(FColumn).Value := FValue;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// end;
|
|
|
|
|
|
// if FColumn = 'C_HX' then
|
|
|
|
|
|
// begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// BG_Sub.FieldByName('HXSID').Value := MHXSID;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// end;
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// JSMoney();
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Next;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// EnableControls;
|
|
|
|
|
|
// end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// BG_Sub.Locate('XHNO', MXHNO, []);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.N2Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FValue, MC_Code, MC_Craft, MC_Name, MC_Spec, MC_CF, MC_Color, MC_MF, MC_KZ, MC_Note, MC_Unit, MGcHuaNo, MSuoLv, MC_EName: string;
|
|
|
|
|
|
MXHNO: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
// if Fstatus = '1' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// application.MessageBox('<27><>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
// exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// MXHNO := BG_Sub.FieldByName('XHNo').ASInteger;
|
|
|
|
|
|
// MC_Code := BG_Sub.fieldbyname('C_Code').AsString;
|
|
|
|
|
|
// MC_Craft := BG_Sub.fieldbyname('C_Craft').AsString;
|
|
|
|
|
|
// MC_Name := BG_Sub.fieldbyname('C_Name').AsString;
|
|
|
|
|
|
// MC_Spec := BG_Sub.fieldbyname('C_Spec').AsString;
|
|
|
|
|
|
// MC_CF := BG_Sub.fieldbyname('C_CF').AsString;
|
|
|
|
|
|
// MC_Color := BG_Sub.fieldbyname('C_Color').AsString;
|
|
|
|
|
|
// MC_MF := BG_Sub.fieldbyname('C_MF').AsString;
|
|
|
|
|
|
// MC_KZ := BG_Sub.fieldbyname('C_KZ').AsString;
|
|
|
|
|
|
// MC_Note := BG_Sub.fieldbyname('C_Note').AsString;
|
|
|
|
|
|
// MC_Unit := BG_Sub.fieldbyname('C_Unit').AsString;
|
|
|
|
|
|
// MSuoLv := BG_Sub.fieldbyname('SuoLv').AsString;
|
|
|
|
|
|
// MGcHuaNo := BG_Sub.fieldbyname('GcHuaNo').AsString;
|
|
|
|
|
|
// MC_EName := BG_Sub.fieldbyname('C_EName').AsString;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
//
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// begin
|
|
|
|
|
|
// DisableControls;
|
|
|
|
|
|
// First;
|
|
|
|
|
|
// while not Eof do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if FieldByName('SSel').AsBoolean then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// BG_Sub.fieldbyname('C_Code').Value := MC_Code;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_Craft').Value := MC_Craft;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_Name').Value := MC_Name;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_Spec').Value := MC_Spec;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_CF').Value := MC_CF;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_Color').Value := MC_Color;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_MF').Value := MC_MF;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_KZ').Value := MC_KZ;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_Note').Value := MC_Note;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_Unit').Value := MC_Unit;
|
|
|
|
|
|
// BG_Sub.fieldbyname('SuoLv').Value := MSuoLv;
|
|
|
|
|
|
// BG_Sub.fieldbyname('GcHuaNo').Value := MGcHuaNo;
|
|
|
|
|
|
// BG_Sub.fieldbyname('C_EName').Value := MC_EName;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
// Post;
|
|
|
|
|
|
//
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Next;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// EnableControls;
|
|
|
|
|
|
// end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// BG_Sub.Locate('XHNO', MXHNO, []);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
//procedure TfrmSalesConInPut.PBPriceKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
//begin
|
|
|
|
|
|
// if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Key := #0;
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if Key = '.' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Key := #0;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
//end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.Pic_Image1DblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if TcxDBImage(Sender).Picture.Height = 0 then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
LookImage(ADOQueryImage.fieldbyname(TcxDBImage(Sender).Hint).asstring);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.LookImage(FileName: string);
|
|
|
|
|
|
var
|
|
|
|
|
|
sFieldName: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
sFieldName := leftbstr(ExtractFilePath(Application.ExeName), 1) + ':\ͼƬ<CDBC>鿴';
|
|
|
|
|
|
if not DirectoryExists(pchar(sFieldName)) then
|
|
|
|
|
|
CreateDirectory(pchar(sFieldName), nil);
|
|
|
|
|
|
sFieldName := sFieldName + '\' + trim(FileName);
|
|
|
|
|
|
try
|
|
|
|
|
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI', 'SERVER', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ', '127.0.0.1');
|
|
|
|
|
|
IdFTP1.Username := 'three';
|
|
|
|
|
|
IdFTP1.Password := '641010';
|
|
|
|
|
|
IdFTP1.Connect();
|
|
|
|
|
|
except
|
|
|
|
|
|
;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if IdFTP1.Connected then
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
IdFTP1.Get(fFlileFlag + '\' + Trim(FileName), sFieldName, true, false);
|
|
|
|
|
|
except
|
|
|
|
|
|
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|
|
|
|
|
IdFTP1.Quit;
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|
|
|
|
|
IdFTP1.Quit;
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if IdFTP1.Connected then
|
|
|
|
|
|
IdFTP1.Quit;
|
|
|
|
|
|
ShellExecute(Handle, 'open', PChar(sFieldName), '', '', SW_SHOWNORMAL);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.QiYunBtnUpClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
2024-08-21 14:03:11 +08:00
|
|
|
|
MainType := '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>';
|
2024-08-10 17:13:44 +08:00
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ZDYHelp(FButn: TcxButtonEdit; LType: string);
|
|
|
|
|
|
var
|
|
|
|
|
|
FType, ZDYName, FText: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
// inherited;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
readCxGrid(trim(self.Caption), Tv2, '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
fFlileFlag := UserDataFlag + 'HX';
|
|
|
|
|
|
InitData();
|
2024-08-21 14:03:11 +08:00
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmBaoguanInPut.SaveCB(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
MConSid, MCBName, MSCBID, MaxNo: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|
|
|
|
|
//////////////// <20>ɱ<EFBFBD> ///////////////////
|
|
|
|
|
|
//
|
|
|
|
|
|
// if not Sub_CB.IsEmpty then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// with Sub_cb do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Sub_cb.First;
|
|
|
|
|
|
// while not Eof do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// MConSid := Trim(Sub_cb.fieldbyname('ConSid').AsString);
|
|
|
|
|
|
// MCBName := Trim(Sub_cb.fieldbyname('CB_Name').AsString);
|
|
|
|
|
|
//
|
|
|
|
|
|
// with ADOQueryCmd do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('select * from BS_Contract_sub_CB where ConSid=' + quotedstr(Trim(MConSid)));
|
|
|
|
|
|
// Sql.Add('and CB_Name=' + quotedstr(Trim(MCBName)));
|
|
|
|
|
|
// Open;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// with ADOQueryCmd do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// if ADOQueryCmd.IsEmpty then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Append;
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// RTSetSaveDataCDS(ADOQueryCmd, Tv2, Sub_CB, 'BS_Contract_sub_CB', 0);
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// with Sub_CB do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Edit;
|
|
|
|
|
|
// FieldByName('ConSid').Value := Trim(MConSid);
|
|
|
|
|
|
// FieldByName('CB_Name').Value := Trim(MCBName);
|
|
|
|
|
|
// Post;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// Sub_CB.Next;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
// //////<2F>ɱ<EFBFBD>/////////////////////
|
|
|
|
|
|
// if not Sub_CB.IsEmpty then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
with Sub_CB do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Sub_CB.First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
MSCBID := Trim(Sub_CB.fieldbyname('SCBID').AsString);
|
|
|
|
|
|
if Trim(MSCBID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if GetLSNo(ADOQuery1, MaxNo, 'CB', 'BS_Contract_Sub_CB', 4, 1) = False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ADOQuery1.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
MaxNo := trim(MSCBID);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from Bs_Contract_Sub_CB where SCBID=' + quotedstr(Trim(MSCBID)));
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQuery1 do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Trim(MSCBID) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
FieldByName('SCBID').Value := Trim(MaxNo);
|
|
|
|
|
|
// FieldByName('COID').Value := Trim(MSCBID);
|
|
|
|
|
|
RTSetSaveDataCDS(ADOQuery1, Tv2, Sub_Cb, 'BS_Contract_Sub_CB', 0);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with sub_Cb do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('SCBID').Value := Trim(MaxNo);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Sub_CB.Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
|
|
|
|
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|
|
|
|
|
// FCCID := Trim(MaxSubId);
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|
|
|
|
|
Result := false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmBaoguanInPut.SaveData(): Boolean;
|
|
|
|
|
|
var
|
|
|
|
|
|
maxno, MQZ, MLS, MYR: string;
|
|
|
|
|
|
fconNO, fmxType, fDate: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
ADOCmd.Connection.BeginTrans;
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if Trim(FBGMId) = '' then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if GetLSNo(ADOTemp, maxno, 'BGM', 'BaoGuan_Main', 4, 1) = False then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
raise Exception.Create('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
|
|
// fDate := FormatDateTime('yy', SGetServerDate(ADOTemp));
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
maxno := Trim(FBGMId);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
SQL.Add('select * from BaoGuan_Main where BGMId=''' + Trim(FBGMId) + '''');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if Trim(FBGMId) = '' then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('Filler').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('status').Value := '0';
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('Editer').Value := Trim(DName);
|
|
|
|
|
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('BGMId').Value := Trim(maxno);
|
|
|
|
|
|
RTSetsavedata(ADOCmd, 'BaoGuan_Main', ScrollBox1, 2);
|
|
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-11-02 16:32:38 +08:00
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from BaoGuan_Main where FPNo=''' + Trim(FPNo.Text) + '''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOCmd.RecordCount > 1 then
|
|
|
|
|
|
raise Exception.Create('<27><>Ʊ<EFBFBD><C6B1><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FBGMId := Trim(maxno);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
|
|
|
|
|
|
///
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
maxno := Trim(BG_Sub.fieldbyname('BGSId').AsString);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
sql.Add('select * from BaoGuan_Sub where BGSId=''' + Trim(maxno) + '''');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOCmd do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ADOCmd.IsEmpty then
|
|
|
|
|
|
Append
|
|
|
|
|
|
else
|
|
|
|
|
|
Edit;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
RTSetSaveDataCDS(ADOCmd, Tv2, BG_Sub, 'BaoGuan_Sub', 0);
|
|
|
|
|
|
FieldByName('BGMId').Value := Trim(FBGMId);
|
|
|
|
|
|
FieldByName('BGSId').Value := Trim(maxno);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('BGSId').Value := Trim(maxno);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD> //////////////////////
|
|
|
|
|
|
///
|
|
|
|
|
|
//////////////// <20><><EFBFBD>º<EFBFBD>ͬ //////////////////////
|
|
|
|
|
|
// with ADOCmd do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('EXEC P_Con_Up_PiQty ');
|
|
|
|
|
|
// sql.Add('@DataID=' + quotedstr(Trim(FConMId)));
|
|
|
|
|
|
// execsql;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//////////////// <20><><EFBFBD>º<EFBFBD>ͬ //////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
ADOCmd.Connection.CommitTrans;
|
|
|
|
|
|
Result := True;
|
|
|
|
|
|
except
|
|
|
|
|
|
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
|
|
|
|
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|
|
|
|
|
|
|
|
|
|
|
Result := False;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.TBSaveClick(Sender: TObject);
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// ConDate.SetFocus;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
|
|
|
|
|
if TestData() = false then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
if SaveData() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.v1PRTOrderQtyPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue, FFieldName, FLRL: string;
|
|
|
|
|
|
FConQty, FConPrice, FC_Money, FEstimated, FLR: Double; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۣ<EFBFBD><DBA3><EFBFBD><EFBFBD><EFBFBD>, Ԥ<><D4A4><EFBFBD>ɱ<EFBFBD>
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|
|
|
|
|
if Trim(mvalue) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := '0';
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|
|
|
|
|
Post;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FConQty := Fieldbyname('BGQty').AsFloat;
|
|
|
|
|
|
FConPrice := Fieldbyname('BGPrice').AsFloat;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
FC_Money := RoundFloat(FConQty * FConPrice, 2);
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('BGQty').Value := FConQty;
|
|
|
|
|
|
FieldByName('BGPrice').Value := FConPrice;
|
|
|
|
|
|
FieldByName('BGMoney').Value := FC_Money;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
tv2.Controller.EditingController.ShowEdit();
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
procedure TfrmBaoguanInPut.YunFeeKeyPress(Sender: TObject; var Key: Char);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
Key := #0;
|
|
|
|
|
|
end
|
|
|
|
|
|
else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = '.' then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
Key := #0;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
maxno: string;
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if GetLSNo(ADOCmd, maxno, 'BGS', 'BaoGuan_Sub', 4, 1) = False then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
ADOCmd.Connection.RollbackTrans;
|
|
|
|
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
|
|
|
|
|
|
i := BG_Sub.RecordCount; //<2F><>ǰ<EFBFBD><C7B0>dataset<65>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>м<EFBFBD>¼
|
2024-08-10 17:13:44 +08:00
|
|
|
|
i := i + 1;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
CopyAddRow(Tv2, BG_Sub);
|
|
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('SSEL').Value := FALSE;
|
|
|
|
|
|
FieldByName('SerialNo').Value := i;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
FieldByName('BGSId').Value := maxno;
|
|
|
|
|
|
// FieldByName('C_Color').Value := '';
|
|
|
|
|
|
// FieldByName('ConQty').Value := null;
|
|
|
|
|
|
// FieldByName('Estimated').Value := '';
|
|
|
|
|
|
// FieldByName('ProfitRate').Value := '';
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SetXH();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
if BG_Sub.IsEmpty then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
Exit;
|
|
|
|
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
Exit;
|
2024-11-02 16:32:38 +08:00
|
|
|
|
// while BG_Sub.Locate('SSel', True, []) do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// with ADOTemp do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add('select * from Trade_Plan_Sub where ConSId=''' + Trim(BG_Sub.fieldbyname('ConSId').AsString) + '''');
|
|
|
|
|
|
// open;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if ADOTemp.IsEmpty = false then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// exit;
|
|
|
|
|
|
// application.MessageBox('<27><><EFBFBD><EFBFBD>ϸ<EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ');
|
|
|
|
|
|
// end;
|
|
|
|
|
|
if Trim(BG_Sub.fieldbyname('BGSId').AsString) <> '' then
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
2024-11-02 16:32:38 +08:00
|
|
|
|
with ADOCmd do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
2024-11-02 16:32:38 +08:00
|
|
|
|
sql.Add('delete BaoGuan_Sub where BGSId=''' + Trim(BG_Sub.fieldbyname('BGSId').AsString) + '''');
|
|
|
|
|
|
ExecSQL;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
2024-11-02 16:32:38 +08:00
|
|
|
|
// end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.Delete;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
SetXH();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if SaveCB() then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|
|
|
|
|
ModalResult := 1;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
JSCB();
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
WriteCxGrid(trim(self.Caption), Tv2, '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.Tv1FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
if PState = '<27>ɱ<EFBFBD>Ԥ<EFBFBD><D4A4>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
CBMX();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TV2.DataController.Filter.Clear;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.cxDBImage1DblClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if TcxDBImage(Sender).Picture.Height = 0 then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
LookImage(Qry_ImgHX.fieldbyname(TcxDBImage(Sender).Hint).asstring);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-11-02 16:32:38 +08:00
|
|
|
|
procedure TfrmBaoguanInPut.cxGridDBColumn2PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'BGName';
|
|
|
|
|
|
flagname := '<27><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>';
|
|
|
|
|
|
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Self.BG_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('C_Name').Value := Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select Top 1 * from BaoGuan_Sub where C_Name=''' + Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString) + '''');
|
|
|
|
|
|
sql.add(' and isnull(HSNO,'''')<>'''' ');
|
|
|
|
|
|
sql.Add(' order by SFillTime desc');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
with Self.BG_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('HSNO').Value := Trim(ADOQueryTemp.fieldbyname('HSNO').asstring);
|
|
|
|
|
|
FieldByName('C_EName').Value := Trim(ADOQueryTemp.fieldbyname('C_EName').asstring);
|
|
|
|
|
|
FieldByName('C_Composition').Value := Trim(ADOQueryTemp.fieldbyname('C_Composition').asstring);
|
|
|
|
|
|
FieldByName('ZZFF').Value := Trim(ADOQueryTemp.fieldbyname('ZZFF').asstring);
|
|
|
|
|
|
FieldByName('RZType').Value := Trim(ADOQueryTemp.fieldbyname('RZType').asstring);
|
|
|
|
|
|
FieldByName('BGUnit').Value := Trim(ADOQueryTemp.fieldbyname('BGUnit').asstring);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-10 17:13:44 +08:00
|
|
|
|
procedure TfrmBaoguanInPut.ExchangeRateKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not (((Key >= '0') and (Key <= '9')) or (Key = '.') or (Key = #8)) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end
|
|
|
|
|
|
else if (pos('.', TEdit(Sender).text) <> 0) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Key = '.' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Key := #0;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
//procedure TfrmSalesConInPut.Button1Click(Sender: TObject);
|
|
|
|
|
|
//var
|
|
|
|
|
|
// FPBPrice, Fsl, Frf, FMQty, FGY1, FGY2, FGY3: Double;
|
|
|
|
|
|
// Fbzf, Fhl, Fyf, Fyj, FXSPrice, FYGCB, FLR: Double;
|
|
|
|
|
|
//begin
|
|
|
|
|
|
// FPBPrice := 0;
|
|
|
|
|
|
// Fsl := 0;
|
|
|
|
|
|
// Frf := 0;
|
|
|
|
|
|
// FMQty := 0;
|
|
|
|
|
|
// FGY1 := 0;
|
|
|
|
|
|
// FGY2 := 0;
|
|
|
|
|
|
// FGY3 := 0;
|
|
|
|
|
|
// Fbzf := 0;
|
|
|
|
|
|
// Fhl := 0;
|
|
|
|
|
|
// Fyf := 0;
|
|
|
|
|
|
// Fyj := 0;
|
|
|
|
|
|
// FXSPrice := 0;
|
|
|
|
|
|
// if GY1Price.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FGY1 := StrToFloat(GY1Price.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if GY2Price.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FGY2 := StrToFloat(GY2Price.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if GY3Price.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FGY3 := StrToFloat(GY3Price.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if PBPrice.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FPBPrice := StrToFloat(PBPrice.text);
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>۸<EFBFBD><DBB8><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if suolv.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Fsl := StrToFloat(suolv.text);
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
//
|
|
|
|
|
|
// Application.MessageBox('<27><><EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
//
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if RPrice.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Frf := StrToFloat(RPrice.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// if MQty.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FMQty := StrToFloat(MQty.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if PackPrice.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Fbzf := StrToFloat(PackPrice.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if exchange.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Fhl := StrToFloat(exchange.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
// if freight.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Fyf := StrToFloat(freight.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// if brokerage.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Fyj := StrToFloat(brokerage.text);
|
|
|
|
|
|
// end
|
|
|
|
|
|
// else
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Application.MessageBox('Ӷ<><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
// if conPrice.text <> '' then
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// FXSPrice := StrToFloat(conPrice.text);
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
// FYGCB := RoundFloat(((((FPBPrice / Fsl + Frf) / FMQty + FGY1 + FGY2 + FGY3 + Fbzf) / Fhl + Fyf) / Fyj), 2);
|
|
|
|
|
|
// FLR := RoundFloat((FXSPrice - FYGCB) / FYGCB, 2)*100;
|
|
|
|
|
|
//
|
|
|
|
|
|
// Estimated.text := FloatToStr(FYGCB);
|
|
|
|
|
|
// ProfitRate.text := FloatToStr(FLR)+'%';
|
|
|
|
|
|
//
|
|
|
|
|
|
// if Application.MessageBox('<27>Ƿ<EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD>棡', '<27><>ʾ', 32 + 4) <> IDYES then
|
|
|
|
|
|
// Exit;
|
|
|
|
|
|
//
|
|
|
|
|
|
// with ADOQuery1 do
|
|
|
|
|
|
// begin
|
|
|
|
|
|
// Close;
|
|
|
|
|
|
// sql.Clear;
|
|
|
|
|
|
// sql.Add(' Update BS_Contract_Sub Set PBPrice=''' + Trim(PBPrice.text) + ''' ');
|
|
|
|
|
|
// sql.Add(',suolv=''' + Trim(suolv.text) + ''',RPrice=''' + Trim(RPrice.text) + ''' ');
|
|
|
|
|
|
// sql.Add(',MQty=''' + Trim(MQty.text) + ''',GY1Price=''' + Trim(GY1Price.text) + ''' ');
|
|
|
|
|
|
// sql.Add(',GY2Price=''' + Trim(GY2Price.text) + ''',GY3Price=''' + Trim(GY3Price.text) + ''' ');
|
|
|
|
|
|
// sql.Add(',PackPrice=''' + Trim(PackPrice.text) + ''',exchange=''' + Trim(exchange.text) + ''' ');
|
|
|
|
|
|
// sql.Add(',freight=''' + Trim(freight.text) + ''',brokerage=''' + Trim(brokerage.text) + ''' ');
|
|
|
|
|
|
// sql.Add(',Estimated=''' + Trim(Estimated.text) + ''',profitrate=''' + Trim(profitrate.text) + ''' ');
|
2024-08-21 14:03:11 +08:00
|
|
|
|
// sql.Add(' where ConSid=''' + Trim(BG_Sub.fieldbyname('ConSid').AsString) + ''' ');
|
2024-08-10 17:13:44 +08:00
|
|
|
|
//
|
|
|
|
|
|
// ExecSQL;
|
|
|
|
|
|
// end;
|
|
|
|
|
|
//end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
procedure TfrmBaoguanInPut.CKSBtnDnClick(Sender: TObject);
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
TBtnEditC(Sender).Text := '';
|
|
|
|
|
|
TBtnEditC(Sender).TxtCode := '';
|
2024-11-02 16:32:38 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.CKSBtnUpClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp_Img := TfrmZDYHelp_Img.Create(Application);
|
|
|
|
|
|
with frmZDYHelp_Img do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|
|
|
|
|
MainType := '<27><><EFBFBD>ع<EFBFBD><D8B9><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOQueryTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select Top 1 * from BaoGuan_Main where CKS=''' + Trim(ClientDataSet1.fieldbyname('ZDYName').AsString) + '''');
|
|
|
|
|
|
sql.Add(' order by FillTime desc');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
DPNO.Text := ADOQueryTemp.fieldbyname('DPNO').ASString;
|
|
|
|
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp_Img.Free;
|
|
|
|
|
|
end;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.v1Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'MPRTCodeName';
|
|
|
|
|
|
flagname := '<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.Edit;
|
|
|
|
|
|
BG_Sub.fieldbyname('PRTCodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
BG_Sub.fieldbyname('PRTCode').Value := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
BG_Sub.Post;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
TV2.Controller.EditingController.ShowEdit();
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.v1Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'C_MF';
|
|
|
|
|
|
flagname := '<27>ŷ<EFBFBD><C5B7><EFBFBD>Ϣ';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.Edit;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_MF').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
// BG_Sub.fieldbyname('PRTCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
BG_Sub.Post;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
TV2.Controller.EditingController.ShowEdit();
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.v1Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := 'C_KZ';
|
|
|
|
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ';
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.Edit;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_KZ').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
// BG_Sub.fieldbyname('PRTCode').Value:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
|
|
|
|
|
BG_Sub.Post;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
TV2.Controller.EditingController.ShowEdit();
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.v1Column10PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
var
|
|
|
|
|
|
MCYNo: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
frmClothInfoSel := TfrmClothInfoSel.Create(self);
|
|
|
|
|
|
with frmClothInfoSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if showmodal = 1 then
|
|
|
|
|
|
begin
|
2024-08-21 14:03:11 +08:00
|
|
|
|
BG_Sub.Edit;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_Code').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Code').asstring;
|
|
|
|
|
|
|
|
|
|
|
|
BG_Sub.fieldbyname('C_Name').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Name').asstring;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_EName').Value := frmClothInfoSel.CDS_1.fieldbyname('C_EName').asstring;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_Spec').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Spec').asstring;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_Composition').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Composition').asstring;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_Color').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Color').asstring;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_Width').Value := frmClothInfoSel.CDS_1.fieldbyname('C_Width').asstring;
|
|
|
|
|
|
BG_Sub.fieldbyname('C_GramWeight').Value := frmClothInfoSel.CDS_1.fieldbyname('C_GramWeight').asstring;
|
|
|
|
|
|
BG_Sub.Post;
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-08-21 14:03:11 +08:00
|
|
|
|
TV2.Controller.EditingController.ShowEdit();
|
2024-08-10 17:13:44 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.SalesmanBtnUpClick(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj: string;
|
|
|
|
|
|
FWZ: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
fsj := Trim(TEdit(Sender).Hint);
|
|
|
|
|
|
FWZ := Pos('/', fsj);
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag := Copy(fsj, 1, FWZ - 1);
|
|
|
|
|
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|
|
|
|
|
if ShowModal = 1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmBaoguanInPut.v1Column15PropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(mvalue) = '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue := '0';
|
|
|
|
|
|
end;
|
2024-08-21 14:03:11 +08:00
|
|
|
|
with BG_Sub do
|
2024-08-10 17:13:44 +08:00
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('YongJinPrice').Value := mvalue;
|
|
|
|
|
|
FieldByName('YongJin').Value := FieldByName('YongJinPrice').AsFloat * FieldByName('PRTOrderQty').AsFloat;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|