2585 lines
72 KiB
ObjectPascal
2585 lines
72 KiB
ObjectPascal
|
|
unit U_LLRKInPut_CPZS;
|
|||
|
|
|
|||
|
|
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, cxGridBandedTableView, cxGridDBBandedTableView;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmLLRKInPutMH_CPZS = 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;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
labMYType: TLabel;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
CRTime: TDateTimePicker;
|
|||
|
|
KHName: TBtnEditA;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
Label32: TLabel;
|
|||
|
|
MYKZ: TEdit;
|
|||
|
|
MYMF: TEdit;
|
|||
|
|
PS: TEdit;
|
|||
|
|
Qty: TEdit;
|
|||
|
|
KgQty: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
MXHZPS: TEdit;
|
|||
|
|
MXHZQty: TEdit;
|
|||
|
|
MXHZKgQty: TEdit;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
PSChaE: TEdit;
|
|||
|
|
QtyChaE: TEdit;
|
|||
|
|
KgQtyChaE: TEdit;
|
|||
|
|
Panel7: TPanel;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
PTID: TEdit;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
SaveDialog1: TSaveDialog;
|
|||
|
|
adoqueryPicture: TADOQuery;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
MYCF: TEdit;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
MYJWS: TEdit;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
MYMD: TEdit;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
MYPrice: TEdit;
|
|||
|
|
Panel16: TPanel;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
MYMDMoney: TEdit;
|
|||
|
|
MYHDMoney: TEdit;
|
|||
|
|
Label28: TLabel;
|
|||
|
|
Label29: TLabel;
|
|||
|
|
cxGroupBox1: TcxGroupBox;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
Label30: TLabel;
|
|||
|
|
Label35: TLabel;
|
|||
|
|
Label36: TLabel;
|
|||
|
|
QtyLRM: TEdit;
|
|||
|
|
UnitM: TEdit;
|
|||
|
|
UnitKg: TEdit;
|
|||
|
|
RCGangNo: TEdit;
|
|||
|
|
QtyLRKg: TEdit;
|
|||
|
|
BtnM: TButton;
|
|||
|
|
BtnKg: TButton;
|
|||
|
|
Panel6: TPanel;
|
|||
|
|
Panel8: TPanel;
|
|||
|
|
BtnDel: TButton;
|
|||
|
|
Button1: TButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Button5: TButton;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
KHNo: TEdit;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
N3: TMenuItem;
|
|||
|
|
MenuItem2: TMenuItem;
|
|||
|
|
N4: TMenuItem;
|
|||
|
|
ImageList1: TImageList;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryTmp: TADOQuery;
|
|||
|
|
cxGroupBox2: TcxGroupBox;
|
|||
|
|
ListView1: TListView;
|
|||
|
|
Label33: TLabel;
|
|||
|
|
JCDanWei: TBtnEditA;
|
|||
|
|
JCNo: TEdit;
|
|||
|
|
Panel9: TPanel;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Button9: TButton;
|
|||
|
|
Label38: TLabel;
|
|||
|
|
Edit2: TEdit;
|
|||
|
|
N7: TMenuItem;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
Label37: TLabel;
|
|||
|
|
PLPS: TEdit;
|
|||
|
|
Panel10: TPanel;
|
|||
|
|
Button10: TButton;
|
|||
|
|
Label41: TLabel;
|
|||
|
|
Label42: TLabel;
|
|||
|
|
KgQtyAvg: TEdit;
|
|||
|
|
QtyAvg: TEdit;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
Panel12: TPanel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Button2: TButton;
|
|||
|
|
Panel13: TPanel;
|
|||
|
|
Image2: TImage;
|
|||
|
|
WJName: TEdit;
|
|||
|
|
Button7: TButton;
|
|||
|
|
WJPach: TEdit;
|
|||
|
|
Button8: TButton;
|
|||
|
|
Label44: TLabel;
|
|||
|
|
Label45: TLabel;
|
|||
|
|
Label49: TLabel;
|
|||
|
|
Label50: TLabel;
|
|||
|
|
Panel14: TPanel;
|
|||
|
|
Label51: TLabel;
|
|||
|
|
MYMDPrice: TEdit;
|
|||
|
|
Label43: TLabel;
|
|||
|
|
MDMFlag: TCheckBox;
|
|||
|
|
MDKGFlag: TCheckBox;
|
|||
|
|
MXNote: TEdit;
|
|||
|
|
Label52: TLabel;
|
|||
|
|
Panel15: TPanel;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
MYCode: TEdit;
|
|||
|
|
MYName: TBtnEditA;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
MoneyChaE: TEdit;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Note: TEdit;
|
|||
|
|
HSFlag: TCheckBox;
|
|||
|
|
BHSFlag: TCheckBox;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
RKNo: TEdit;
|
|||
|
|
Label53: TLabel;
|
|||
|
|
CGName: TComboBox;
|
|||
|
|
Panel11: TPanel;
|
|||
|
|
Label46: TLabel;
|
|||
|
|
Label47: TLabel;
|
|||
|
|
Label48: TLabel;
|
|||
|
|
ComboBox2: TComboBox;
|
|||
|
|
ComboBox1: TComboBox;
|
|||
|
|
BtnPrt: TButton;
|
|||
|
|
BtnQX: TButton;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
TV1: TcxGridDBBandedTableView;
|
|||
|
|
V1JH: TcxGridDBBandedColumn;
|
|||
|
|
V1RCGangNo: TcxGridDBBandedColumn;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
V1MQty: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty2: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty2: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty3: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty3: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty4: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty4: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty5: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty5: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty6: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty6: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty7: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty7: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty8: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty8: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty9: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty9: TcxGridDBBandedColumn;
|
|||
|
|
V1MQty10: TcxGridDBBandedColumn;
|
|||
|
|
V1KGQty10: TcxGridDBBandedColumn;
|
|||
|
|
V1HJPS: TcxGridDBBandedColumn;
|
|||
|
|
V1HJQty: TcxGridDBBandedColumn;
|
|||
|
|
V1HJKGQty: TcxGridDBBandedColumn;
|
|||
|
|
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 UnitMClick(Sender: TObject);
|
|||
|
|
procedure UnitKgClick(Sender: TObject);
|
|||
|
|
procedure QtyLRMKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure QtyLRKgKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure BtnMClick(Sender: TObject);
|
|||
|
|
procedure BtnKgClick(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure BtnDelClick(Sender: TObject);
|
|||
|
|
procedure BtnPrtClick(Sender: TObject);
|
|||
|
|
procedure BtnQXClick(Sender: TObject);
|
|||
|
|
procedure Button5Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(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 Button9Click(Sender: TObject);
|
|||
|
|
procedure N5Click(Sender: TObject);
|
|||
|
|
procedure N6Click(Sender: TObject);
|
|||
|
|
procedure N7Click(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure RCGangNo1Change(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 UnitMChange(Sender: TObject);
|
|||
|
|
procedure UnitKgChange(Sender: TObject);
|
|||
|
|
procedure v1MQtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure PSChange(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
lstPat:TStringList;
|
|||
|
|
FangXiang1,FSaveFlag:String;
|
|||
|
|
procedure InitData();
|
|||
|
|
procedure SaveImage(maxnoWB:String);
|
|||
|
|
procedure ReadINIFile10();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
procedure InitColor();
|
|||
|
|
procedure GetHZData();
|
|||
|
|
function SaveDataMX():Boolean;
|
|||
|
|
procedure InitMXData();
|
|||
|
|
procedure Initimage();
|
|||
|
|
function YFData():Boolean;
|
|||
|
|
procedure HSPS();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1:String;
|
|||
|
|
PState,CopyInt:Integer;
|
|||
|
|
FMainId:String;
|
|||
|
|
FRead:String;
|
|||
|
|
FMYType,FMYTypeFlag,FML:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmLLRKInPutMH_CPZS: TfrmLLRKInPutMH_CPZS;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,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_Fun,U_BPZdy_LRPM;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
function TfrmLLRKInPutMH_CPZS.YFData():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(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd,YFID,'PB','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;
|
|||
|
|
FieldByName('SCQty').Value:=strtofloatdef(Qty.text,0);
|
|||
|
|
FieldByName('SCPS').Value:=strtofloatdef(PS.text,0);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YFID').Value:=Trim(YFID);
|
|||
|
|
FieldByName('YFTypeId').Value:=Trim(FMainid);
|
|||
|
|
FieldByName('CRID').Value:=StrToInt(CRID);
|
|||
|
|
FieldByName('YFName').Value:='<27><>Ʒ<EFBFBD>ɹ<EFBFBD>';
|
|||
|
|
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:=Strtofloatdef(Qty.text,0);
|
|||
|
|
FieldByName('QtyUnit').Value:='M';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Qty').Value:=Strtofloatdef(KGQty.text,0);
|
|||
|
|
FieldByName('QtyUnit').Value:='KG';
|
|||
|
|
end;
|
|||
|
|
FieldByName('PS').Value:=Strtofloatdef(PS.text,0);
|
|||
|
|
FieldByName('YFType').Value:='<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('Price').Value:=Strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
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('SJQty').Value:=Strtofloatdef(Qty.text,0);
|
|||
|
|
FieldByName('MiQty').Value:=Strtofloatdef(Qty.text,0);
|
|||
|
|
FieldByName('KGQty').Value:=Strtofloatdef(KGQty.text,0);
|
|||
|
|
FieldByName('money').Value:=Strtofloatdef(MYMDMoney.text,0);
|
|||
|
|
FieldByName('JSmoney').Value:=Strtofloatdef(MYMDMoney.text,0);
|
|||
|
|
FieldByName('HSmoney').Value:=Strtofloatdef(MYMDMoney.text,0);
|
|||
|
|
FieldByName('P_CodeName').Value:=Trim(MYName.text);
|
|||
|
|
FieldByName('P_MF').Value:=Trim(MYMF.text);
|
|||
|
|
FieldByName('P_KZ').Value:=Trim(MYKZ.Text);
|
|||
|
|
FieldByName('P_Code').Value:=Trim(MYCode.Text);
|
|||
|
|
FieldByName('P_Spec').Value:=Trim(MYCF.Text);
|
|||
|
|
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_CPZS.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxBandedGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ¼<CFB8><C2BC>1',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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(FMainId)+''' ');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
//ShowMessage(sql.Text);
|
|||
|
|
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_CPZS.InitData();
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select * ');
|
|||
|
|
sql.Add(' from CK_MYSC_CR ');
|
|||
|
|
sql.Add(' where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel4,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel4,0);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel5,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel5,0);
|
|||
|
|
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);
|
|||
|
|
CGName.text:=Trim(ADOQuery1.fieldbyname('CGName').AsString);
|
|||
|
|
MYMDPrice.text:=Trim(floattostr(ADOQuery1.fieldbyname('MYMDPrice').asfloat));
|
|||
|
|
if PState=0 then
|
|||
|
|
begin
|
|||
|
|
CRTime.Date:=SGetServerDate(ADOTemp);
|
|||
|
|
labMYType.Caption:=FMYType;
|
|||
|
|
end;
|
|||
|
|
if TBSave.Visible=False then
|
|||
|
|
begin
|
|||
|
|
// Panel8.Visible:=False;
|
|||
|
|
Panel2.Visible:=False;
|
|||
|
|
initBtnColor(Panel4,clMenu);
|
|||
|
|
initBtnColor(Panel5,clMenu);
|
|||
|
|
end;
|
|||
|
|
InitMXData();
|
|||
|
|
GetHZData();
|
|||
|
|
if UnitM.Text<>'' then
|
|||
|
|
begin
|
|||
|
|
v1MQty.Visible:=true;
|
|||
|
|
v1MQty2.Visible:=true;
|
|||
|
|
v1MQty3.Visible:=true;
|
|||
|
|
v1MQty4.Visible:=true;
|
|||
|
|
v1MQty5.Visible:=true;
|
|||
|
|
v1MQty6.Visible:=true;
|
|||
|
|
v1MQty7.Visible:=true;
|
|||
|
|
v1MQty8.Visible:=true;
|
|||
|
|
v1MQty9.Visible:=true;
|
|||
|
|
v1MQty10.Visible:=true;
|
|||
|
|
V1HJQty.Visible:=true;
|
|||
|
|
Label45.Visible:=true;
|
|||
|
|
Qty.Visible:=true;
|
|||
|
|
Label44.Visible:=true;
|
|||
|
|
Label17.Visible:=True;
|
|||
|
|
QtyChaE.Visible:=True;
|
|||
|
|
MXHZQty.Visible:=true;
|
|||
|
|
v1KgQty.Visible:=false;
|
|||
|
|
v1KgQty2.Visible:=false;
|
|||
|
|
v1KgQty3.Visible:=false;
|
|||
|
|
v1KgQty4.Visible:=false;
|
|||
|
|
v1KgQty5.Visible:=false;
|
|||
|
|
v1KgQty6.Visible:=false;
|
|||
|
|
v1KgQty7.Visible:=false;
|
|||
|
|
v1KgQty8.Visible:=false;
|
|||
|
|
v1KgQty9.Visible:=false;
|
|||
|
|
v1KgQty10.Visible:=false;
|
|||
|
|
V1HJKGQty.Visible:=false;
|
|||
|
|
KgQty.Visible:=false;
|
|||
|
|
Label50.Visible:=false;
|
|||
|
|
MXHZKgQty.Visible:=false;
|
|||
|
|
label49.Visible:=false;
|
|||
|
|
KgQtyChaE.Visible:=false;
|
|||
|
|
Label18.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
initImage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.InitMXData();
|
|||
|
|
var i:integer;
|
|||
|
|
begin
|
|||
|
|
with ADOQuery2 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,RCGangNo1=(case when isnull(RCGangNo,'''')='''' then GangNo else RCGangNo end)');
|
|||
|
|
sql.Add(',Laster=isnull(Editer,Filler) from CK_MYSC_CR_MX A where isnull(MYID,'''')='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery2,ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQuery2,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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_CPZS.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxno,maxmxno,maxnoflag,fsj,FMXID:String;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'LL','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(FMainId);
|
|||
|
|
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
|
|||
|
|
if isempty then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MYId').Value:=Trim(maxno);
|
|||
|
|
FieldByName('CRType').Value:='<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('CRQtyFlag').Value:=1;
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end else
|
|||
|
|
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',Panel5,2);
|
|||
|
|
FieldByName('MDMflag').Value:=MDMFlag.Checked;
|
|||
|
|
FieldByName('MDKGflag').Value:=MDKGflag.Checked;
|
|||
|
|
FieldByName('HSFlag').AsBoolean:=HSFlag.Checked;
|
|||
|
|
FieldByName('BHSFlag').AsBoolean:=BHSFlag.Checked;
|
|||
|
|
FieldByName('MYType').Value:=Trim(FMYType);
|
|||
|
|
FieldByName('MYTypeFlag').Value:=Trim(FMYTypeFlag);
|
|||
|
|
fieldbyname('KHCode').AsString:=Trim(KHName.TxtCode);
|
|||
|
|
fieldbyname('MYName').AsString:=Trim(MYName.Text);
|
|||
|
|
fieldbyname('MYCode').AsString:=Trim(MYCode.Text);
|
|||
|
|
fieldbyname('MYMDPrice').Value:=StrToFloatdef(MYMDPrice.Text,0);
|
|||
|
|
fieldbyname('CGName').AsString:=Trim(CGName.Text);
|
|||
|
|
if RKNo.Text='' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('RKNo').Value:=Trim(maxno);
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
FMainId:=Trim(maxno);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('UPdate CK_MYSC_CR Set KHDayCS=isnull((select isnull(max(KHDayCS),0) from CK_MYSC_CR A ');
|
|||
|
|
sql.Add(' where A.CRTime=CK_MYSC_CR.CRTime and A.MYType=CK_MYSC_CR.MYType and isnull(A.KHName,'''')=isnull(CK_MYSC_CR.KHName,'''')),0)+1');
|
|||
|
|
SQL.Add('where MYID='''+Trim(FMainId)+''' and isnull(KHName,'''')<>'''' ');
|
|||
|
|
sql.Add(' and isnull(KHDayCS,0)=0');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_LLRK_PBQty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(maxno);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
Button5.Click;
|
|||
|
|
YFData();
|
|||
|
|
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_CPZS.TBSaveClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
FInt:Integer;
|
|||
|
|
begin
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
if Trim(KHName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MYName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MYCode.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
{if Trim(RKNo.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ⵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;}
|
|||
|
|
if Trim(MYMF.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(MYKZ.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD>ز<EFBFBD><D8B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
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;
|
|||
|
|
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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_CPZS.SaveImage(maxnoWB:string);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
Procedure TfrmLLRKInPutMH_CPZS.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.InitColor();
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from RT_PTColor where PTID='''+Trim(PTID.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
fsj:=Trim(ADOTemp.fieldbyname('ColDaiMa').AsString);
|
|||
|
|
if Trim(fsj)<>'' then
|
|||
|
|
begin
|
|||
|
|
//Panel6.Color:=StrToInt('$'+Trim(fsj));
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
lstPat := TStringList.Create;
|
|||
|
|
ReadCxBandedGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ¼<CFB8><C2BC>1',Tv1,'ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.KHNameBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
|
with frmGYSList do
|
|||
|
|
begin
|
|||
|
|
KHType.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
KHType.TxtCode:='<27><><EFBFBD><EFBFBD><EFBFBD><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_CPZS.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_CPZS.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_CPZS.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_CPZS.GetHZData();
|
|||
|
|
var
|
|||
|
|
FKG,FM,FPS:double;
|
|||
|
|
begin
|
|||
|
|
FKG:=strtofloatdef(TV1.DataController.Summary.FooterSummaryTexts[2],0);
|
|||
|
|
FM:=StrToFloatDef(Tv1.DataController.Summary.FooterSummaryTexts[1],0);
|
|||
|
|
FPS:=StrToFloatDef(Tv1.DataController.Summary.FooterSummaryTexts[0],0);
|
|||
|
|
MXHZPS.Text:=FloatToStr(FPS);
|
|||
|
|
MXHZKGQty.Text:=FloatToStr(FKG);
|
|||
|
|
MXHZQty.Text:=FloatToStr(FM);
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('exec P_Avg_JS :KgQty,:MQty,:PS');
|
|||
|
|
if Trim(MXHZKGQty.Text)<>'0' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=FKG;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('KGQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
if Trim(MXHZQty.Text)<>'0' then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=FM;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('MQty').Value:=Null;
|
|||
|
|
end;
|
|||
|
|
Parameters.ParamByName('PS').Value:=NULL;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
KgQtyAvg.Text:=FloatToStr(ADOTemp.fieldbyname('KgQtyAvg').asfloat);
|
|||
|
|
QtyAvg.Text:=FloatToStr(ADOTemp.fieldbyname('QtyAvg').asfloat);
|
|||
|
|
QtyChaE.Text:=FloatToStr(strtofloatdef(MXHZQty.Text,0)-strtofloatdef(Qty.Text,0));
|
|||
|
|
PSChaE.Text:=FloatToStr(strtofloatdef(MXHZPS.Text,0)-strtofloatdef(PS.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;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.UnitMClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='<27><>';
|
|||
|
|
//QtyLRM.Visible:=True;
|
|||
|
|
//BtnM.Visible:=True;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitM.Text:='';
|
|||
|
|
//QtyLRM.Visible:=False;
|
|||
|
|
//BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.UnitKgClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(UnitKg.Text)='' then
|
|||
|
|
begin
|
|||
|
|
UnitKg.Text:='<27><>';
|
|||
|
|
//QtyLRKg.Visible:=True;
|
|||
|
|
//BtnKg.Visible:=True;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
//BtnM.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
UnitKg.Text:='';
|
|||
|
|
//QtyLRKg.Visible:=False;
|
|||
|
|
//BtnKg.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.QtyLRMKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
i:Integer;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then Exit;
|
|||
|
|
if TryStrToFloat(QtyLRM.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
for i:=1 to StrToIntdef(PLPS.Text,1) do
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MXPrice').Value:=Trim(MYMDPrice.Text);
|
|||
|
|
FieldByName('MXMoney').Value:=strtofloatdef(MYMDPrice.Text,0)*strtofloatdef(QtyLRM.Text,0);
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.QtyLRKgKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRKg.Text)='' then Exit;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRKg.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
for i:=1 to StrToIntdef(PLPS.Text,1) do
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('KgQty').Value:=Trim(QtyLRKg.Text);
|
|||
|
|
FieldByName('MXPrice').Value:=Trim(MYMDPrice.Text);
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MXMoney').Value:=strtofloatdef(MYMDPrice.Text,0)*strtofloatdef(QtyLRKg.Text,0);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
QtyLRKg.Text:='';
|
|||
|
|
if Trim(UnitM.Text)<>'' then QtyLRM.SetFocus;
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.BtnMClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then Exit;
|
|||
|
|
if TryStrToFloat(QtyLRM.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(UnitKg.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
QtyLRKg.SetFocus;
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
for i:=1 to StrToIntdef(PLPS.Text,1) do
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('MXPrice').Value:=StrToFloatdef(MYMDPrice.Text,0);
|
|||
|
|
FieldByName('MQty').Value:=StrToFloatdef(QtyLRM.Text,0);
|
|||
|
|
FieldByName('MXMoney').Value:=strtofloatdef(MYMDPrice.Text,0)*strtofloatdef(QtyLRM.Text,0);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.BtnKgClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRKg.Text)='' then Exit;
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Trim(QtyLRM.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if TryStrToFloat(QtyLRKg.Text,FReal)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
for i:=1 to StrToIntdef(PLPS.Text,1) do
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('RCGangNo1').Value:=Trim(RCGangNo.Text);
|
|||
|
|
FieldByName('KgQty').Value:=Trim(QtyLRKg.Text);
|
|||
|
|
FieldByName('MXPrice').Value:=Trim(MYMDPrice.Text);
|
|||
|
|
if Trim(UnitM.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('MQty').Value:=Trim(QtyLRM.Text);
|
|||
|
|
end;
|
|||
|
|
FieldByName('MXMoney').Value:=strtofloatdef(MYMDPrice.Text,0)*strtofloatdef(QtyLRKg.Text,0);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
QtyLRM.Text:='';
|
|||
|
|
QtyLRKg.Text:='';
|
|||
|
|
if Trim(UnitM.Text)<>'' then QtyLRM.SetFocus;
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.Button1Click(Sender: TObject);
|
|||
|
|
var FPNO:string;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
if KHName.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if MYName.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
tv1.OptionsData.Editing:=true;
|
|||
|
|
FPNO:=Trim(ClientDataSet1.fieldbyname('RCGangNo').AsString);
|
|||
|
|
for i:=1 to 10 do
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('JH').AsInteger:=ClientDataSet1.RecordCount+1;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(FPNo);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.HSPS();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.BtnDelClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
GetHZData();
|
|||
|
|
HSPS();
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.BtnPrtClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile,Txt,fImagePath:string;
|
|||
|
|
i,j:Integer;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar:TMakebar;
|
|||
|
|
Mixtext:TMixtext;
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('GangNo',null,[])=true then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>棬<EFBFBD>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>ٴ<EFBFBD>ӡ<EFBFBD><D3A1>ǩ<EFBFBD><C7A9>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox2.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox1.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ѡ<EFBFBD><D1A1><EFBFBD>ߴ<EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if ComboBox1.Text='9*7' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<DEB7><C4B2><EFBFBD>ǩ97.rmf';
|
|||
|
|
end else
|
|||
|
|
if ComboBox1.Text='8*5' then
|
|||
|
|
begin
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<DEB7><C4B2><EFBFBD>ǩ85.rmf';
|
|||
|
|
end;
|
|||
|
|
if FileExists(fPrintFile)=False then
|
|||
|
|
begin
|
|||
|
|
if ComboBox1.Text='9*7' then
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<DEB7><C4B2><EFBFBD>ǩ97.rmf'),'<27><>ʾ',0);
|
|||
|
|
if ComboBox1.Text='8*5' then
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<DEB7><C4B2><EFBFBD>ǩ85.rmf'),'<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while Locate('SSel',True,[]) do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' Exec P_PRT_LLRK_ML :MXID');
|
|||
|
|
Parameters.ParamByName('MXID').Value:=Trim(ClientDataSet1.fieldbyname('MXID').AsString);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOTemp,CDS_Print);
|
|||
|
|
SInitCDSData20(ADOTemp,CDS_Print);
|
|||
|
|
try
|
|||
|
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
|||
|
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
|||
|
|
Txt:=Trim(ClientDataSet1.fieldbyname('MXID').AsString);
|
|||
|
|
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
|||
|
|
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('SSel').Value:=False;
|
|||
|
|
RMVariables['QRBARCODE']:=fImagePath;
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
//RM1.ShowReport;
|
|||
|
|
for i:=1 to StrToInt(ComboBox2.Text) do
|
|||
|
|
begin
|
|||
|
|
RM1.PrintReport;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ComboBox2.ItemIndex:=0;
|
|||
|
|
ComboBox1.ItemIndex:=-1;
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.BtnQXClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel5.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmLLRKInPutMH_CPZS.SaveDataMX():Boolean;
|
|||
|
|
var
|
|||
|
|
maxmxno,maxnoflag,fsj,FMXID:String;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from CK_MYSC_CR_MX where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('HJPS').AsFloat<>0 then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxmxno,'LM','CK_MYSC_CR_MX',4,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;
|
|||
|
|
maxmxno:=maxmxno+'LML';
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(maxmxno)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
FieldByName('MXID').Value:=Trim(maxmxno);
|
|||
|
|
FieldByName('RCGangNo').Value:=ClientDataSet1.fieldbyname('RCGangNo').Value;
|
|||
|
|
FieldByName('MXPrice').Value:=ClientDataSet1.fieldbyname('MXPrice').Value;
|
|||
|
|
FieldByName('MXMoney').Value:=ClientDataSet1.fieldbyname('MXMoney').Value;
|
|||
|
|
FieldByName('KgQty').Value:=ClientDataSet1.fieldbyname('KgQty').Value;
|
|||
|
|
FieldByName('KgQty2').Value:=ClientDataSet1.fieldbyname('KgQty2').Value;
|
|||
|
|
FieldByName('KgQty3').Value:=ClientDataSet1.fieldbyname('KgQty3').Value;
|
|||
|
|
FieldByName('KgQty4').Value:=ClientDataSet1.fieldbyname('KgQty4').Value;
|
|||
|
|
FieldByName('KgQty5').Value:=ClientDataSet1.fieldbyname('KgQty5').Value;
|
|||
|
|
FieldByName('KgQty6').Value:=ClientDataSet1.fieldbyname('KgQty6').Value;
|
|||
|
|
FieldByName('KgQty7').Value:=ClientDataSet1.fieldbyname('KgQty7').Value;
|
|||
|
|
FieldByName('KgQty8').Value:=ClientDataSet1.fieldbyname('KgQty8').Value;
|
|||
|
|
FieldByName('KgQty9').Value:=ClientDataSet1.fieldbyname('KgQty9').Value;
|
|||
|
|
FieldByName('KgQty10').Value:=ClientDataSet1.fieldbyname('KgQty10').Value;
|
|||
|
|
FieldByName('MQty').Value:=ClientDataSet1.fieldbyname('MQty').Value;
|
|||
|
|
FieldByName('MQty2').Value:=ClientDataSet1.fieldbyname('MQty2').Value;
|
|||
|
|
FieldByName('MQty3').Value:=ClientDataSet1.fieldbyname('MQty3').Value;
|
|||
|
|
FieldByName('MQty4').Value:=ClientDataSet1.fieldbyname('MQty4').Value;
|
|||
|
|
FieldByName('MQty5').Value:=ClientDataSet1.fieldbyname('MQty5').Value;
|
|||
|
|
FieldByName('MQty6').Value:=ClientDataSet1.fieldbyname('MQty6').Value;
|
|||
|
|
FieldByName('MQty7').Value:=ClientDataSet1.fieldbyname('MQty7').Value;
|
|||
|
|
FieldByName('MQty8').Value:=ClientDataSet1.fieldbyname('MQty8').Value;
|
|||
|
|
FieldByName('MQty9').Value:=ClientDataSet1.fieldbyname('MQty9').Value;
|
|||
|
|
FieldByName('MQty10').Value:=ClientDataSet1.fieldbyname('MQty10').Value;
|
|||
|
|
FieldByName('HJPS').Value:=ClientDataSet1.fieldbyname('HJPS').Value;
|
|||
|
|
FieldByName('HJQty').Value:=ClientDataSet1.fieldbyname('HJQty').Value;
|
|||
|
|
FieldByName('HJKGQty').Value:=ClientDataSet1.fieldbyname('HJKGQty').Value;
|
|||
|
|
FieldByName('JH').Value:=ClientDataSet1.fieldbyname('JH').Value;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('FillerCode').Value:=Trim(DCode);
|
|||
|
|
FieldByName('MXNote').Value:=Trim(MXNote.Text);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
if ClientDataSet1.fieldbyname('GangNo').AsString='' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_QCRK_GangNo :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
FieldByName('MXID').Value:=Trim(maxmxno);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_LLRK_PBQty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
//InitData();
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
Result:=False;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.Button5Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FReal:Double;
|
|||
|
|
begin
|
|||
|
|
if SaveDataMX() then
|
|||
|
|
begin
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
HSPS();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(ClientDataSet1,False);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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));
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.MDMFlagClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
MDKGFlag.Checked:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if MDKGFlag.Checked=false then
|
|||
|
|
MDKGFlag.Checked:=true;
|
|||
|
|
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;
|
|||
|
|
if ClientDataSet1.IsEmpty=false then
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MXPrice').Value:=strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
FieldByName('MXMoney').Value:=FieldByName('MQty').AsFloat*strtofloatdef(MYMDPrice.text,0)
|
|||
|
|
else
|
|||
|
|
FieldByName('MXMoney').Value:=FieldByName('KgQty').AsFloat*strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
end;
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.MDKGFlagClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if MDKGFlag.Checked=true then
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=true then
|
|||
|
|
MDMFlag.Checked:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if MDMFlag.Checked=false then
|
|||
|
|
MDMFlag.Checked:=true;
|
|||
|
|
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;
|
|||
|
|
if ClientDataSet1.IsEmpty=false then
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MXPrice').Value:=strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
FieldByName('MXMoney').Value:=FieldByName('MQty').AsFloat*strtofloatdef(MYMDPrice.text,0)
|
|||
|
|
else
|
|||
|
|
FieldByName('MXMoney').Value:=FieldByName('KgQty').AsFloat*strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
end;
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.MYNameBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmBPZDY_LRPB:=TfrmBPZDY_LRPB.create(self);
|
|||
|
|
with frmBPZDY_LRPB do
|
|||
|
|
begin
|
|||
|
|
flag:='PBName';
|
|||
|
|
flagName:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
ViewFlag:=true;
|
|||
|
|
ToolBar3.Visible:=false;
|
|||
|
|
Button1.Visible:=False;
|
|||
|
|
Panel7.Visible:=false;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
MYName.text:=Trim(ClientDataSet1.fieldbyname('BPName').AsString);
|
|||
|
|
MYCode.text:=Trim(ClientDataSet1.fieldbyname('BPCode').AsString);
|
|||
|
|
MYCF.text:=Trim(ClientDataSet1.fieldbyname('BPCF').AsString);
|
|||
|
|
MYMF.text:=Trim(ClientDataSet1.fieldbyname('BPMF').AsString);
|
|||
|
|
MYKZ.text:=Trim(ClientDataSet1.fieldbyname('BPKZ').AsString);
|
|||
|
|
MYJWS.text:=Trim(ClientDataSet1.fieldbyname('BPJS').AsString);
|
|||
|
|
MYMD.text:=Trim(ClientDataSet1.fieldbyname('BPMiDu').AsString);
|
|||
|
|
//MYPrice.text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
//MYMDPrice.text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
Note.text:=Trim(ClientDataSet1.fieldbyname('BPNote').AsString);
|
|||
|
|
if ClientDataSet1.fieldbyname('IFHS').AsString='<27><>˰' then
|
|||
|
|
begin
|
|||
|
|
HSFlag.Checked:=True;
|
|||
|
|
BHSFlag.Checked:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
HSFlag.Checked:=false;
|
|||
|
|
BHSFlag.Checked:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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));
|
|||
|
|
//GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.Panel13Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.Button2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
maxNo:string;
|
|||
|
|
begin
|
|||
|
|
if FMainid='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FMainid,'LL','CK_MYSC_CR',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
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(FMainid)+''' ');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value:=trim(maxNO);
|
|||
|
|
fieldbyname('WBID').Value:=trim(FMainid);
|
|||
|
|
fieldbyname('TFType').Value:='<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><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_CPZS.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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value:=trim(maxNO);
|
|||
|
|
fieldbyname('WBID').Value:=trim(FMainid);
|
|||
|
|
fieldbyname('TFType').Value:='<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><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_CPZS.Image2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel12.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.MenuItem1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
OpenDiaLog: TOpenDialog;
|
|||
|
|
fFileName,FWJName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,FWJName,'PB','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_CPZS.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(FMainid)+'''');
|
|||
|
|
sql.Add('and TFType=''<27>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Initimage();
|
|||
|
|
except
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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_CPZS.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_CPZS.Panel2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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_CPZS.JCDanWeiBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmGYSList:=TfrmGYSList.Create(Application);
|
|||
|
|
with frmGYSList do
|
|||
|
|
begin
|
|||
|
|
KHType.Text:='Ⱦ<><C8BE>';
|
|||
|
|
KHType.TxtCode:='Ⱦ<><C8BE>';
|
|||
|
|
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_CPZS.Button9Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel9.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.N5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
panel9.Visible:=true;
|
|||
|
|
Label38.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.N6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
panel9.Visible:=true;
|
|||
|
|
Label38.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.N7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Tv1.OptionsData.Editing:=true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.Button3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FFMXID:string;
|
|||
|
|
begin
|
|||
|
|
if Label38.Caption='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:' then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set RCGangNo='''+Trim(Edit2.Text)+'''');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if FieldByName('Ssel').AsBoolean then
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
//FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('RCGangNo').Value:=Trim(Edit2.Text);
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
//Button5.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_LLRK_PBQty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOTemp,Panel2,2);
|
|||
|
|
GetHZData();
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if Label38.Caption='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:' then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set MQty='''+Trim(Edit2.Text)+'''');
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
sql.add(',MXMoney=MQty*MXPrice');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if FieldByName('Ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
//FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('MQty').Value:=Trim(Edit2.Text);
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
FieldByName('MXMoney').Value:=StrToFloatdef(Edit2.Text,0)*strtofloatdef(MYMDPrice.Text,0);
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
//Button5.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_LLRK_PBQty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOTemp,Panel2,2);
|
|||
|
|
GetHZData();
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if Label38.Caption='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD>:' then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.Locate('SSel',True,[])=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from CK_MYSC_CR_MX where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FFMXID:=Trim(ADOTemp.fieldbyname('MXID').AsString);
|
|||
|
|
if Trim(FFMXID)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' UPdate CK_MYSC_CR_MX Set KgQty='''+Trim(Edit2.Text)+'''');
|
|||
|
|
if MDKGFlag.Checked=True then
|
|||
|
|
sql.add(',MXMoney=KgQty*MXPrice');
|
|||
|
|
sql.Add(' where MXID='''+Trim(ClientDataSet1.fieldbyname('MXID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if FieldByName('Ssel').AsBoolean=true then
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
//FieldByName('SSel').Value:=false;
|
|||
|
|
FieldByName('KgQty').Value:=Trim(Edit2.Text);
|
|||
|
|
if MDKGFlag.Checked=True then
|
|||
|
|
FieldByName('MXMoney').Value:=StrToFloatdef(Edit2.Text,0)*strtofloatdef(MYMDPrice.Text,0);
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FSaveFlag:='99';
|
|||
|
|
//Button5.Click;
|
|||
|
|
FSaveFlag:='';
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' exec P_Update_LLRK_PBQty :MYID');
|
|||
|
|
Parameters.ParamByName('MYID').Value:=Trim(FMainId);
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from CK_MYSC_CR where MYID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOTemp,Panel2,2);
|
|||
|
|
GetHZData();
|
|||
|
|
except
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Edit2.Text:='';
|
|||
|
|
Panel9.Visible:=false;
|
|||
|
|
TBSave.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
ClientDataSet1.Locate('SSel',True,[]);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CheckBox1.Checked=True then
|
|||
|
|
begin
|
|||
|
|
PLPS.Visible:=True;
|
|||
|
|
Label37.Visible:=true;
|
|||
|
|
PLPS.Text:='';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
PLPS.Visible:=false;
|
|||
|
|
Label37.Visible:=false;
|
|||
|
|
PLPS.Text:='';
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.RCGangNo1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQuery2,SGetFilters(Panel8,1,2));
|
|||
|
|
SCreateCDS20(ADOQuery2,ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQuery2,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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));
|
|||
|
|
//GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.MYMDPriceChange(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));
|
|||
|
|
if ClientDataSet1.IsEmpty=false then
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.DisableControls;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('MXPrice').Value:=strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
if MDMFlag.Checked=True then
|
|||
|
|
FieldByName('MXMoney').Value:=FieldByName('MQty').AsFloat*strtofloatdef(MYMDPrice.text,0)
|
|||
|
|
else
|
|||
|
|
FieldByName('MXMoney').Value:=FieldByName('KgQty').AsFloat*strtofloatdef(MYMDPrice.text,0);
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.EnableControls;
|
|||
|
|
end;
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.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_CPZS.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_CPZS.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_CPZS.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_CPZS.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_CPZS.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_CPZS.UnitMChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if UnitM.Text='<27><>' then
|
|||
|
|
begin
|
|||
|
|
v1MQty.Visible:=true;
|
|||
|
|
v1MQty2.Visible:=true;
|
|||
|
|
v1MQty3.Visible:=true;
|
|||
|
|
v1MQty4.Visible:=true;
|
|||
|
|
v1MQty5.Visible:=true;
|
|||
|
|
v1MQty6.Visible:=true;
|
|||
|
|
v1MQty7.Visible:=true;
|
|||
|
|
v1MQty8.Visible:=true;
|
|||
|
|
v1MQty9.Visible:=true;
|
|||
|
|
v1MQty10.Visible:=true;
|
|||
|
|
V1HJQty.Visible:=true;
|
|||
|
|
Label45.Visible:=true;
|
|||
|
|
Qty.Visible:=true;
|
|||
|
|
Label44.Visible:=true;
|
|||
|
|
Label17.Visible:=True;
|
|||
|
|
QtyChaE.Visible:=True;
|
|||
|
|
MXHZQty.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
v1MQty.Visible:=false;
|
|||
|
|
v1MQty2.Visible:=false;
|
|||
|
|
v1MQty3.Visible:=false;
|
|||
|
|
v1MQty4.Visible:=false;
|
|||
|
|
v1MQty5.Visible:=false;
|
|||
|
|
v1MQty6.Visible:=false;
|
|||
|
|
v1MQty7.Visible:=false;
|
|||
|
|
v1MQty8.Visible:=false;
|
|||
|
|
v1MQty9.Visible:=false;
|
|||
|
|
v1MQty10.Visible:=false;
|
|||
|
|
V1HJQty.Visible:=false;
|
|||
|
|
Label45.Visible:=false;
|
|||
|
|
Qty.Visible:=false;
|
|||
|
|
Label44.Visible:=false;
|
|||
|
|
Label17.Visible:=false;
|
|||
|
|
QtyChaE.Visible:=false;
|
|||
|
|
MXHZQty.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.UnitKgChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if UnitKg.Text='' then
|
|||
|
|
begin
|
|||
|
|
v1KgQty.Visible:=false;
|
|||
|
|
v1KgQty2.Visible:=false;
|
|||
|
|
v1KgQty3.Visible:=false;
|
|||
|
|
v1KgQty4.Visible:=false;
|
|||
|
|
v1KgQty5.Visible:=false;
|
|||
|
|
v1KgQty6.Visible:=false;
|
|||
|
|
v1KgQty7.Visible:=false;
|
|||
|
|
v1KgQty8.Visible:=false;
|
|||
|
|
v1KgQty9.Visible:=false;
|
|||
|
|
v1KgQty10.Visible:=false;
|
|||
|
|
V1HJKGQty.Visible:=false;
|
|||
|
|
KgQty.Visible:=false;
|
|||
|
|
Label50.Visible:=false;
|
|||
|
|
MXHZKgQty.Visible:=false;
|
|||
|
|
label49.Visible:=false;
|
|||
|
|
KgQtyChaE.Visible:=false;
|
|||
|
|
Label18.Visible:=false;
|
|||
|
|
//QtyLRKg.Visible:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
v1KgQty.Visible:=true;
|
|||
|
|
v1KgQty2.Visible:=true;
|
|||
|
|
v1KgQty3.Visible:=true;
|
|||
|
|
v1KgQty4.Visible:=true;
|
|||
|
|
v1KgQty5.Visible:=true;
|
|||
|
|
v1KgQty6.Visible:=true;
|
|||
|
|
v1KgQty7.Visible:=true;
|
|||
|
|
v1KgQty8.Visible:=true;
|
|||
|
|
v1KgQty9.Visible:=true;
|
|||
|
|
v1KgQty10.Visible:=true;
|
|||
|
|
V1HJKGQty.Visible:=true;
|
|||
|
|
KgQty.Visible:=true;
|
|||
|
|
Label50.Visible:=true;
|
|||
|
|
MXHZKgQty.Visible:=true;
|
|||
|
|
label49.Visible:=true;
|
|||
|
|
KgQtyChaE.Visible:=true;
|
|||
|
|
Label18.Visible:=true;
|
|||
|
|
//QtyLRKg.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.v1MQtyPropertiesEditValueChanged(
|
|||
|
|
Sender: TObject);
|
|||
|
|
var mavlue,FFieldName:string;
|
|||
|
|
FPS1:integer;
|
|||
|
|
begin
|
|||
|
|
mavlue:=TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
IF mavlue<>'' then
|
|||
|
|
FieldByName(FFieldName).Value:=mavlue
|
|||
|
|
else
|
|||
|
|
FieldByName(FFieldName).Value:=NULL;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
FPS1:=0;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty2').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty2').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty3').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty3').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty4').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty4').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty5').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty5').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty6').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty6').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty7').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty7').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty8').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty8').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty9').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty9').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
if (ClientDataSet1.FieldByName('MQty10').AsFloat<>0) or (ClientDataSet1.FieldByName('KGQty10').AsFloat<>0) then
|
|||
|
|
begin
|
|||
|
|
FPS1:=FPS1+1;
|
|||
|
|
end;
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('HJQty').AsFloat:=fieldbyname('MQty').AsFloat+fieldbyname('MQty2').AsFloat+fieldbyname('MQty3').AsFloat
|
|||
|
|
+fieldbyname('MQty4').AsFloat+fieldbyname('MQty5').AsFloat+fieldbyname('MQty6').AsFloat
|
|||
|
|
+fieldbyname('MQty7').AsFloat+fieldbyname('MQty8').AsFloat+fieldbyname('MQty9').AsFloat
|
|||
|
|
+fieldbyname('MQty10').AsFloat;
|
|||
|
|
FieldByName('HJKGQty').AsFloat:=fieldbyname('KGQty').AsFloat+fieldbyname('KGQty2').AsFloat+fieldbyname('KGQty3').AsFloat
|
|||
|
|
+fieldbyname('KGQty4').AsFloat+fieldbyname('KGQty5').AsFloat+fieldbyname('KGQty6').AsFloat
|
|||
|
|
+fieldbyname('KGQty7').AsFloat+fieldbyname('KGQty8').AsFloat+fieldbyname('KGQty9').AsFloat
|
|||
|
|
+fieldbyname('KGQty10').AsFloat;
|
|||
|
|
FieldByName('HJPS').AsFloat:=FPS1;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
tv1.Controller.EditingController.ShowEdit();
|
|||
|
|
GetHZData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmLLRKInPutMH_CPZS.PSChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
PSChaE.Text:=FloatToStr(strtofloatdef(MXHZPS.Text,0)-strtofloatdef(PS.Text,0));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|