1784 lines
50 KiB
ObjectPascal
1784 lines
50 KiB
ObjectPascal
|
|
unit U_LLRKInPutMH_MCGCS;
|
|||
|
|
|
|||
|
|
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,jpeg,
|
|||
|
|
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, cxPC,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGroupBox, cxCheckBox,
|
|||
|
|
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport,IniFiles, Menus,
|
|||
|
|
ImgList,ShellAPI;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmLLRKInPutMH_MCGCS = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
Label21: TLabel;
|
|||
|
|
Label26: TLabel;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
CDS_Print: TClientDataSet;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
labMYType: TLabel;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
SaveDialog1: TSaveDialog;
|
|||
|
|
adoqueryPicture: TADOQuery;
|
|||
|
|
Panel16: TPanel;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
N3: TMenuItem;
|
|||
|
|
MenuItem2: TMenuItem;
|
|||
|
|
N4: TMenuItem;
|
|||
|
|
ImageList1: TImageList;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryTmp: TADOQuery;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
CRTime: TDateTimePicker;
|
|||
|
|
KHName: TBtnEditA;
|
|||
|
|
KHNo: TEdit;
|
|||
|
|
Panel15: TPanel;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
MYCode: TEdit;
|
|||
|
|
MYName: TBtnEditA;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
Label32: TLabel;
|
|||
|
|
Label33: TLabel;
|
|||
|
|
Label45: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
PS: TEdit;
|
|||
|
|
Qty: TEdit;
|
|||
|
|
KgQty: TEdit;
|
|||
|
|
KgQtyChaE: TEdit;
|
|||
|
|
JCDanWei: TBtnEditA;
|
|||
|
|
JCNo: TEdit;
|
|||
|
|
Panel14: TPanel;
|
|||
|
|
Label43: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
MDMFlag: TCheckBox;
|
|||
|
|
MDKGFlag: TCheckBox;
|
|||
|
|
HSFlag: TCheckBox;
|
|||
|
|
BHSFlag: TCheckBox;
|
|||
|
|
MYMDPrice: TEdit;
|
|||
|
|
Note: TEdit;
|
|||
|
|
cxGroupBox2: TcxGroupBox;
|
|||
|
|
ListView1: TListView;
|
|||
|
|
Panel12: TPanel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Button2: TButton;
|
|||
|
|
Panel13: TPanel;
|
|||
|
|
Image2: TImage;
|
|||
|
|
WJName: TEdit;
|
|||
|
|
Button7: TButton;
|
|||
|
|
WJPach: TEdit;
|
|||
|
|
Button8: TButton;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
MXHZPS: TEdit;
|
|||
|
|
MXHZQty: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
MXHZKgQty: TEdit;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
MDJChang: TEdit;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
Label29: TLabel;
|
|||
|
|
Label30: TLabel;
|
|||
|
|
Label34: TLabel;
|
|||
|
|
PSChaE: TEdit;
|
|||
|
|
QtyChaE: TEdit;
|
|||
|
|
MoneyChaE: TEdit;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
MYKZ: TEdit;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1MYName: TcxGridDBColumn;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
v1Column17: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
v1MYMDPrice: TcxGridDBColumn;
|
|||
|
|
v1MYMDMoney: TcxGridDBColumn;
|
|||
|
|
v1Column2: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
Label28: TLabel;
|
|||
|
|
MYMDMoney: TEdit;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
MYHDMoney: TEdit;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
JChangCharE: TEdit;
|
|||
|
|
v1MYKZ: TcxGridDBColumn;
|
|||
|
|
v1MYMF: TcxGridDBColumn;
|
|||
|
|
v1MDJChang: TcxGridDBColumn;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
ZJQty: TEdit;
|
|||
|
|
Label35: TLabel;
|
|||
|
|
Label36: TLabel;
|
|||
|
|
ZKGQty: TEdit;
|
|||
|
|
Label37: TLabel;
|
|||
|
|
ZMQty: TEdit;
|
|||
|
|
Label38: TLabel;
|
|||
|
|
ZMoney: TEdit;
|
|||
|
|
v1XTKGQty: TcxGridDBColumn;
|
|||
|
|
MXHZJChang: TEdit;
|
|||
|
|
MYPrice: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
XTKGQty: TEdit;
|
|||
|
|
MYCF: TEdit;
|
|||
|
|
v1MYCF: TcxGridDBColumn;
|
|||
|
|
RKNo: TEdit;
|
|||
|
|
v1MYCode: TcxGridDBColumn;
|
|||
|
|
v1MXHZJChang: TcxGridDBColumn;
|
|||
|
|
v1MXHZPS: TcxGridDBColumn;
|
|||
|
|
v1MXHZQty: TcxGridDBColumn;
|
|||
|
|
v1MXHZKgQty: TcxGridDBColumn;
|
|||
|
|
v1MYHDMoney: TcxGridDBColumn;
|
|||
|
|
v1JChangCharE: TcxGridDBColumn;
|
|||
|
|
v1PSChaE: TcxGridDBColumn;
|
|||
|
|
v1QtyChaE: TcxGridDBColumn;
|
|||
|
|
v1KgQtyChaE: TcxGridDBColumn;
|
|||
|
|
v1MoneyChaE: TcxGridDBColumn;
|
|||
|
|
v1MDKGFlag: TcxGridDBColumn;
|
|||
|
|
v1MDMFlag: TcxGridDBColumn;
|
|||
|
|
v1HSFlag: TcxGridDBColumn;
|
|||
|
|
v1BHSFlag: TcxGridDBColumn;
|
|||
|
|
v1JCDanWei: TcxGridDBColumn;
|
|||
|
|
v1JCNo: TcxGridDBColumn;
|
|||
|
|
N5: TMenuItem;
|
|||
|
|
v1RKNo: TcxGridDBColumn;
|
|||
|
|
cxStyle2: TcxStyle;
|
|||
|
|
GroupBox1: TGroupBox;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
filler: TEdit;
|
|||
|
|
GFOrderNo: TEdit;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
v1GFOrderNo: TcxGridDBColumn;
|
|||
|
|
Label53: TLabel;
|
|||
|
|
CGName: TComboBox;
|
|||
|
|
MYMF: TBtnEditA;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure KHNameBtnClick(Sender: TObject);
|
|||
|
|
procedure Image1DblClick(Sender: TObject);
|
|||
|
|
procedure Panel1Click(Sender: TObject);
|
|||
|
|
procedure Label20Click(Sender: TObject);
|
|||
|
|
procedure QtyChange(Sender: TObject);
|
|||
|
|
procedure MDMFlagClick(Sender: TObject);
|
|||
|
|
procedure MDKGFlagClick(Sender: TObject);
|
|||
|
|
procedure MYNameBtnClick(Sender: TObject);
|
|||
|
|
procedure MXHZQtyChange(Sender: TObject);
|
|||
|
|
procedure Panel13Click(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure Button8Click(Sender: TObject);
|
|||
|
|
procedure Button7Click(Sender: TObject);
|
|||
|
|
procedure Image2Click(Sender: TObject);
|
|||
|
|
procedure MenuItem1Click(Sender: TObject);
|
|||
|
|
procedure N3Click(Sender: TObject);
|
|||
|
|
procedure MenuItem2Click(Sender: TObject);
|
|||
|
|
procedure N4Click(Sender: TObject);
|
|||
|
|
procedure Panel2Click(Sender: TObject);
|
|||
|
|
procedure ListView1DblClick(Sender: TObject);
|
|||
|
|
procedure JCDanWeiBtnClick(Sender: TObject);
|
|||
|
|
procedure MXHZKgQtyChange(Sender: TObject);
|
|||
|
|
procedure MYMDPriceChange(Sender: TObject);
|
|||
|
|
procedure HSFlagClick(Sender: TObject);
|
|||
|
|
procedure BHSFlagClick(Sender: TObject);
|
|||
|
|
procedure PSChaEChange(Sender: TObject);
|
|||
|
|
procedure QtyChaEChange(Sender: TObject);
|
|||
|
|
procedure KgQtyChaEChange(Sender: TObject);
|
|||
|
|
procedure MoneyChaEChange(Sender: TObject);
|
|||
|
|
procedure MDJChangChange(Sender: TObject);
|
|||
|
|
procedure JChangCharEChange(Sender: TObject);
|
|||
|
|
procedure MXHZJChangChange(Sender: TObject);
|
|||
|
|
procedure MXHZPSChange(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton;
|
|||
|
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure MYMDMoneyChange(Sender: TObject);
|
|||
|
|
procedure MDJChangKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure PSKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure MXHZJChangKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure MXHZPSKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure NoteKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure MYMDPriceKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button1KeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure N5Click(Sender: TObject);
|
|||
|
|
procedure Tv1DblClick(Sender: TObject);
|
|||
|
|
procedure MYMFBtnClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
lstPat:TStringList;
|
|||
|
|
FangXiang1,FSaveFlag:String;
|
|||
|
|
procedure InitData();
|
|||
|
|
procedure SaveImage(maxnoWB:String);
|
|||
|
|
procedure ReadINIFile10();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
procedure GetHZData();
|
|||
|
|
function SaveDataMX():Boolean;
|
|||
|
|
procedure Initimage();
|
|||
|
|
function YFData(FM:string):Boolean;
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1:String;
|
|||
|
|
PState,CopyInt:Integer;
|
|||
|
|
FMainId:String;
|
|||
|
|
FRead:String;
|
|||
|
|
FMYType,FMYTypeFlag,FML:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmLLRKInPutMH_MCGCS: TfrmLLRKInPutMH_MCGCS;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,U_Fun,U_RTFun,U_ZDYHelpSel, U_GYSList,U_SCPerson,U_QCRKJLList,U_RSColorBig,
|
|||
|
|
U_RTPTColor,U_KHListSelJJ,U_ZHCPBigTP,U_LLRKMXInPutMH,U_ZDYCPName,U_BPZdy_LRPB,U_BPZdy_LRM;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
function TfrmLLRKInPutMH_MCGCS.YFData(FM:string):Boolean;
|
|||
|
|
var
|
|||
|
|
CRID,OrdMainId,YFID,FComTaiTou,FCRID,FFactoryName,FFactoryNo:String;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
FFactoryName:=Trim(KHName.Text);
|
|||
|
|
FFactoryNo:=Trim(KHNo.Text);
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from YS_Money_KC where FactoryName='+quotedstr(Trim(FFactoryName)));
|
|||
|
|
sql.Add(' and KCType=''KH'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
CRID:=ADOQueryTemp.fieldbyname('CRID').AsString;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YS_Money_CRID');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update YS_Money_CRID set CRID=CRID+1');
|
|||
|
|
sql.Add('select * from YS_Money_CRID ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('insert into YS_Money_CRID select 0 ');
|
|||
|
|
sql.Add('select * from YS_Money_CRID ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CRID:=ADOQueryCmd.fieldbyname('CRID').AsString;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from YS_Money_KC where 1=2');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('CRID').Value:=StrToInt(CRID);
|
|||
|
|
FieldByName('FactoryName').Value:=Trim(FFactoryName);
|
|||
|
|
FieldByName('FactoryNo').Value:=Trim(FFactoryNo);
|
|||
|
|
FieldByName('ZdyStr1').Value:='Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('KCType').Value:='KH';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YS_Money_CR where FactoryNo='+quotedstr(Trim(FFactoryNo)));
|
|||
|
|
sql.Add(' and YFTypeId='''+Trim(FM)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd,YFID,'MH','YS_Money_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡӦ<C8A1><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
YFID:=Trim(ADOQueryTemp.fieldbyname('YFID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YS_Money_CR where YFID='''+Trim(YFID)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
begin
|
|||
|
|
FieldByName('SCQty').Value:=ClientDataSet1.fieldbyname('Qty').AsFloat;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('SCQty').Value:=ClientDataSet1.fieldbyname('KGQty').AsFloat;
|
|||
|
|
end;
|
|||
|
|
FieldByName('SCPS').Value:=ClientDataSet1.fieldbyname('PS').AsFloat;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YFID').Value:=Trim(YFID);
|
|||
|
|
FieldByName('YFTypeId').Value:=Trim(FM);
|
|||
|
|
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('ChkStatusP').Value:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('ChkStatusQ').Value:='δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('QtyFlag').Value:=1;
|
|||
|
|
FieldByName('FactoryName').Value:=Trim(FFactoryName);
|
|||
|
|
FieldByName('FactoryNo').Value:=Trim(FFactoryNo);
|
|||
|
|
FieldByName('CRTime').Value:=CRTime.datetime;
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Qty').Value:=ClientDataSet1.fieldbyname('Qty').AsFloat;
|
|||
|
|
FieldByName('SJQty').Value:=ClientDataSet1.fieldbyname('Qty').AsFloat;
|
|||
|
|
FieldByName('QtyUnit').Value:='M';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Qty').Value:=ClientDataSet1.fieldbyname('KGQty').AsFloat;
|
|||
|
|
FieldByName('SJQty').Value:=ClientDataSet1.fieldbyname('KGQty').AsFloat;
|
|||
|
|
FieldByName('QtyUnit').Value:='KG';
|
|||
|
|
end;
|
|||
|
|
FieldByName('PS').Value:=ClientDataSet1.fieldbyname('PS').AsFloat;
|
|||
|
|
FieldByName('YFType').Value:='<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('Price').Value:=ClientDataSet1.fieldbyname('MYMDPrice').AsFloat;
|
|||
|
|
if HSFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
FieldByName('HanShui').Value:='<27><>˰';
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FieldByName('HanShui').Value:='<27><><EFBFBD><EFBFBD>˰';
|
|||
|
|
end;
|
|||
|
|
FieldByName('CKNO').Value:=trim(FMainid);
|
|||
|
|
FieldByName('MiQty').Value:=ClientDataSet1.fieldbyname('Qty').AsFloat;
|
|||
|
|
FieldByName('KGQty').Value:=ClientDataSet1.fieldbyname('KGQty').AsFloat;
|
|||
|
|
FieldByName('money').Value:=ClientDataSet1.fieldbyname('MYMDMoney').AsFloat;
|
|||
|
|
FieldByName('HSmoney').Value:=ClientDataSet1.fieldbyname('MYMDMoney').AsFloat;
|
|||
|
|
FieldByName('P_CodeName').Value:=ClientDataSet1.fieldbyname('MYName').AsString;
|
|||
|
|
FieldByName('YFName').Value:='<27>ɹ<DEB2>';
|
|||
|
|
FieldByName('P_MF').Value:=ClientDataSet1.fieldbyname('MYMF').AsString;
|
|||
|
|
FieldByName('P_KZ').Value:=ClientDataSet1.fieldbyname('MYKZ').AsString;
|
|||
|
|
FieldByName('P_Code').Value:=ClientDataSet1.fieldbyname('MYCode').AsString;
|
|||
|
|
FieldByName('BZType').Value:='<27><>';
|
|||
|
|
FieldByName('status').Value:='0';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update YS_Money_KC Set KCMoney=(select isnull(Sum(HSMoney*QtyFlag),0) from YS_Money_CR A where A.CRID=YS_Money_KC.CRID)');
|
|||
|
|
sql.Add(' where CRID='+CRID);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Result:=True;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27>ɹ<DEB2><C9B9><EFBFBD><EFBFBD><EFBFBD>3',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Initimage();
|
|||
|
|
var
|
|||
|
|
ListItem: TListItem;
|
|||
|
|
Flag: Cardinal;
|
|||
|
|
info: SHFILEINFOA;
|
|||
|
|
Icon: TIcon;
|
|||
|
|
begin
|
|||
|
|
ListView1.Items.Clear;
|
|||
|
|
with adoqueryTmp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select fileName from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+''' ');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
open;
|
|||
|
|
if not IsEmpty then
|
|||
|
|
begin
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
with ListView1 do
|
|||
|
|
begin
|
|||
|
|
LargeImages := ImageList1;
|
|||
|
|
Icon := TIcon.Create;
|
|||
|
|
ListItem := Items.Add;
|
|||
|
|
Listitem.Caption := trim(fieldbyname('fileName').AsString);
|
|||
|
|
Flag := (SHGFI_LARGEICON or SHGFI_ICON or SHGFI_USEFILEATTRIBUTES);
|
|||
|
|
SHGetFileInfo(Pchar(trim(fieldbyname('fileName').AsString)), 0, info, Sizeof(info), Flag);
|
|||
|
|
Icon.Handle := info.hIcon;
|
|||
|
|
ImageList1.AddIcon(Icon);
|
|||
|
|
ListItem.ImageIndex := ImageList1.Count - 1;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.InitData();
|
|||
|
|
var maxmxno:string;
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select * ');
|
|||
|
|
sql.Add(' from CK_MYSC_CR ');
|
|||
|
|
sql.Add(' where RKNo='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQuery1.IsEmpty=false then
|
|||
|
|
begin
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel4,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel4,0);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel5,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel5,0);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel1,2);
|
|||
|
|
MDMFlag.Checked:=ADOQuery1.FieldByName('MDMflag').AsBoolean;
|
|||
|
|
MDKGFlag.Checked:=ADOQuery1.FieldByName('MDKGFlag').AsBoolean;
|
|||
|
|
HSFlag.Checked:=ADOQuery1.FieldByName('HSFlag').AsBoolean;
|
|||
|
|
BHSFlag.Checked:=ADOQuery1.FieldByName('BHSFlag').AsBoolean;
|
|||
|
|
KHName.TxtCode:=Trim(ADOQuery1.fieldbyname('KHCode').AsString);
|
|||
|
|
labMYType.Caption:=Trim(ADOQuery1.fieldbyname('MYType').AsString);
|
|||
|
|
MYName.text:=Trim(ADOQuery1.fieldbyname('MYName').AsString);
|
|||
|
|
MYCode.text:=Trim(ADOQuery1.fieldbyname('MYCode').AsString);
|
|||
|
|
MYMDPrice.text:=Trim(floattostr(ADOQuery1.fieldbyname('MYMDPrice').asfloat));
|
|||
|
|
CGName.text:=Trim(ADOQuery1.fieldbyname('CGName').AsString);
|
|||
|
|
Button1.Visible:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
CRTime.Date:=SGetServerDate(ADOTemp);
|
|||
|
|
labMYType.Caption:=FMYType;
|
|||
|
|
filler.Text:=Trim(DName);
|
|||
|
|
end;
|
|||
|
|
if TBSave.Visible=False then
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible:=False;
|
|||
|
|
initBtnColor(Panel4,clMenu);
|
|||
|
|
initBtnColor(Panel5,clMenu);
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1,ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQuery1,ClientDataSet1);
|
|||
|
|
if RKNo.Text='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxmxno,'RN','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
RKNo.Text:=Trim(maxmxno);
|
|||
|
|
end;
|
|||
|
|
initImage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitData();
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.add(' select UserName from SY_User where Udept like ''%<25>ɹ<EFBFBD><C9B9><EFBFBD>%'' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
CGName.Items.Add('');
|
|||
|
|
while not EOF do
|
|||
|
|
begin
|
|||
|
|
CGName.Items.Add(trim(fieldByName('UserName').AsString));
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmLLRKInPutMH_MCGCS.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxno,maxmxno,maxnoflag,fsj,FMXID:String;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
if RKNo.Text='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxmxno,'RN','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
RKNo.Text:=Trim(maxmxno);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from YS_Money_CR where YFTypeId in (select MYID from CK_MYSC_CR where RKNo='''+Trim(RKNo.Text)+''')');
|
|||
|
|
SQL.Add(' delete from CK_MYSC_CR where RKNo='''+Trim(RKNo.Text)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(ClientDataSet1.fieldbyname('MYID').AsString)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'MH','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
maxno:=Trim(ClientDataSet1.fieldbyname('MYID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR where MYId='''+Trim(maxno)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value:=Trim(filler.Text);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
if PState=1 then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('EditerCode').Value:=Trim(DCode);
|
|||
|
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
RTSetsavedata(ADOCmd,'CK_MYSC_CR',Panel4,2);
|
|||
|
|
RTSetsavedata(ADOCmd,'CK_MYSC_CR',Panel1,2);
|
|||
|
|
SSetSaveDataCDS(ADOCmd,TV1,ClientDataSet1,'CK_MYSC_CR',2);
|
|||
|
|
FieldByName('MXKCPiQty').value:=ClientDataSet1.fieldbyname('MXHZPS').asfloat;
|
|||
|
|
FieldByName('MXKCKgQty').value:=ClientDataSet1.fieldbyname('MXHZKgQty').asfloat;
|
|||
|
|
FieldByName('MXKCQty').value:=ClientDataSet1.fieldbyname('MXHZQty').asfloat;
|
|||
|
|
FieldByName('MYId').Value:=Trim(maxno);
|
|||
|
|
FieldByName('CRType').Value:='<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRQtyFlag').Value:=1;
|
|||
|
|
FieldByName('MYType').Value:=Trim(FMYType);
|
|||
|
|
FieldByName('MYTypeFlag').Value:=Trim(FMYTypeFlag);
|
|||
|
|
fieldbyname('CGName').AsString:=Trim(CGName.Text);
|
|||
|
|
if ClientDataSet1.fieldbyname('GFOrderNo').AsString<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('GFOrderNo').Value:=ClientDataSet1.fieldbyname('GFOrderNo').AsString;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('GFOrderNo').Value:=ClientDataSet1.fieldbyname('RKNo').AsString;
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
FMainId:=Trim(maxno);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('update M_ZDY set BPPrice='''+trim(ClientDataSet1.fieldbyname('MYMDPrice').AsString)+''' ');
|
|||
|
|
if ClientDataSet1.fieldbyname('HSFlag').AsBoolean=false then
|
|||
|
|
sql.Add(',IFHS=''<27><><EFBFBD><EFBFBD>˰''')
|
|||
|
|
else
|
|||
|
|
sql.Add(',IFHS=''<27><>˰''');
|
|||
|
|
sql.Add(' where BPCode='''+trim(ClientDataSet1.fieldbyname('MYCode').AsString)+'''');
|
|||
|
|
sql.Add(' and BPName='''+trim(ClientDataSet1.fieldbyname('MYName').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MYID').AsString:=Trim(maxno);
|
|||
|
|
end;
|
|||
|
|
YFData(maxno);
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
Result:=False;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.TBSaveClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
if Trim(KHName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB3>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ClientDataSet1.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Button1.Click;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.ReadINIFile10();
|
|||
|
|
var
|
|||
|
|
programIni:Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
|
FileName:string;
|
|||
|
|
begin
|
|||
|
|
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
|||
|
|
programIni:=Tinifile.create(FileName);
|
|||
|
|
server:=programIni.ReadString('SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
programIni.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.SaveImage(maxnoWB:string);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
Procedure TfrmLLRKInPutMH_MCGCS.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
lstPat := TStringList.Create;
|
|||
|
|
ReadCxGrid('<27>ɹ<DEB2><C9B9><EFBFBD><EFBFBD><EFBFBD>3',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.KHNameBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
|
with frmGYSList do
|
|||
|
|
begin
|
|||
|
|
KHType.Text:='<27><EFBFBD>';
|
|||
|
|
KHType.TxtCode:='<27><EFBFBD>';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.KHName.Text:=Trim(frmGYSList.Order_Main.fieldbyname('KHName').AsString);
|
|||
|
|
Self.KHNo.Text:=Trim(frmGYSList.Order_Main.fieldbyname('KHNo').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmGYSList.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Image1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>ܲ鿴<DCB2><E9BFB4>ͼ!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmZHCPBigTP:=TfrmZHCPBigTP.Create(Application);
|
|||
|
|
with frmZHCPBigTP do
|
|||
|
|
begin
|
|||
|
|
frmZHCPBigTP.FMainId:=Self.FMainId;
|
|||
|
|
frmZHCPBigTP.FIMNO:='';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZHCPBigTP.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Panel1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>','',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmLLRKMXInPutMH:=TfrmLLRKMXInPutMH.Create(Application);
|
|||
|
|
with frmLLRKMXInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState:=1;
|
|||
|
|
frmLLRKMXInPutMH.FMainId:=Trim(Self.FMainId);
|
|||
|
|
if Self.TBSave.Visible=False then
|
|||
|
|
begin
|
|||
|
|
frmLLRKMXInPutMH.TBSave.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKMXInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Label20Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>','',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmLLRKMXInPutMH:=TfrmLLRKMXInPutMH.Create(Application);
|
|||
|
|
with frmLLRKMXInPutMH do
|
|||
|
|
begin
|
|||
|
|
PState:=1;
|
|||
|
|
frmLLRKMXInPutMH.FMainId:=Trim(Self.FMainId);
|
|||
|
|
if Self.TBSave.Visible=False then
|
|||
|
|
begin
|
|||
|
|
frmLLRKMXInPutMH.TBSave.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLLRKMXInPutMH.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.GetHZData();
|
|||
|
|
var
|
|||
|
|
FKG,FM,FPS:String;
|
|||
|
|
begin
|
|||
|
|
FKG:=Tv1.DataController.Summary.FooterSummaryTexts[0];
|
|||
|
|
FM:=Tv1.DataController.Summary.FooterSummaryTexts[1];
|
|||
|
|
FPS:=Tv1.DataController.Summary.FooterSummaryTexts[2];
|
|||
|
|
MXHZPS.Text:=FPS;
|
|||
|
|
MXHZKGQty.Text:=FKG;
|
|||
|
|
MXHZQty.Text:=FM;
|
|||
|
|
if (Trim(FPS)='') or (Trim(FPS)='0') then
|
|||
|
|
begin
|
|||
|
|
SClearData(Panel2,2);
|
|||
|
|
SClearData(Panel2,99);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Avg_JS :KgQty,:MQty,:PS');
|
|||
|
|
if Trim(FKG)<>'' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=FKG;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
if Trim(FM)<>'' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=FM;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
Parameters.ParamByName('PS').Value:=FPS;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
PSChaE.Text:=FloatToStr(strtofloatdef(MXHZPS.Text,0)-strtofloatdef(PS.Text,0));
|
|||
|
|
QtyChaE.Text:=FloatToStr(strtofloatdef(MXHZQty.Text,0)-strtofloatdef(Qty.Text,0));
|
|||
|
|
KgQtyChaE.Text:=FloatToStr(strtofloatdef(MXHZKgQty.Text,0)-strtofloatdef(KGQty.Text,0));
|
|||
|
|
MoneyChaE.Text:=FloatToStr(strtofloatdef(MYHDMoney.Text,0)-strtofloatdef(MYMDMoney.Text,0));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmLLRKInPutMH_MCGCS.SaveDataMX():Boolean;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.QtyChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(Qty.text,0));
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(KgQty.text,0));
|
|||
|
|
MXHZQty.Text:=Qty.Text;
|
|||
|
|
MXHZKgQty.Text:=KgQty.Text;
|
|||
|
|
QtyChaE.Text:=FloatToStr(StrToFloatDef(MXHZQty.Text,0)-strtofloatdef(Qty.Text,0));
|
|||
|
|
KgQtyChaE.Text:=FloatToStr(StrToFloatDef(MXHZKgQty.Text,0)-strtofloatdef(KgQty.Text,0));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MDMFlagClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
MDKGFlag.Checked:=false;
|
|||
|
|
KgQty.ReadOnly:=True;
|
|||
|
|
KgQty.Color:=clMenu;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if MDKGFlag.Checked=false then
|
|||
|
|
MDKGFlag.Checked:=true;
|
|||
|
|
KgQty.ReadOnly:=false;
|
|||
|
|
KgQty.Color:=clWindow;
|
|||
|
|
end;
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZQty.text,0));
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(Qty.text,0));
|
|||
|
|
end;
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(KgQty.text,0));
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZKgQty.text,0));
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MDKGFlagClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
MDMFlag.Checked:=false;
|
|||
|
|
KgQty.ReadOnly:=false;
|
|||
|
|
KgQty.Color:=clWindow;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=false then
|
|||
|
|
MDMFlag.Checked:=true;
|
|||
|
|
KgQty.ReadOnly:=True;
|
|||
|
|
KgQty.Color:=clMenu;
|
|||
|
|
end;
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZQty.text,0));
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(Qty.text,0));
|
|||
|
|
end;
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(KgQty.text,0));
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZKgQty.text,0));
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MYNameBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmBPZDY_LRM:=TfrmBPZDY_LRM.create(self);
|
|||
|
|
with frmBPZDY_LRM do
|
|||
|
|
begin
|
|||
|
|
flag:='MName';
|
|||
|
|
flagName:='<27><>';
|
|||
|
|
ViewFlag:=true;
|
|||
|
|
Panel4.Align:=alClient;
|
|||
|
|
ToolBar3.Visible:=false;
|
|||
|
|
Button1.Visible:=False;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
MYName.text:=Trim(ClientDataSet1.fieldbyname('BPName').AsString);
|
|||
|
|
MYCode.text:=Trim(ClientDataSet1.fieldbyname('BPCode').AsString);
|
|||
|
|
MYMF.text:=Trim(ClientDataSet1.fieldbyname('BPMF').AsString);
|
|||
|
|
MYKZ.text:=Trim(ClientDataSet1.fieldbyname('BPKZ').AsString);
|
|||
|
|
MYCF.text:=Trim(ClientDataSet1.fieldbyname('BPCF').AsString);
|
|||
|
|
MYPrice.text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
MYMDPrice.text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
Note.text:=Trim(ClientDataSet1.fieldbyname('BPNote').AsString);
|
|||
|
|
MDJChang.SetFocus;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MXHZQtyChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZQty.text,0));
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZKgQty.text,0));
|
|||
|
|
QtyChaE.Text:=FloatToStr(StrToFloatDef(MXHZQty.Text,0)-strtofloatdef(Qty.Text,0));
|
|||
|
|
KgQtyChaE.Text:=FloatToStr(StrToFloatDef(MXHZKgQty.Text,0)-strtofloatdef(KgQty.Text,0));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Panel13Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Button2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
maxNo:string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
adoqueryCmd.Connection.BeginTrans;
|
|||
|
|
begin
|
|||
|
|
fFilePath:=WJPach.Text;
|
|||
|
|
fFileName:=WJName.Text;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TFId from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add(' and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
IF ADOQueryCmd.IsEmpty=False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><DEB8>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
Panel2.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel2.Visible:=true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxNo,'MD','TP_File',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value:=trim(maxNO);
|
|||
|
|
fieldbyname('WBID').Value:=trim(RKNo.Text);
|
|||
|
|
fieldbyname('TFType').Value:='<27>ɹ<EFBFBD><C9B9><EFBFBD>';
|
|||
|
|
fieldbyname('FileName').Value:=trim(fFileName);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
if fFilePath <> '' then
|
|||
|
|
begin
|
|||
|
|
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();
|
|||
|
|
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27>ϴ<EFBFBD><CFB4>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
adoqueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
adoqueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Button8Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:String;
|
|||
|
|
begin
|
|||
|
|
fFileName:=WJName.Hint;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate TP_File Set FileName='''+Trim(WJName.Text)+'''');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Button7Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
maxNo:string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
adoqueryCmd.Connection.BeginTrans;
|
|||
|
|
fFilePath:=WJPach.Text;
|
|||
|
|
fFileName:=WJName.Hint;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TFId from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
IF not adoqueryCmd.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4>ڣ<EFBFBD><DAA3><EFBFBD><EFBFBD><EFBFBD><DEB8>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
Panel2.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><CFB4><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel2.Visible:=true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxNo,'FJ','TP_File',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value:=trim(maxNO);
|
|||
|
|
fieldbyname('WBID').Value:=trim(RKNo.Text);
|
|||
|
|
fieldbyname('TFType').Value:='<27>ɹ<EFBFBD><C9B9><EFBFBD>';
|
|||
|
|
fieldbyname('FileName').Value:=trim(fFileName);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
if fFilePath <> '' then
|
|||
|
|
begin
|
|||
|
|
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();
|
|||
|
|
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27>ϴ<EFBFBD><CFB4>ļ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
Initimage();
|
|||
|
|
adoqueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
adoqueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Image2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel12.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MenuItem1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
OpenDiaLog: TOpenDialog;
|
|||
|
|
fFileName,FWJName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FWJName,'M','CK_MYSC_CR_MX',2,1)=False then
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
OpenDiaLog := TOpenDialog.Create(Self);
|
|||
|
|
if OpenDiaLog.Execute then
|
|||
|
|
begin
|
|||
|
|
fFilePath:=OpenDiaLog.FileName;
|
|||
|
|
fFileName:=ExtractFileName(OpenDiaLog.FileName);
|
|||
|
|
fFileName:=FWJName+copy(fFileName,Pos('.',fFileName),Length(fFileName));
|
|||
|
|
Panel12.Visible:=True;
|
|||
|
|
WJName.Text:=Trim(fFileName);
|
|||
|
|
WJName.Hint:=Trim(fFileName);
|
|||
|
|
WJPach.Text:=fFilePath;
|
|||
|
|
Button8.Visible:=False;
|
|||
|
|
Button2.Visible:=True;
|
|||
|
|
Button7.Visible:=True;
|
|||
|
|
Panel12.Refresh;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.N3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:string;
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount<1 then exit;
|
|||
|
|
try
|
|||
|
|
fFileName:=ListView1.Selected.Caption;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(RKNo.Text)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Initimage();
|
|||
|
|
except
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MenuItem2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount<1 then exit;
|
|||
|
|
Panel12.Visible:=True;
|
|||
|
|
Button2.Visible:=False;
|
|||
|
|
Button7.Visible:=False;
|
|||
|
|
Button8.Visible:=True;
|
|||
|
|
Panel12.Refresh;
|
|||
|
|
WJName.Text:=Trim(ListView1.Selected.Caption);
|
|||
|
|
WJName.Hint:=Trim(ListView1.Selected.Caption);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.N4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
SaveDialog: TSaveDialog;
|
|||
|
|
fFileName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount<1 then exit;
|
|||
|
|
try
|
|||
|
|
fFileName:=ListView1.Selected.Caption;
|
|||
|
|
SaveDialog := TSaveDialog.Create(Self);
|
|||
|
|
SaveDialog.FileName:=fFileName;
|
|||
|
|
if SaveDialog.Execute then
|
|||
|
|
begin
|
|||
|
|
Panel2.Caption:='<27><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel2.Visible:=true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
fFilePath:=SaveDialog.FileName;
|
|||
|
|
try
|
|||
|
|
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI','SERVER','FTP<54><50>ַ','127.0.0.1');;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
Panel2.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel2.Visible:=true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
try
|
|||
|
|
IdFTP1.Get('FJ\'+ Trim(fFileName), fFilePath,false, true);
|
|||
|
|
except
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
if IdFTP1.Connected then IdFTP1.Quit;
|
|||
|
|
end;
|
|||
|
|
except
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Panel2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.ListView1DblClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
sFieldName:string;
|
|||
|
|
fileName:string;
|
|||
|
|
begin
|
|||
|
|
if ListView1.Items.Count<1 THEN EXIT;
|
|||
|
|
|
|||
|
|
if listView1.SelCount<1 then exit;
|
|||
|
|
sFieldName:=leftbstr(ExtractFilePath(Application.ExeName),1)+':\ͼƬ<CDBC>鿴';
|
|||
|
|
|
|||
|
|
if not DirectoryExists(pchar(sFieldName)) then
|
|||
|
|
CreateDirectory(pchar(sFieldName),nil);
|
|||
|
|
|
|||
|
|
fileName:=ListView1.Selected.Caption;
|
|||
|
|
|
|||
|
|
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
|
|||
|
|
|
|||
|
|
Panel2.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>Ե<EFBFBD>...';
|
|||
|
|
Panel2.Visible:=true;
|
|||
|
|
application.ProcessMessages;
|
|||
|
|
try
|
|||
|
|
IdFTP1.Get('FJ\'+ Trim(fileName), sFieldName,true, false);
|
|||
|
|
except
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
Application.MessageBox('<27>ͻ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
if IdFTP1.Connected then IdFTP1.Quit;
|
|||
|
|
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.JCDanWeiBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
|
with frmGYSList do
|
|||
|
|
begin
|
|||
|
|
KHType.Text:='<27>廨<EFBFBD><E5BBA8>';
|
|||
|
|
KHType.TxtCode:='<27>廨<EFBFBD><E5BBA8>';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.JCDanWei.Text:=Trim(frmGYSList.Order_Main.fieldbyname('KHName').AsString);
|
|||
|
|
Self.JCNo.Text:=Trim(frmGYSList.Order_Main.fieldbyname('KHNo').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmGYSList.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MXHZKgQtyChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZQty.text,0));
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZKgQty.text,0));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MYMDPriceChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(Qty.text,0));
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZQty.text,0));
|
|||
|
|
end;
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(KgQty.text,0));
|
|||
|
|
MYHDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(MXHZKgQty.text,0));
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.HSFlagClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if HSFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
if BHSFlag.Checked=true then
|
|||
|
|
BHSFlag.Checked:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if BHSFlag.Checked=false then
|
|||
|
|
BHSFlag.Checked:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.BHSFlagClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if BHSFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
if HSFlag.Checked=true then
|
|||
|
|
HSFlag.Checked:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if HSFlag.Checked=false then
|
|||
|
|
HSFlag.Checked:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.PSChaEChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if StrToFloatDef(PSChaE.Text,0)>0 then
|
|||
|
|
begin
|
|||
|
|
PSChaE.Font.Color:=clGreen;
|
|||
|
|
end;
|
|||
|
|
if StrToFloatDef(PSChaE.Text,0)<0 then
|
|||
|
|
begin
|
|||
|
|
PSChaE.Font.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.QtyChaEChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if StrToFloatDef(QtyChaE.Text,0)>0 then
|
|||
|
|
begin
|
|||
|
|
QtyChaE.Font.Color:=clGreen;
|
|||
|
|
end;
|
|||
|
|
if StrToFloatDef(QtyChaE.Text,0)<0 then
|
|||
|
|
begin
|
|||
|
|
QtyChaE.Font.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.KgQtyChaEChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if StrToFloatDef(KgQtyChaE.Text,0)>0 then
|
|||
|
|
begin
|
|||
|
|
KgQtyChaE.Font.Color:=clGreen;
|
|||
|
|
end;
|
|||
|
|
if StrToFloatDef(KgQtyChaE.Text,0)<0 then
|
|||
|
|
begin
|
|||
|
|
KgQtyChaE.Font.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MoneyChaEChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if StrToFloatDef(MoneyChaE.Text,0)>0 then
|
|||
|
|
begin
|
|||
|
|
MoneyChaE.Font.Color:=clGreen;
|
|||
|
|
end;
|
|||
|
|
if StrToFloatDef(MoneyChaE.Text,0)<0 then
|
|||
|
|
begin
|
|||
|
|
MoneyChaE.Font.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MDJChangChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
XTKGQty.Text:=FormatFloat('0.0',strtofloatdef(MYKZ.text,0)*strtofloatdef(MYMF.text,0)*strtofloatdef(MDJChang.text,0)*strtofloatdef(PS.text,0)/100000);
|
|||
|
|
KgQty.Text:=FormatFloat('0.0',strtofloatdef(MYKZ.text,0)*strtofloatdef(MYMF.text,0)*strtofloatdef(MDJChang.text,0)*strtofloatdef(PS.text,0)/100000);
|
|||
|
|
Qty.Text:=FloatToStr(strtofloatdef(MDJChang.text,0)*strtofloatdef(PS.text,0));
|
|||
|
|
MXHZJChang.Text:=MDJChang.Text;
|
|||
|
|
MXHZPS.Text:=PS.Text;
|
|||
|
|
JChangCharE.Text:=FloatToStr(StrToFloatDef(MXHZJChang.Text,0)-strtofloatdef(MDJChang.Text,0));
|
|||
|
|
PSChaE.Text:=FloatToStr(StrToFloatDef(MXHZPS.Text,0)-strtofloatdef(PS.Text,0));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.JChangCharEChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if StrToFloatDef(JChangCharE.Text,0)>0 then
|
|||
|
|
begin
|
|||
|
|
JChangCharE.Font.Color:=clGreen;
|
|||
|
|
end;
|
|||
|
|
if StrToFloatDef(JChangCharE.Text,0)<0 then
|
|||
|
|
begin
|
|||
|
|
JChangCharE.Font.Color:=clRed;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MXHZJChangChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
JChangCharE.Text:=FloatToStr(StrToFloatDef(MXHZJChang.Text,0)-strtofloatdef(MDJChang.Text,0));
|
|||
|
|
MXHZQty.Text:=FloatToStr(StrToFloatDef(MXHZJChang.Text,0)*StrToFloatDef(MXHZPS.Text,0));
|
|||
|
|
MXHZKgQty.Text:=FormatFloat('0.0',strtofloatdef(MYKZ.text,0)*strtofloatdef(MYMF.text,0)*strtofloatdef(MXHZJChang.text,0)*strtofloatdef(MXHZPS.text,0)/100000);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MXHZPSChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
PSChaE.Text:=FloatToStr(StrToFloatDef(MXHZPS.Text,0)-strtofloatdef(PS.Text,0));
|
|||
|
|
MXHZQty.Text:=FloatToStr(StrToFloatDef(MXHZJChang.Text,0)*StrToFloatDef(MXHZPS.Text,0));
|
|||
|
|
MXHZKgQty.Text:=FormatFloat('0.0',strtofloatdef(MYKZ.text,0)*strtofloatdef(MYMF.text,0)*strtofloatdef(MXHZJChang.text,0)*strtofloatdef(MXHZPS.text,0)/100000);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YS_Money_CR where YFTypeId='''+trim(ClientDataSet1.fieldbyname('MYID').AsString)+'''');
|
|||
|
|
sql.Add(' and (isnull(ChkerP,'''')<>'''' ');
|
|||
|
|
sql.Add(' or isnull(ChkerQ,'''')<>'''') ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
{if ClientDataSet1.FieldByName('MYID').AsString<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from CK_MYSC_CR ');
|
|||
|
|
sql.Add('where MYID='''+trim(ClientDataSet1.FieldByName('MYID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;}
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Tv1MouseDown(Sender: TObject;
|
|||
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
SCSHDataCDS(ClientDataSet1,Panel5,2);
|
|||
|
|
SCSHDataCDS(ClientDataSet1,Panel14,2);
|
|||
|
|
MYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
MYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Button1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FJQty,FKG,FM,FMoney:String;
|
|||
|
|
FReal:Double;
|
|||
|
|
FInt:Integer;
|
|||
|
|
begin
|
|||
|
|
if Trim(MYName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(KHName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB3>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MYCode.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ޱ<EFBFBD><DEB1>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MYMDPrice.Text)='' then
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('<27><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then exit;
|
|||
|
|
end;
|
|||
|
|
if (MDMFlag.Checked=False) and (MDKGFlag.Checked=False) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD>Ƽ۷<C6BC>ʽ','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if (HSFlag.Checked=False) and (BHSFlag.Checked=False) then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>˰<EFBFBD><EFBFBD>˰','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(PS.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ƥ<><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if TryStrToInt(PS.Text,FInt)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ƥ<><C6A5><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if (Trim(Qty.Text)='') and (Trim(KgQty.text)='') then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱΪ<CAB1><CEAA>!','<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(Qty.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(Qty.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Trim(KgQty.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToFloat(KgQty.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
if Button1.Caption='ȷ<><C8B7>' then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
edit;
|
|||
|
|
RTsavedataCDS(ClientDataSet1,Panel5,2);
|
|||
|
|
RTsavedataCDS(ClientDataSet1,Panel14,2);
|
|||
|
|
ClientDataSet1.FieldByName('MYName').AsString:=trim(MYName.Text);
|
|||
|
|
ClientDataSet1.FieldByName('MYCode').AsString:=trim(MYCode.Text);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
SClearData(Panel5,2);
|
|||
|
|
SClearData(Panel15,2);
|
|||
|
|
MYMDPrice.Text:='';
|
|||
|
|
JCDanWei.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>˾';
|
|||
|
|
JCNo.Text:='GS02';
|
|||
|
|
MYMF.Text:='151';
|
|||
|
|
MDKGFlag.Checked:=True;
|
|||
|
|
HSFlag.Checked:=true;
|
|||
|
|
FJQty:=Tv1.DataController.Summary.FooterSummaryTexts[0];
|
|||
|
|
FM:=Tv1.DataController.Summary.FooterSummaryTexts[1];
|
|||
|
|
FKG:=Tv1.DataController.Summary.FooterSummaryTexts[2];
|
|||
|
|
FMoney:=Tv1.DataController.Summary.FooterSummaryTexts[3];
|
|||
|
|
ZJQty.Text:=FJQty;
|
|||
|
|
ZMQty.Text:=FM;
|
|||
|
|
ZKGQty.Text:=FKG;
|
|||
|
|
ZMoney.Text:=FMoney;
|
|||
|
|
Button1.Caption:='ȷ<><C8B7>';
|
|||
|
|
//button1.Visible:=false;
|
|||
|
|
cxGrid1.Enabled:=true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MYMDMoneyChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
MoneyChaE.Text:=FloatToStr(strtofloatdef(MYHDMoney.text,0)*strtofloatdef(MYMDMoney.text,0));
|
|||
|
|
MYHDMoney.Text:=MYMDMoney.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MDJChangKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
PS.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.PSKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
MXHZJChang.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MXHZJChangKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
MXHZPS.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MXHZPSKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
Note.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.NoteKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
MYMDPrice.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MYMDPriceKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
button1.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Button1KeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
Button1.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Button1.Visible:=true;
|
|||
|
|
button1.Caption:='ȷ<><C8B7>';
|
|||
|
|
SClearData(Panel5,2);
|
|||
|
|
SClearData(Panel15,2);
|
|||
|
|
MYMDPrice.Text:='';
|
|||
|
|
JCDanWei.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>˾';
|
|||
|
|
JCNo.Text:='GS02';
|
|||
|
|
MYMF.Text:='151';
|
|||
|
|
MDKGFlag.Checked:=True;
|
|||
|
|
HSFlag.Checked:=true;
|
|||
|
|
Panel5.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.N5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SCSHDataCDS(ClientDataSet1,Panel5,2);
|
|||
|
|
SCSHDataCDS(ClientDataSet1,Panel14,2);
|
|||
|
|
MYName.Text:=Trim(ClientDataSet1.fieldbyname('MYName').AsString);
|
|||
|
|
MYCode.Text:=Trim(ClientDataSet1.fieldbyname('MYCode').AsString);
|
|||
|
|
Initimage();
|
|||
|
|
Button1.Visible:=true;
|
|||
|
|
button1.Caption:='<27><EFBFBD>';
|
|||
|
|
cxGrid1.Enabled:=false;
|
|||
|
|
Panel5.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.Tv1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if TBSave.Visible=False then
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_MCGCS.MYMFBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='MMYKZ';
|
|||
|
|
flagName:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
V1Name.Caption:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
//MainType:=Trim(KHName.Text);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
MYMF.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
XTKGQty.Text:=FormatFloat('0.0',strtofloatdef(MYKZ.text,0)*strtofloatdef(MYMF.text,0)*strtofloatdef(MDJChang.text,0)*strtofloatdef(PS.text,0)/100000);
|
|||
|
|
KgQty.Text:=FormatFloat('0.0',strtofloatdef(MYKZ.text,0)*strtofloatdef(MYMF.text,0)*strtofloatdef(MDJChang.text,0)*strtofloatdef(PS.text,0)/100000);
|
|||
|
|
MYMDMoney.Text:=FloatToStr(strtofloatdef(MYMDPrice.text,0)*strtofloatdef(KgQty.text,0));
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|