1921 lines
51 KiB
ObjectPascal
1921 lines
51 KiB
ObjectPascal
|
|
unit U_MLOrderInPut_SQJH;
|
|||
|
|
|
|||
|
|
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, cxCurrencyEdit,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxDropDownEdit, cxGroupBox,
|
|||
|
|
cxCheckBox, ImgList, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP, Menus,ShellAPI, cxSplitter;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmMLOrderInPut_SQJH = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
ToolBar2: TToolBar;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
v1ConColor: TcxGridDBColumn;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
Order_Sub: TClientDataSet;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
v1Qty: TcxGridDBColumn;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
v1XHNo: TcxGridDBColumn;
|
|||
|
|
v1QtyUnit: TcxGridDBColumn;
|
|||
|
|
v1ConHX: TcxGridDBColumn;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
OrdDate: TDateTimePicker;
|
|||
|
|
KHName: TBtnEditC;
|
|||
|
|
v1ConNote: TcxGridDBColumn;
|
|||
|
|
CDS_CON: TClientDataSet;
|
|||
|
|
DSCON: TDataSource;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
v1ConCode: TcxGridDBColumn;
|
|||
|
|
v1ConCodeName: TcxGridDBColumn;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryTmp: TADOQuery;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
v1ConGY: TcxGridDBColumn;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
SYRName: TBtnEditC;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Panel21: TPanel;
|
|||
|
|
ScrollBox2: TScrollBox;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
QtyBiaoZhun: TBtnEditC;
|
|||
|
|
ZLBiaoZhun: TBtnEditC;
|
|||
|
|
JHType: TBtnEditC;
|
|||
|
|
BZYaoQiu: TBtnEditC;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
JSType: TBtnEditC;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
HZQiXian: TBtnEditC;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
WYZeRen: TBtnEditC;
|
|||
|
|
BCShuoMing: TBtnEditC;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
KPCodeName: TBtnEditC;
|
|||
|
|
CheckBox2: TCheckBox;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
SYRAdd: TEdit;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
SYRZJL: TEdit;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
SYRTel: TEdit;
|
|||
|
|
Label21: TLabel;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
SYRYWTel: TEdit;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
Label26: TLabel;
|
|||
|
|
SYRBankNo: TEdit;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
KHAdd: TEdit;
|
|||
|
|
Label28: TLabel;
|
|||
|
|
KHZJL: TEdit;
|
|||
|
|
Label29: TLabel;
|
|||
|
|
KHTel: TEdit;
|
|||
|
|
Label30: TLabel;
|
|||
|
|
KHFDR: TEdit;
|
|||
|
|
Label31: TLabel;
|
|||
|
|
KHYWFZR: TEdit;
|
|||
|
|
Label32: TLabel;
|
|||
|
|
KHYWTel: TEdit;
|
|||
|
|
Label33: TLabel;
|
|||
|
|
KHPhone: TEdit;
|
|||
|
|
Label34: TLabel;
|
|||
|
|
KHBankName: TEdit;
|
|||
|
|
Label35: TLabel;
|
|||
|
|
KHBankNo: TEdit;
|
|||
|
|
v1ConPrice: TcxGridDBColumn;
|
|||
|
|
v1ConMoney: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
Label37: TLabel;
|
|||
|
|
v1ConType: TcxGridDBColumn;
|
|||
|
|
YWConNO: TEdit;
|
|||
|
|
v1ConColNo: TcxGridDBColumn;
|
|||
|
|
v1ConKHColNo: TcxGridDBColumn;
|
|||
|
|
IFHS: TCheckBox;
|
|||
|
|
IFBHS: TCheckBox;
|
|||
|
|
v1IFFZ: TcxGridDBColumn;
|
|||
|
|
Label52: TLabel;
|
|||
|
|
KHConNo: TEdit;
|
|||
|
|
PopupMenu2: TPopupMenu;
|
|||
|
|
MenuItem1: TMenuItem;
|
|||
|
|
N3: TMenuItem;
|
|||
|
|
MenuItem2: TMenuItem;
|
|||
|
|
N4: TMenuItem;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
ImageList1: TImageList;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
MenuItem3: TMenuItem;
|
|||
|
|
MenuItem4: TMenuItem;
|
|||
|
|
SYRFDR: TBtnEditA;
|
|||
|
|
SYRYWY: TBtnEditA;
|
|||
|
|
SYRYWFZR: TBtnEditA;
|
|||
|
|
cxSplitter1: TcxSplitter;
|
|||
|
|
ListView1: TListView;
|
|||
|
|
Panel12: TPanel;
|
|||
|
|
Label48: TLabel;
|
|||
|
|
Button4: TButton;
|
|||
|
|
Panel13: TPanel;
|
|||
|
|
Image1: TImage;
|
|||
|
|
WJName: TEdit;
|
|||
|
|
Button7: TButton;
|
|||
|
|
WJPach: TEdit;
|
|||
|
|
Button8: TButton;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
Label36: TLabel;
|
|||
|
|
Label39: TLabel;
|
|||
|
|
Label40: TLabel;
|
|||
|
|
Label41: TLabel;
|
|||
|
|
Label43: TLabel;
|
|||
|
|
Label45: TLabel;
|
|||
|
|
Label46: TLabel;
|
|||
|
|
Label47: TLabel;
|
|||
|
|
Label49: TLabel;
|
|||
|
|
Label50: TLabel;
|
|||
|
|
Label53: TLabel;
|
|||
|
|
Label38: TLabel;
|
|||
|
|
ConCodeName: TEdit;
|
|||
|
|
ConHX: TEdit;
|
|||
|
|
ConColor: TEdit;
|
|||
|
|
Qty: TEdit;
|
|||
|
|
ConPrice: TEdit;
|
|||
|
|
ConMoney: TEdit;
|
|||
|
|
ConNote: TMemo;
|
|||
|
|
Button1: TButton;
|
|||
|
|
Button2: TButton;
|
|||
|
|
ConColNo: TEdit;
|
|||
|
|
ConKHColNo: TEdit;
|
|||
|
|
ConCode: TBtnEditA;
|
|||
|
|
ConGY: TBtnEditA;
|
|||
|
|
QtyUnit: TBtnEditA;
|
|||
|
|
CSID: TEdit;
|
|||
|
|
KHConCodeName: TEdit;
|
|||
|
|
KHConCode: TBtnEditA;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
PopupMenu3: TPopupMenu;
|
|||
|
|
MenuItem5: TMenuItem;
|
|||
|
|
PTID: TEdit;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Image2: TImage;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Button5: TButton;
|
|||
|
|
Button6: TButton;
|
|||
|
|
Button9: TButton;
|
|||
|
|
Button10: TButton;
|
|||
|
|
Button11: TButton;
|
|||
|
|
Button12: TButton;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
MLID: TEdit;
|
|||
|
|
ConNo: TEdit;
|
|||
|
|
Button13: TButton;
|
|||
|
|
SYRBankName: TEdit;
|
|||
|
|
SYRPhone: TEdit;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure v1PRTColorPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure KHNameBtnUpClick(Sender: TObject);
|
|||
|
|
procedure KHNameBtnDnClick(Sender: TObject);
|
|||
|
|
procedure v1OrderUnitPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure v1PriceUnitPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure OrdDefStr2BtnUpClick(Sender: TObject);
|
|||
|
|
procedure ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure YCLFactoryBtnUpClick(Sender: TObject);
|
|||
|
|
procedure MPRTSCTeBieNoteBtnUpClick(Sender: TObject);
|
|||
|
|
procedure v1Column3PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure ConCodeKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ListView1DblClick(Sender: TObject);
|
|||
|
|
procedure Button4Click(Sender: TObject);
|
|||
|
|
procedure Button8Click(Sender: TObject);
|
|||
|
|
procedure Button7Click(Sender: TObject);
|
|||
|
|
procedure Image1Click(Sender: TObject);
|
|||
|
|
procedure MenuItem1Click(Sender: TObject);
|
|||
|
|
procedure N3Click(Sender: TObject);
|
|||
|
|
procedure MenuItem2Click(Sender: TObject);
|
|||
|
|
procedure N4Click(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure MenuItem3Click(Sender: TObject);
|
|||
|
|
procedure MenuItem4Click(Sender: TObject);
|
|||
|
|
procedure Tv1DblClick(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure IFHSClick(Sender: TObject);
|
|||
|
|
procedure CheckBox2Click(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure SYRNameBtnUpClick(Sender: TObject);
|
|||
|
|
procedure QtyUnitBtnClick(Sender: TObject);
|
|||
|
|
procedure ConGYBtnClick(Sender: TObject);
|
|||
|
|
procedure ConCodeBtnClick(Sender: TObject);
|
|||
|
|
procedure QtyChange(Sender: TObject);
|
|||
|
|
procedure SYRFDRBtnClick(Sender: TObject);
|
|||
|
|
procedure SYRYWYBtnClick(Sender: TObject);
|
|||
|
|
procedure SYRYWFZRBtnClick(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
procedure Button10Click(Sender: TObject);
|
|||
|
|
procedure Button11Click(Sender: TObject);
|
|||
|
|
procedure Button12Click(Sender: TObject);
|
|||
|
|
procedure Button9Click(Sender: TObject);
|
|||
|
|
procedure Button5Click(Sender: TObject);
|
|||
|
|
procedure Button6Click(Sender: TObject);
|
|||
|
|
procedure Image2Click(Sender: TObject);
|
|||
|
|
procedure KHConCodeBtnClick(Sender: TObject);
|
|||
|
|
procedure ConCodeNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure KHConCodeKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure KHConCodeNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConColorKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConColNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConKHColNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure QtyKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure QtyUnitKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConPriceKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConGYKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConNoteKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ConCodeChange(Sender: TObject);
|
|||
|
|
procedure KHConCodeChange(Sender: TObject);
|
|||
|
|
procedure QtyUnitChange(Sender: TObject);
|
|||
|
|
procedure ConGYChange(Sender: TObject);
|
|||
|
|
procedure MenuItem5Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure Button13Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
procedure InitData();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
function getOrderNo(fconNo:string):string;
|
|||
|
|
procedure CFSaveData();
|
|||
|
|
procedure Initimage();
|
|||
|
|
procedure InitColor();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
PState,CopyInt,PriceFlag:Integer;
|
|||
|
|
FMainId,FFMainId,FOrderNo:String;
|
|||
|
|
FXS:Integer;
|
|||
|
|
canshu1,canshu2:string;
|
|||
|
|
fFlileFlag:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmMLOrderInPut_SQJH: TfrmMLOrderInPut_SQJH;
|
|||
|
|
newh:hwnd;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,U_Fun,U_RTFun,U_ZDYHelpSel, U_ZdyAttachment, U_ZdyAttachGYS,U_ZHCPList_CX,
|
|||
|
|
getpic, U_ZdyAttachCP_HX_sel,U_ContractList_CX,U_GSList_CX,U_KHList_CX,U_MLMangeRS_Sel1,U_BPZdy_LRPB,
|
|||
|
|
U_BPZdy_LRM,U_MCGRKList_XKC_CX,U_BPZdy_LRPB_M1,U_RTPTColor,U_MLManage_LRRS,U_ZDYHelp_YW,U_MLMangeRS_Sel2;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.CFSaveData();
|
|||
|
|
var
|
|||
|
|
fCFID:string;
|
|||
|
|
begin
|
|||
|
|
with ADOQuery2 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from JYOrder_Sub_CF where subID='''+Trim(Order_Sub.fieldbyname('subID').asstring)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
if ADOQuery2.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select A.CengJI,A.MLName,A.MLSeHao,A.MLID ');
|
|||
|
|
sql.Add(',HXNo=(select Top 1 B.HXNo from CP_YDang_JG B where B.CengJi=A.CengJi and B.CYID=A.CYID and B.IFZY=1)');
|
|||
|
|
sql.Add(',GYDM=(select Top 1 B.GYDM from CP_YDang_JG B where B.CengJi=A.CengJi and B.CYID=A.CYID and B.IFZY=1)');
|
|||
|
|
sql.Add(' from CP_YDang_ML A ');
|
|||
|
|
SQL.Add('where A.CYID='''+trim(Order_Sub.fieldbyname('PRTCode').AsString)+'''');
|
|||
|
|
sql.Add(' and A.IFSel=1 ');
|
|||
|
|
sql.Add(' order by A.Cengji,A.MLID');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
while not ADOQuery1.Eof do
|
|||
|
|
begin
|
|||
|
|
IF GetLSNo(ADOQueryCmd,fCFID,'JC','JYOrder_Sub_CF',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from JYOrder_Sub_CF where CFID='''+Trim(fCFID)+'''');
|
|||
|
|
Open;
|
|||
|
|
IF IsEmpty then Append
|
|||
|
|
else edit;
|
|||
|
|
fieldbyname('CFID').Value:=trim(fCFID);
|
|||
|
|
fieldbyname('PRTCode').Value:=trim(Order_Sub.fieldbyname('PRTCode').AsString);
|
|||
|
|
fieldbyname('PrtCodeName').Value:=trim(ADOQuery1.fieldbyname('MLName').AsString);
|
|||
|
|
fieldbyname('PrtSpec').Value:=trim(Order_Sub.fieldbyname('PrtSpec').AsString);
|
|||
|
|
fieldbyname('SOrddefstr1').Value:=trim(ADOQuery1.fieldbyname('MLSeHao').AsString);
|
|||
|
|
fieldbyname('PRTColor').Value:=trim(ADOQuery1.fieldbyname('MLColor').AsString);
|
|||
|
|
fieldbyname('PRTHX').Value:=trim(ADOQuery1.fieldbyname('HXName').AsString);
|
|||
|
|
fieldbyname('PRTOrderRollNum').Value:=Order_Sub.fieldbyname('PRTOrderRollNum').AsFloat;
|
|||
|
|
fieldbyname('PrtOrderQty').Value:=Order_Sub.fieldbyname('PRTOrderQty').AsFloat;
|
|||
|
|
fieldbyname('OrderUnit').Value:=trim(Order_Sub.fieldbyname('OrderUnit').AsString);
|
|||
|
|
FieldByName('PRTType').Value:=trim(ADOQuery1.fieldbyname('CengJi').AsString)+'<27><>';
|
|||
|
|
fieldbyname('MainID').Value:=trim(Order_Sub.fieldbyname('MainID').AsString);
|
|||
|
|
fieldbyname('SubID').Value:=trim(Order_Sub.fieldbyname('SubID').AsString);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
ADOQuery1.Next;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update JYOrder_Sub_CF set ');
|
|||
|
|
sql.Add('PRTCode='''+trim(Order_Sub.fieldbyname('PRTCode').AsString)+'''');
|
|||
|
|
sql.Add(',PrtSpec='''+trim(Order_Sub.fieldbyname('PrtSpec').AsString)+'''');
|
|||
|
|
sql.Add(',OrderUnit='''+trim(Order_Sub.fieldbyname('OrderUnit').AsString)+'''');
|
|||
|
|
sql.Add(' where Subid='''+trim(Order_Sub.fieldbyname('Subid').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmMLOrderInPut_SQJH.getOrderNo(fconNo:string):string;
|
|||
|
|
var
|
|||
|
|
str1:string;
|
|||
|
|
i:integer;
|
|||
|
|
begin
|
|||
|
|
str1:=trim(fconNo)+'01';
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select MainID from JYOrder_Main where orderNo='+quotedstr(trim(str1)));
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
IF not ADOTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
for i:=1 to 99 do
|
|||
|
|
begin
|
|||
|
|
str1:=trim(fconNo)+rightstr(inttostr(100+i),2);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select MainID from JYOrder_Main where orderNo='+quotedstr(trim(str1)));
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
IF ADOCmd.IsEmpty then break;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
result:=str1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
WriteCxGrid('<27><><EFBFBD>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD>ͬ11',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.InitData();
|
|||
|
|
begin
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' select *');
|
|||
|
|
sql.Add(',IFFZ=(select count(B.WBID) from TP_File B where B.WBID=A.CSID and B.TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ'')');
|
|||
|
|
SQL.Add(' from ML_ConSub A where 1=1 ');
|
|||
|
|
if PState=1 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and MLConID='''+Trim(FMainId)+'''');
|
|||
|
|
end;
|
|||
|
|
if PState=0 then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' and 1<>1');
|
|||
|
|
end;
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1,Order_Sub);
|
|||
|
|
SInitCDSData20(ADOQuery1,Order_Sub);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from ML_ConMain where MLConID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOQuery1,ScrollBox1,2);
|
|||
|
|
SCSHDataNew(ADOQuery1,ScrollBox2,2);
|
|||
|
|
if PState=0 then
|
|||
|
|
begin
|
|||
|
|
OrdDate.DateTime:=SGetServerDateTime(ADOTemp);
|
|||
|
|
SYRYWY.Text:=Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
if CopyInt=99 then
|
|||
|
|
begin
|
|||
|
|
PState:=0;
|
|||
|
|
FMainId:='';
|
|||
|
|
OrdDate.DateTime:=SGetServerDateTime(ADOTemp);
|
|||
|
|
SYRYWY.Text:=Trim(DName);
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MLConID').Value:='';
|
|||
|
|
FieldByName('CSID').Value:='';
|
|||
|
|
Post;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
readCxGrid('<27><><EFBFBD>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD>ͬ11',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmMLOrderInPut_SQJH.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxno,FConNO,FUserID,FNo:String;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'ML','ML_ConMain',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if GetLSNo(ADOCmd,FConNO,'HT','ML_ConMain',4,0)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
ConNO.Text:=Trim(FConNO);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select UserID from SY_User ');
|
|||
|
|
sql.Add(' where UserName='''+trim(SYRYWY.Text)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FUserID:=Trim(ADOQuery1.fieldbyname('UserID').AsString)+trim(formatdatetime('yy',OrdDate.Date))+trim(formatdatetime('MM',OrdDate.Date));
|
|||
|
|
if GetLSNo(ADOCmd,FNo,FUserID,'ML_ConMain',2,0)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
YWConNO.Text:=Trim(FNo);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
maxno:=Trim(FMainId);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from ML_ConMain where MLConID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('MLConID').Value:=Trim(maxno);
|
|||
|
|
FieldByName('ConType').Value:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
SSetsaveSqlNew(ADOCmd,'ML_ConMain',ScrollBox1,2);
|
|||
|
|
SSetsaveSqlNew(ADOCmd,'ML_ConMain',ScrollBox2,2);
|
|||
|
|
FieldByName('ChkStatus').Value:='0';
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
FMainId:=Trim(maxno);
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.fieldbyname('CSID').AsString)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'MS','ML_ConSub',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
maxno:=Trim(Order_Sub.fieldbyname('CSID').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from ML_ConSub where MLConID='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and CSID='''+Trim(maxno)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(Order_Sub.fieldbyname('CSID').AsString)='' then
|
|||
|
|
Append
|
|||
|
|
else
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MLConID').Value:=Trim(FMainId);
|
|||
|
|
FieldByName('CSID').Value:=Trim(maxno);
|
|||
|
|
FieldByName('MLID').Value:=Trim(Order_Sub.fieldbyname('MLID').AsString);
|
|||
|
|
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'ML_ConSub',0);
|
|||
|
|
fieldbyname('Qty').Value:=Order_Sub.FieldByName('Qty').AsFloat;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.Edit;
|
|||
|
|
Order_Sub.FieldByName('CSID').Value:=Trim(maxno);
|
|||
|
|
Order_Sub.FieldByName('MLConID').Value:=Trim(FMainId);
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
Result:=False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.TBSaveClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
OrdDate.SetFocus;
|
|||
|
|
if SYRName.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if KHName.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>跽<EFBFBD><E8B7BD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if SYRYWY.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ҵ<><D2B5>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if SYRYWFZR.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if JHType.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if CheckBox2.Checked=True then
|
|||
|
|
begin
|
|||
|
|
if KPCodeName.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ƱƷ<C6B1><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if SYRYWFZR.Text='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Order_Sub.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.v1PRTColorPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='OrdColor';
|
|||
|
|
flagname:='<27><>ɫ';
|
|||
|
|
V1Name.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
V1Note.Caption:='Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
fnote:=True;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.Order_Sub.Edit;
|
|||
|
|
Self.Order_Sub.FieldByName('MLColor').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
Self.Order_Sub.FieldByName('MLColorNo').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel4.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.KHNameBtnUpClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmKHList_CX:=TfrmKHList_CX.Create(Application);
|
|||
|
|
with frmKHList_CX do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
KHName.Text:=Trim(CDS_HZ.fieldbyname('KHName').AsString);
|
|||
|
|
KHAdd.Text:=Trim(CDS_HZ.fieldbyname('KHAdd').asstring);
|
|||
|
|
KHTel.Text:=Trim(CDS_HZ.fieldbyname('KHTel').asstring);
|
|||
|
|
KHYWFZR.Text:=Trim(CDS_HZ.fieldbyname('KHLXR').asstring);
|
|||
|
|
KHPhone.Text:=Trim(CDS_HZ.fieldbyname('KHTel').asstring);
|
|||
|
|
KHBankName.Text:=Trim(CDS_HZ3.fieldbyname('BankName').asstring);
|
|||
|
|
KHBankNo.Text:=Trim(CDS_HZ3.fieldbyname('BankNo').asstring);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmKHList_CX.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.KHNameBtnDnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBtnEditC(Sender).Text:='';
|
|||
|
|
TBtnEditC(Sender).TxtCode:='';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.v1OrderUnitPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
var
|
|||
|
|
mvalues:string;
|
|||
|
|
begin
|
|||
|
|
mvalues:=tv1.Columns[tv1.Controller.FocusedColumn.index].DataBinding.FieldName;
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='OrderUnit';
|
|||
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.Order_Sub.Edit;
|
|||
|
|
Self.Order_Sub.FieldByName(mvalues).Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.v1PriceUnitPropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='PriceUnit';
|
|||
|
|
flagname:='<27>۸<EFBFBD><DBB8><EFBFBD>λ';
|
|||
|
|
if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
|
begin
|
|||
|
|
TBAdd.Visible:=False;
|
|||
|
|
TBEdit.Visible:=False;
|
|||
|
|
TBDel.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.Order_Sub.Edit;
|
|||
|
|
Self.Order_Sub.FieldByName('PriceUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.OrdDefStr2BtnUpClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
FWZ:Integer;
|
|||
|
|
begin
|
|||
|
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
|
FWZ:=Pos('/',fsj);
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConNoKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
ConMainId:string;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.YCLFactoryBtnUpClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
FWZ:Integer;
|
|||
|
|
begin
|
|||
|
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
|
FWZ:=Pos('/',fsj);
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
|
//MainType:=TEdit(Sender).Name;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.MPRTSCTeBieNoteBtnUpClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
FWZ:Integer;
|
|||
|
|
begin
|
|||
|
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
|
FWZ:=Pos('/',fsj);
|
|||
|
|
try
|
|||
|
|
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
|||
|
|
with frmZDYHelpSel do
|
|||
|
|
begin
|
|||
|
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:=ReturnStr;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelpSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.v1Column3PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
frmZdyAttachCP_HX_Sel:=TfrmZdyAttachCP_HX_Sel.create(self);
|
|||
|
|
with frmZdyAttachCP_HX_Sel do
|
|||
|
|
begin
|
|||
|
|
IF showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
Order_Sub.Edit;
|
|||
|
|
Order_Sub.FieldByName('PRTHX').Value:=trim(cds_Hz.FieldByName('ZdyName').asstring);
|
|||
|
|
Order_Sub.Post;
|
|||
|
|
end;
|
|||
|
|
frmZdyAttachCP_HX_Sel.Free;
|
|||
|
|
end;
|
|||
|
|
tv1.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.InitColor();
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
begin
|
|||
|
|
with adoqueryTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from RT_PTColor where PTID='''+Trim(Self.PTID.Text)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
fsj:=Trim(adoqueryTmp.fieldbyname('ColDaiMa').AsString);
|
|||
|
|
Panel5.Color:=StrToInt('$'+Trim(fsj));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConCodeKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConCodeName.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.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(Order_Sub.fieldbyname('CSID').AsString)+''' ');
|
|||
|
|
sql.Add('and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
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 TfrmMLOrderInPut_SQJH.ListView1DblClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
sFieldName:string;
|
|||
|
|
fileName:string;
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount<1 then
|
|||
|
|
begin
|
|||
|
|
listView1.Visible:=false;
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if ListView1.Items.Count<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 TfrmMLOrderInPut_SQJH.Button4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
maxNo:string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
adoqueryCmd.Connection.BeginTrans;
|
|||
|
|
begin
|
|||
|
|
fFilePath:=WJPach.Text;
|
|||
|
|
fFileName:=WJName.Text;
|
|||
|
|
with adoqueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select TFId from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
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,'NX','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(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
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(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
sql.Add(' and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value:=trim(maxNO);
|
|||
|
|
fieldbyname('WBID').Value:=trim(Order_Sub.fieldbyname('CSID').AsString);
|
|||
|
|
fieldbyname('TFType').Value:='<27><>ͬ<EFBFBD><CDAC>ϸ';
|
|||
|
|
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 TfrmMLOrderInPut_SQJH.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(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Panel12.Visible:=False;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.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(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
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(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
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(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
open;
|
|||
|
|
append;
|
|||
|
|
fieldbyname('TFID').Value:=trim(maxNO);
|
|||
|
|
fieldbyname('WBID').Value:=trim(Order_Sub.fieldbyname('CSID').AsString);
|
|||
|
|
fieldbyname('TFType').Value:='<27><>ͬ<EFBFBD><CDAC>ϸ';
|
|||
|
|
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 TfrmMLOrderInPut_SQJH.Image1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel12.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.MenuItem1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
OpenDiaLog: TOpenDialog;
|
|||
|
|
fFileName:string;
|
|||
|
|
fFilePath:string;
|
|||
|
|
begin
|
|||
|
|
OpenDiaLog := TOpenDialog.Create(Self);
|
|||
|
|
if OpenDiaLog.Execute then
|
|||
|
|
begin
|
|||
|
|
fFilePath:=OpenDiaLog.FileName;
|
|||
|
|
fFileName:=ExtractFileName(OpenDiaLog.FileName);
|
|||
|
|
Panel12.Visible:=True;
|
|||
|
|
WJName.Text:=Trim(fFileName);
|
|||
|
|
WJName.Hint:=Trim(fFileName);
|
|||
|
|
WJPach.Text:=fFilePath;
|
|||
|
|
Button8.Visible:=False;
|
|||
|
|
Button4.Visible:=True;
|
|||
|
|
Button7.Visible:=True;
|
|||
|
|
Panel12.Refresh;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.N3Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fFileName:string;
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount<1 then exit;
|
|||
|
|
fFileName:=ListView1.Selected.Caption;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete from TP_File ');
|
|||
|
|
sql.Add('where WBID='''+trim(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
sql.Add(' and TFType=''<27><>ͬ<EFBFBD><CDAC>ϸ''');
|
|||
|
|
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
Initimage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.MenuItem2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if listView1.SelCount<1 then exit;
|
|||
|
|
Panel12.Visible:=True;
|
|||
|
|
Button4.Visible:=False;
|
|||
|
|
Button7.Visible:=False;
|
|||
|
|
Button8.Visible:=True;
|
|||
|
|
Panel12.Refresh;
|
|||
|
|
WJName.Text:=Trim(ListView1.Selected.Caption);
|
|||
|
|
WJName.Hint:=Trim(ListView1.Selected.Caption);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.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 TfrmMLOrderInPut_SQJH.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible:=false;
|
|||
|
|
SClearData(Panel3,2);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.MenuItem3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible:=true;
|
|||
|
|
SCSHDataCDS(Order_Sub,Panel3,2);
|
|||
|
|
Initimage();
|
|||
|
|
Button1.Visible:=true;
|
|||
|
|
button1.Caption:='<27><EFBFBD>';
|
|||
|
|
cxGrid1.Enabled:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.MenuItem4Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Order_Sub.IsEmpty then Exit;
|
|||
|
|
if Trim(Order_Sub.fieldbyname('CSID').AsString)<>'' then
|
|||
|
|
begin
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete ML_ConSub where CSID='''+Trim(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Order_Sub.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Tv1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName='IFFZ' then
|
|||
|
|
begin
|
|||
|
|
ListView1.Visible:=true;
|
|||
|
|
Initimage();
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible:=true;
|
|||
|
|
SCSHDataCDS(Order_Sub,Panel3,2);
|
|||
|
|
MLID.Text:=Trim(Order_Sub.FieldByName('MLID').AsString);
|
|||
|
|
Button1.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FJQty,FKG,FM,FMoney:String;
|
|||
|
|
FReal:Double;
|
|||
|
|
FInt:Integer;
|
|||
|
|
begin
|
|||
|
|
if Trim(ConCodeName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>Ʒ<EFBFBD><C6B7><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(Qty.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with Order_Sub do
|
|||
|
|
begin
|
|||
|
|
if Button1.Caption='ȷ<><C8B7>' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('XHNo').Value:=Order_Sub.RecordCount+1;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
edit;
|
|||
|
|
RTsavedataCDS(Order_Sub,Panel3,2);
|
|||
|
|
FieldByName('ConGY').Value:=Trim(ConGY.Text);
|
|||
|
|
FieldByName('CSID').Value:=Trim(CSID.Text);
|
|||
|
|
FieldByName('MLID').Value:=Trim(MLID.Text);
|
|||
|
|
FieldByName('ConType').Value:='Ⱦɫ<C8BE><C9AB><EFBFBD><EFBFBD>';
|
|||
|
|
if KHConCodeName.Text='' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('KHConCodeName').Value:=Trim(ConCodeName.Text);
|
|||
|
|
end;
|
|||
|
|
if ConKHColNo.Text='' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('ConKHColNo').Value:=Trim(ConColNo.Text);
|
|||
|
|
end;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
SClearData(Panel3,2);
|
|||
|
|
ConPrice.Text:='';
|
|||
|
|
Button1.Caption:='ȷ<><C8B7>';
|
|||
|
|
cxGrid1.Enabled:=true;
|
|||
|
|
Panel3.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.IFHSClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if IFHS.Checked=True then
|
|||
|
|
begin
|
|||
|
|
IFBHS.Checked:=false;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
IFBHS.Checked:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.CheckBox2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if checkbox2.Checked=true then
|
|||
|
|
begin
|
|||
|
|
KPCodeName.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
KPCodeName.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if checkbox1.Checked=true then
|
|||
|
|
begin
|
|||
|
|
BCShuoMing.Visible:=true;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
BCShuoMing.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.SYRNameBtnUpClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmGSList_CX:=TfrmGSList_CX.create(self);
|
|||
|
|
with frmGSList_CX do
|
|||
|
|
begin
|
|||
|
|
cxGrid3.Visible:=false;
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
SYRName.Text:=Trim(CDS_HZ.fieldbyname('KHName').asstring);
|
|||
|
|
SYRAdd.Text:=Trim(CDS_HZ.fieldbyname('KHAdd').asstring);
|
|||
|
|
SYRYWY.Text:=Trim(CDS_HZ.fieldbyname('KHLXR').asstring);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
Button13.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.QtyUnitBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='QtyUnit';
|
|||
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
QtyUnit.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
QtyUnit.TxtCode:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConGYBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_Sel2:=TfrmMLMangeRS_Sel2.create(self);
|
|||
|
|
with frmMLMangeRS_Sel2 do
|
|||
|
|
begin
|
|||
|
|
MLName.Text:=Trim(ConCodeName.Text);
|
|||
|
|
Formid:='1';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
ConGY.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
ConGY.TxtCode:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConCodeBtnClick(Sender: TObject);
|
|||
|
|
var maxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_Sel1:=TfrmMLMangeRS_Sel1.create(self);
|
|||
|
|
with frmMLMangeRS_Sel1 do
|
|||
|
|
begin
|
|||
|
|
formid:='2';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible:=true;
|
|||
|
|
if CSID.Text='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'MS','ML_ConSub',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
CSID.Text:=Trim(Maxno);
|
|||
|
|
end;
|
|||
|
|
Label53.Caption:=TButton(sender).Caption;
|
|||
|
|
ConCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
ConCode.TxtCode:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
ConCodeName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
//ConColor.Text:=Trim(CDS_Main.fieldbyname('ColNameKH').AsString);
|
|||
|
|
//ConColNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
//ConKHColNo.Text:=Trim(CDS_Main.fieldbyname('GYSColNo').AsString);
|
|||
|
|
//ConGY.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
//ConGY.TxtCode:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.QtyChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ConMoney.Text:=FloatToStr(StrToFloatDef(Qty.Text,0)*strtofloatdef(ConPrice.Text,0))
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.SYRFDRBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(self);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='SYRFDR';
|
|||
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
SYRFDR.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.SYRYWYBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelpYW:=TfrmZDYHelpYW.Create(self);
|
|||
|
|
with frmZDYHelpYW do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
SYRYWY.Text:=Trim(ClientDataSet1.fieldbyname('UserName').AsString);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select Top 1 SYRYWTel,SYRPhone from ML_ConMain ');
|
|||
|
|
sql.Add('where SYRYWY='''+trim(SYRYWY.Text)+''' order by OrdDate desc');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SYRYWTel.Text:=Trim(ADOQuery1.fieldbyname('SYRYWTel').AsString);
|
|||
|
|
SYRPhone.Text:=Trim(ADOQuery1.fieldbyname('SYRPhone').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.SYRYWFZRBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZDYHelpYW:=TfrmZDYHelpYW.Create(self);
|
|||
|
|
with frmZDYHelpYW do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
SYRYWFZR.Text:=Trim(ClientDataSet1.fieldbyname('UserName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button3Click(Sender: TObject);
|
|||
|
|
var maxno:string;
|
|||
|
|
begin
|
|||
|
|
frmMLMangeRS_Sel1:=TfrmMLMangeRS_Sel1.create(self);
|
|||
|
|
with frmMLMangeRS_Sel1 do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Panel3.Visible:=true;
|
|||
|
|
if CSID.Text='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'MS','ML_ConSub',3,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
self.CSID.Text:=Trim(Maxno);
|
|||
|
|
end;
|
|||
|
|
Label53.Caption:=TButton(sender).Caption;
|
|||
|
|
self.PTID.Text:=Trim(CDS_Main.fieldbyname('PTID').AsString);
|
|||
|
|
self.MLID.Text:=Trim(CDS_Main.fieldbyname('MLID').AsString);
|
|||
|
|
ConCode.Text:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
ConCode.TxtCode:=Trim(CDS_Main.fieldbyname('MLNo').AsString);
|
|||
|
|
ConCodeName.Text:=Trim(CDS_Main.fieldbyname('MLName').AsString);
|
|||
|
|
ConColor.Text:=Trim(CDS_Main.fieldbyname('ColNameKH').AsString);
|
|||
|
|
ConColNo.Text:=Trim(CDS_Main.fieldbyname('ColNo').AsString);
|
|||
|
|
ConGY.Text:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
ConGY.TxtCode:=Trim(CDS_Main.fieldbyname('GYLXName').AsString);
|
|||
|
|
self.QtyUnit.Text:='M';
|
|||
|
|
self.QtyUnit.TxtCode:='M';
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button10Click(Sender: TObject);
|
|||
|
|
var FBPIDSH:string;
|
|||
|
|
begin
|
|||
|
|
frmBPZDY_LRPB:=TfrmBPZDY_LRPB.create(self);
|
|||
|
|
with frmBPZDY_LRPB do
|
|||
|
|
begin
|
|||
|
|
flag:='PBName';
|
|||
|
|
flagName:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
ViewFlag:=true;
|
|||
|
|
Panel4.Align:=alClient;
|
|||
|
|
ToolBar3.Visible:=false;
|
|||
|
|
Button1.Visible:=False;
|
|||
|
|
ToolButton1.Visible:=true;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
ConCode.Text:=Trim(ClientDataSet1.fieldbyname('BPCode').AsString);
|
|||
|
|
ConCodeName.Text:=Trim(ClientDataSet1.fieldbyname('BPName').AsString);
|
|||
|
|
ConPrice.Text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
if ClientDataSet1.fieldbyname('SKID').AsString='' then
|
|||
|
|
FBPIDSH:=Trim(ClientDataSet1.fieldbyname('BPCode').AsString)
|
|||
|
|
else
|
|||
|
|
FBPIDSH:=Trim(ClientDataSet1.fieldbyname('SKID').AsString);
|
|||
|
|
with ADOQuery6 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select A.*,B.* from RT_PTColor A ');
|
|||
|
|
sql.Add('inner join BP_ColZDY B on B.PTID=A.PTID ');
|
|||
|
|
sql.Add('where isnull(B.SKID,'''')='''+trim(FBPIDSH)+''' and isnull(B.SKID,'''')<>''''');
|
|||
|
|
sql.Add(' order by cast(B.ColNo as int)');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
ConColor.Text:=Trim(ADOQuery6.fieldbyname('ColNameKH').AsString);
|
|||
|
|
ConColNo.Text:=Trim(ADOQuery6.fieldbyname('ColNo').AsString);
|
|||
|
|
ConKHColNo.Text:=Trim(ADOQuery6.fieldbyname('GYSColNo').AsString);
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button11Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmBPZDY_LRM:=TfrmBPZDY_LRM.create(self);
|
|||
|
|
with frmBPZDY_LRM do
|
|||
|
|
begin
|
|||
|
|
flag:='MName';
|
|||
|
|
flagName:='<27><>';
|
|||
|
|
ViewFlag:=true;
|
|||
|
|
Panel4.Align:=alClient;
|
|||
|
|
ToolBar3.Visible:=false;
|
|||
|
|
Button1.Visible:=False;
|
|||
|
|
ToolButton1.Visible:=true;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
ConCode.Text:=Trim(ClientDataSet1.fieldbyname('BPCode').AsString);
|
|||
|
|
ConCodeName.Text:=Trim(ClientDataSet1.fieldbyname('BPName').AsString);
|
|||
|
|
ConPrice.Text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button12Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmMCGRKList_XKC_CX:=TfrmMCGRKList_XKC_CX.create(self);
|
|||
|
|
with frmMCGRKList_XKC_CX do
|
|||
|
|
begin
|
|||
|
|
Fint:='1';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
ConCode.Text:=Trim(PB_MX.fieldbyname('MYNo').AsString);
|
|||
|
|
ConCodeName.Text:=Trim(PB_MX.fieldbyname('MYName').AsString);
|
|||
|
|
ConColor.Text:=Trim(PB_MX.fieldbyname('MYColor').AsString);
|
|||
|
|
ConColNo.Text:=Trim(PB_MX.fieldbyname('MYColorNo').AsString);
|
|||
|
|
ConKHColNo.Text:=Trim(PB_MX.fieldbyname('MYColorNo').AsString);
|
|||
|
|
ConPrice.Text:=Trim(PB_MX.fieldbyname('MYMDPrice').AsString);
|
|||
|
|
QtyUnit.Text:='ֻ';
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button9Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmBPZDY_LRPB_M1:=TfrmBPZDY_LRPB_M1.create(self);
|
|||
|
|
with frmBPZDY_LRPB_M1 do
|
|||
|
|
begin
|
|||
|
|
flag:='MName';
|
|||
|
|
flagName:='Ĥ<><C4A4>';
|
|||
|
|
ViewFlag:=true;
|
|||
|
|
Panel4.Align:=alClient;
|
|||
|
|
Button1.Visible:=False;
|
|||
|
|
ToolButton1.Visible:=true;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
ConCode.Text:=Trim(ClientDataSet1.fieldbyname('BPCode').AsString);
|
|||
|
|
ConCodeName.Text:=Trim(ClientDataSet1.fieldbyname('BPName').AsString);
|
|||
|
|
ConPrice.Text:=Trim(ClientDataSet1.fieldbyname('BPPrice').AsString);
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button6Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
self.Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Image2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel4.Visible:=false;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.KHConCodeBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmZHCPList_CX:=TfrmZHCPList_CX.create(self);
|
|||
|
|
with frmZHCPList_CX do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
KHConCode.Text:=trim(Order_Main.fieldbyname('ZIID').AsString);
|
|||
|
|
KHConCode.TxtCode:=trim(Order_Main.fieldbyname('ZIID').AsString);
|
|||
|
|
//KHConCodeName.Text:=trim(Order_Main.fieldbyname('ZIName').AsString);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConCodeNameKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
KHConCode.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.KHConCodeKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
KHConCodeName.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.KHConCodeNameKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConColor.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConColorKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConColNo.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConColNoKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConKHColNo.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConKHColNoKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
Qty.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.QtyKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
QtyUnit.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.QtyUnitKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConPrice.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConPriceKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConGY.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConGYKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ConNote.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConNoteKeyPress(Sender: TObject;
|
|||
|
|
var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
Button1.SetFocus;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConCodeChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ConCode.TxtCode:=ConCode.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.KHConCodeChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
KHConCode.TxtCode:=KHConCode.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.QtyUnitChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
QtyUnit.TxtCode:=QtyUnit.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.ConGYChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ConGY.TxtCode:=ConGY.Text;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.MenuItem5Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmRTPTColor:=TfrmRTPTColor.Create(Application);
|
|||
|
|
with frmRTPTColor do
|
|||
|
|
begin
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.PTID.Text:=Trim(frmRTPTColor.FPTID);
|
|||
|
|
Self.ConColor.Text:=Trim(frmRTPTColor.FColNameKH);
|
|||
|
|
Self.ConColNo.Text:=Trim(frmRTPTColor.FColName);
|
|||
|
|
Self.ConKHColNo.Text:=Trim(frmRTPTColor.FColName);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmRTPTColor.Free;
|
|||
|
|
end;
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmMLManage_LRRS:=TfrmMLManage_LRRS.Create(Application);
|
|||
|
|
with frmMLManage_LRRS do
|
|||
|
|
begin
|
|||
|
|
FCYID:=Trim(Self.MLID.Text);
|
|||
|
|
FGYName:='Ⱦɫ';
|
|||
|
|
viewFlag:=True;
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
ConColor.Text:=Trim(OrdBP_SH.fieldbyname('ColNameKH').AsString);
|
|||
|
|
ConColNo.Text:=Trim(OrdBP_SH.fieldbyname('ColNo').AsString);
|
|||
|
|
if Trim(OrdBP_SH.fieldbyname('GYSColNo').AsString)<>'' then
|
|||
|
|
ConKHColNo.Text:=Trim(OrdBP_SH.fieldbyname('GYSColNo').AsString)
|
|||
|
|
else
|
|||
|
|
ConKHColNo.Text:=Trim(OrdBP_SH.fieldbyname('ColNo').AsString);
|
|||
|
|
self.PTID.Text:=Trim(OrdBP_SH.fieldbyname('PTID').AsString);
|
|||
|
|
if Trim(PTID.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
InitColor();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmMLManage_LRRS.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmMLOrderInPut_SQJH.Button13Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmGSList_CX:=TfrmGSList_CX.create(self);
|
|||
|
|
with frmGSList_CX do
|
|||
|
|
begin
|
|||
|
|
if showmodal=1 then
|
|||
|
|
begin
|
|||
|
|
SYRBankName.Text:=Trim(CDS_HZ3.fieldbyname('BankName').asstring);
|
|||
|
|
SYRBankNo.Text:=Trim(CDS_HZ3.fieldbyname('BankNo').asstring);
|
|||
|
|
if Trim(CDS_HZ3.fieldbyname('BankType').asstring)='<27>ֽ<EFBFBD><D6BD>˻<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
CheckBox2.Checked:=false;
|
|||
|
|
KPCodeName.Visible:=False;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
CheckBox2.Checked:=true;
|
|||
|
|
KPCodeName.Visible:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|