2025-01-20 13:04:03 +08:00
|
|
|
|
unit U_MLOrderInPutHZ;
|
|
|
|
|
|
|
|
|
|
|
|
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, cxPC, cxLookAndFeels,
|
2025-07-19 16:54:23 +08:00
|
|
|
|
cxLookAndFeelPainters, dxSkinsCore,
|
|
|
|
|
|
dxSkinDarkRoom,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dxSkinOffice2013White,
|
|
|
|
|
|
dxSkinSharpPlus,
|
|
|
|
|
|
dxSkinSpringTime,
|
|
|
|
|
|
dxSkinsDefaultPainters,
|
|
|
|
|
|
dxSkinscxPCPainter,
|
2025-01-20 13:04:03 +08:00
|
|
|
|
dxBarBuiltInMenu, cxNavigator;
|
|
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmMLOrderInPutHZ = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBSave: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ScrollBox1: TScrollBox;
|
|
|
|
|
|
ADOTemp: TADOQuery;
|
|
|
|
|
|
ADOCmd: TADOQuery;
|
|
|
|
|
|
DataSource1: TDataSource;
|
|
|
|
|
|
Order_Sub: TClientDataSet;
|
|
|
|
|
|
ADOQuery1: TADOQuery;
|
|
|
|
|
|
Label10: TLabel;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
Label14: TLabel;
|
|
|
|
|
|
OrdDate: TDateTimePicker;
|
|
|
|
|
|
KHName: TBtnEditC;
|
|
|
|
|
|
CDS_CON: TClientDataSet;
|
|
|
|
|
|
DSCON: TDataSource;
|
|
|
|
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
ADOQueryTmp: TADOQuery;
|
|
|
|
|
|
ADOQuery2: TADOQuery;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
SYRName: TBtnEditC;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
Panel21: TPanel;
|
|
|
|
|
|
YWConNO: TEdit;
|
|
|
|
|
|
IFHS: TCheckBox;
|
|
|
|
|
|
IFBHS: TCheckBox;
|
|
|
|
|
|
Label52: TLabel;
|
|
|
|
|
|
KHConNo: TEdit;
|
|
|
|
|
|
PopupMenu2: TPopupMenu;
|
|
|
|
|
|
MenuItem1: TMenuItem;
|
|
|
|
|
|
N3: TMenuItem;
|
|
|
|
|
|
MenuItem2: TMenuItem;
|
|
|
|
|
|
N4: TMenuItem;
|
|
|
|
|
|
ODPat: TOpenDialog;
|
|
|
|
|
|
IdFTP1: TIdFTP;
|
|
|
|
|
|
ImageList1: TImageList;
|
|
|
|
|
|
PopupMenu3: TPopupMenu;
|
|
|
|
|
|
MenuItem5: TMenuItem;
|
|
|
|
|
|
N2: TMenuItem;
|
|
|
|
|
|
ConNo: TEdit;
|
|
|
|
|
|
cxPageControl1: TcxPageControl;
|
|
|
|
|
|
cxTabSheet1: TcxTabSheet;
|
|
|
|
|
|
cxTabSheet2: TcxTabSheet;
|
|
|
|
|
|
ToolBar2: TToolBar;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
Tv1: TcxGridDBTableView;
|
|
|
|
|
|
v1XHNo: TcxGridDBColumn;
|
|
|
|
|
|
v1ConCode: TcxGridDBColumn;
|
|
|
|
|
|
v1ConCodeName: TcxGridDBColumn;
|
|
|
|
|
|
v1ConGY: TcxGridDBColumn;
|
|
|
|
|
|
v1ConColor: TcxGridDBColumn;
|
|
|
|
|
|
v1ConColNo: TcxGridDBColumn;
|
|
|
|
|
|
v1ConKHColNo: TcxGridDBColumn;
|
|
|
|
|
|
v1ConHX: TcxGridDBColumn;
|
|
|
|
|
|
v1Qty: TcxGridDBColumn;
|
|
|
|
|
|
v1QtyUnit: TcxGridDBColumn;
|
|
|
|
|
|
v1ConPrice: TcxGridDBColumn;
|
|
|
|
|
|
v1ConMoney: TcxGridDBColumn;
|
|
|
|
|
|
v1Column3: TcxGridDBColumn;
|
|
|
|
|
|
v1ConNote: TcxGridDBColumn;
|
|
|
|
|
|
v1IFFZ: TcxGridDBColumn;
|
|
|
|
|
|
cxGrid1Level1: TcxGridLevel;
|
|
|
|
|
|
ScrollBox2: TScrollBox;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
Label7: TLabel;
|
|
|
|
|
|
Label8: TLabel;
|
|
|
|
|
|
Label9: TLabel;
|
|
|
|
|
|
Label11: TLabel;
|
|
|
|
|
|
Label12: TLabel;
|
|
|
|
|
|
Label13: TLabel;
|
|
|
|
|
|
Label15: TLabel;
|
|
|
|
|
|
Label16: TLabel;
|
|
|
|
|
|
Label17: TLabel;
|
|
|
|
|
|
Label18: TLabel;
|
|
|
|
|
|
Label19: TLabel;
|
|
|
|
|
|
Label20: TLabel;
|
|
|
|
|
|
Label21: TLabel;
|
|
|
|
|
|
Label22: TLabel;
|
|
|
|
|
|
Label23: TLabel;
|
|
|
|
|
|
Label24: TLabel;
|
|
|
|
|
|
Label25: TLabel;
|
|
|
|
|
|
Label26: TLabel;
|
|
|
|
|
|
Label27: TLabel;
|
|
|
|
|
|
Label28: TLabel;
|
|
|
|
|
|
Label29: TLabel;
|
|
|
|
|
|
Label30: TLabel;
|
|
|
|
|
|
Label31: TLabel;
|
|
|
|
|
|
Label32: TLabel;
|
|
|
|
|
|
Label33: TLabel;
|
|
|
|
|
|
Label34: TLabel;
|
|
|
|
|
|
Label35: TLabel;
|
|
|
|
|
|
Label37: TLabel;
|
|
|
|
|
|
QtyBiaoZhun: TBtnEditC;
|
|
|
|
|
|
ZLBiaoZhun: TBtnEditC;
|
|
|
|
|
|
JHType: TBtnEditC;
|
|
|
|
|
|
BZYaoQiu: TBtnEditC;
|
|
|
|
|
|
JSType: TBtnEditC;
|
|
|
|
|
|
HZQiXian: TBtnEditC;
|
|
|
|
|
|
WYZeRen: TBtnEditC;
|
|
|
|
|
|
BCShuoMing: TBtnEditC;
|
|
|
|
|
|
CheckBox1: TCheckBox;
|
|
|
|
|
|
KPCodeName: TBtnEditC;
|
|
|
|
|
|
CheckBox2: TCheckBox;
|
|
|
|
|
|
SYRAdd: TEdit;
|
|
|
|
|
|
SYRZJL: TEdit;
|
|
|
|
|
|
SYRTel: TEdit;
|
|
|
|
|
|
SYRYWTel: TEdit;
|
|
|
|
|
|
SYRBankNo: TEdit;
|
|
|
|
|
|
KHAdd: TEdit;
|
|
|
|
|
|
KHZJL: TEdit;
|
|
|
|
|
|
KHTel: TEdit;
|
|
|
|
|
|
KHFDR: TEdit;
|
|
|
|
|
|
KHYWFZR: TEdit;
|
|
|
|
|
|
KHYWTel: TEdit;
|
|
|
|
|
|
KHPhone: TEdit;
|
|
|
|
|
|
KHBankName: TEdit;
|
|
|
|
|
|
KHBankNo: TEdit;
|
|
|
|
|
|
SYRFDR: TBtnEditA;
|
|
|
|
|
|
SYRYWY: TBtnEditA;
|
|
|
|
|
|
SYRYWFZR: TBtnEditA;
|
|
|
|
|
|
Button13: TButton;
|
|
|
|
|
|
SYRBankName: TEdit;
|
|
|
|
|
|
SYRPhone: TEdit;
|
|
|
|
|
|
ListView1: TListView;
|
|
|
|
|
|
Panel12: TPanel;
|
|
|
|
|
|
Label48: TLabel;
|
|
|
|
|
|
Button4: TButton;
|
|
|
|
|
|
Panel13: TPanel;
|
|
|
|
|
|
Image1: TImage;
|
|
|
|
|
|
WJName: TEdit;
|
|
|
|
|
|
Button7: TButton;
|
|
|
|
|
|
WJPach: TEdit;
|
|
|
|
|
|
Button8: TButton;
|
|
|
|
|
|
Panel2: TPanel;
|
|
|
|
|
|
Panel4: TPanel;
|
|
|
|
|
|
Image2: TImage;
|
|
|
|
|
|
Button3: TButton;
|
|
|
|
|
|
Button5: TButton;
|
|
|
|
|
|
Button9: TButton;
|
|
|
|
|
|
Button10: TButton;
|
|
|
|
|
|
Button11: TButton;
|
|
|
|
|
|
Button12: TButton;
|
|
|
|
|
|
Button14: TButton;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
v1Column1: TcxGridDBColumn;
|
|
|
|
|
|
Label36: TLabel;
|
|
|
|
|
|
JHDate: TDateTimePicker;
|
|
|
|
|
|
Button1: TButton;
|
|
|
|
|
|
ToolButton4: TToolButton;
|
|
|
|
|
|
ToolButton5: TToolButton;
|
|
|
|
|
|
v1Column2: TcxGridDBColumn;
|
|
|
|
|
|
v1Column4: TcxGridDBColumn;
|
|
|
|
|
|
v1Column5: TcxGridDBColumn;
|
|
|
|
|
|
PriceTK: TBtnEditA;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
ToPlace: TBtnEditA;
|
|
|
|
|
|
Label38: TLabel;
|
|
|
|
|
|
FromPlace: TBtnEditA;
|
|
|
|
|
|
Label39: TLabel;
|
|
|
|
|
|
v1Column6: TcxGridDBColumn;
|
|
|
|
|
|
v1Column7: TcxGridDBColumn;
|
|
|
|
|
|
Label40: TLabel;
|
|
|
|
|
|
YDZ: 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 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 IFHSClick(Sender: TObject);
|
|
|
|
|
|
procedure CheckBox2Click(Sender: TObject);
|
|
|
|
|
|
procedure CheckBox1Click(Sender: TObject);
|
|
|
|
|
|
procedure SYRNameBtnUpClick(Sender: TObject);
|
|
|
|
|
|
procedure SYRFDRBtnClick(Sender: TObject);
|
|
|
|
|
|
procedure SYRYWYBtnClick(Sender: TObject);
|
|
|
|
|
|
procedure SYRYWFZRBtnClick(Sender: TObject);
|
|
|
|
|
|
procedure Button5Click(Sender: TObject);
|
|
|
|
|
|
procedure Image2Click(Sender: TObject);
|
|
|
|
|
|
procedure Button13Click(Sender: TObject);
|
|
|
|
|
|
procedure IFBHSClick(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
procedure v1QtyPropertiesEditValueChanged(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
procedure v1ConHXPropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
procedure ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
procedure v1Column2PropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
procedure PriceTKBtnClick(Sender: TObject);
|
|
|
|
|
|
procedure ToPlaceBtnClick(Sender: TObject);
|
|
|
|
|
|
procedure FromPlaceBtnClick(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
|
|
procedure InitData();
|
|
|
|
|
|
function SaveData(): Boolean;
|
|
|
|
|
|
function getOrderNo(fconNo: string): string;
|
|
|
|
|
|
procedure CFSaveData();
|
|
|
|
|
|
procedure Initimage();
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
public
|
|
|
|
|
|
PState, CopyInt, PriceFlag: Integer;
|
|
|
|
|
|
FMainId, FFMainId, FOrderNo,SYRYWYF,SYRYWFZRF: string;
|
|
|
|
|
|
FXS: Integer;
|
|
|
|
|
|
canshu1, canshu2: string;
|
|
|
|
|
|
fFlileFlag,FConType: string;
|
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmMLOrderInPutHZ: TfrmMLOrderInPutHZ;
|
|
|
|
|
|
newh: hwnd;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
U_DataLink, U_ZDYHelp, U_Fun, U_RTFun, U_ZDYHelpSel, U_ZdyAttachment,
|
|
|
|
|
|
U_ZdyAttachGYS, U_ZHCPList_CX, getpic, 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_MLManage_LRRS, U_ZDYHelp_YW,
|
|
|
|
|
|
U_MLMangeRS_Sel2,U_ZHCPListSel,U_ZdyAttachCP_HX_sel,U_MLMangeRS_Sel;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
WriteCxGrid('<27><><EFBFBD>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD>ͬYX', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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);
|
|
|
|
|
|
KHName.TxtCode:=Trim(ADOQuery1.fieldbyname('KHNO').AsString);
|
|
|
|
|
|
SCSHDataNew(ADOQuery1, ScrollBox2, 2);
|
|
|
|
|
|
if PState = 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
OrdDate.DateTime := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
JHDate.DateTime :=OrdDate.DateTime;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
end;
|
|
|
|
|
|
if CopyInt = 99 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
PState := 0;
|
|
|
|
|
|
FMainId := '';
|
|
|
|
|
|
OrdDate.DateTime := SGetServerDateTime(ADOTemp);
|
|
|
|
|
|
YWConNO.Text:='';
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('MLConID').Value := '';
|
|
|
|
|
|
FieldByName('CSID').Value := '';
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Trim(FMainId)='' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
SYRYWY.Text:=Trim(SYRYWYF);
|
|
|
|
|
|
SYRYWFZR.Text:=Trim(SYRYWFZRF);
|
|
|
|
|
|
JHType.Text:='<27><><EFBFBD><EFBFBD><EFBFBD>ֿ<EFBFBD><D6BF>跽<EFBFBD><E8B7BD><EFBFBD>ᡣ';
|
|
|
|
|
|
ZLBiaoZhun.Text:='<27><><EFBFBD><EFBFBD>˾<EFBFBD>ṩ<EFBFBD><E1B9A9>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
QtyBiaoZhun.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>10%<25><><EFBFBD>ڡ<EFBFBD>';
|
|
|
|
|
|
BZYaoQiu.Text:='<27><><EFBFBD><EFBFBD>װ<EFBFBD><D7B0>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>';
|
|
|
|
|
|
JSType.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
HZQiXian.Text:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD>Ʒ<D7BC>ʲ<EFBFBD><CAB2><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Թ<EFBFBD><D4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>15<31><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飬<EFBFBD>跽<EFBFBD><E8B7BD><EFBFBD>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͳ<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>֤<EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><F2B9A9B7><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>Σ<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC>˽<EFBFBD>Կ<EFBFBD><D4BF><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD>Ρ<EFBFBD>';
|
|
|
|
|
|
WYZeRen.Text:='˫<><CBAB><EFBFBD><EFBFBD><EFBFBD>ų<EFBFBD><C5B3>ŵ<EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD>Ѻ<EFBFBD>˫<EFBFBD><CBAB>Э<EFBFBD>̽<EFBFBD><CCBD><EFBFBD><EFBFBD><EFBFBD>Э<EFBFBD>̲<EFBFBD><CCB2><EFBFBD><EFBFBD><EFBFBD>ǩԼ<C7A9>ط<EFBFBD>Ժ<EFBFBD>ٲã<D9B2><C3A3><EFBFBD>ͬ<EFBFBD><EFBFBD><DEB8><EFBFBD><EFBFBD>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч֤<D0A7><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>Ч<EFBFBD>棩<EFBFBD><E6A3A9>';
|
|
|
|
|
|
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;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.FormShow(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
fsj1,fsj2:String;
|
|
|
|
|
|
begin
|
|
|
|
|
|
readCxGrid('<27><><EFBFBD>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD>ͬYX', Tv1, '<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
|
|
|
fsj1:=Copy(FConType,1,4);
|
|
|
|
|
|
fsj2:=Copy(FConType,5,4);
|
|
|
|
|
|
Label1.Caption:='<27><><EFBFBD><EFBFBD>'+fsj1+'<27><>ͬ';
|
|
|
|
|
|
Label5.Caption:=fsj2;
|
|
|
|
|
|
InitData();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TfrmMLOrderInPutHZ.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 :=FConType;
|
|
|
|
|
|
SSetsaveSqlNew(ADOCmd, 'ML_ConMain', ScrollBox1, 2);
|
|
|
|
|
|
SSetsaveSqlNew(ADOCmd, 'ML_ConMain', ScrollBox2, 2);
|
|
|
|
|
|
FieldByName('ChkStatus').Value := 'δ<><CEB4><EFBFBD><EFBFBD>';
|
|
|
|
|
|
FieldByName('KHNo').Value :=Trim(KHName.TxtCode);
|
|
|
|
|
|
if Trim(Label5.Caption)='<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('BZType').Value := '<27><>';
|
|
|
|
|
|
end else
|
|
|
|
|
|
if Trim(Label5.Caption)='<27><><EFBFBD><EFBFBD>' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FieldByName('BZType').Value := '$';
|
|
|
|
|
|
end;
|
|
|
|
|
|
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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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('ConColor').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|
|
|
|
|
Self.Order_Sub.FieldByName('ConColorEng').Value := Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Panel4.Visible := true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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);
|
|
|
|
|
|
KHName.TxtCode := Trim(CDS_HZ.fieldbyname('KHNo').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 TfrmMLOrderInPutHZ.KHNameBtnDnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
TBtnEditC(Sender).Text := '';
|
|
|
|
|
|
TBtnEditC(Sender).TxtCode := '';
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.ConNoKeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
|
var
|
|
|
|
|
|
ConMainId: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.Image1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Panel12.Visible := false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.IFHSClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if IFHS.Checked = True then
|
|
|
|
|
|
begin
|
|
|
|
|
|
IFBHS.Checked := false;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
IFBHS.Checked := true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.CheckBox2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if checkbox2.Checked = true then
|
|
|
|
|
|
begin
|
|
|
|
|
|
KPCodeName.Visible := true;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
KPCodeName.Visible := false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.CheckBox1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if checkbox1.Checked = true then
|
|
|
|
|
|
begin
|
|
|
|
|
|
BCShuoMing.Visible := true;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
BCShuoMing.Visible := false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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);
|
|
|
|
|
|
end;
|
|
|
|
|
|
free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.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 TfrmMLOrderInPutHZ.Button5Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
i:Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
self.Panel4.Visible := false;
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZHCPListSel:=TfrmZHCPListSel.Create(Application);
|
|
|
|
|
|
with frmZHCPListSel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
i:=Self.Order_Sub.RecordCount;
|
|
|
|
|
|
with Self.Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('ConCode').Value:=Trim(frmZHCPListSel.Order_Main.fieldbyname('ZIID').AsString);
|
|
|
|
|
|
FieldByName('ConCodeName').Value:=Trim(frmZHCPListSel.Order_Main.fieldbyname('ZIName').AsString);
|
|
|
|
|
|
FieldByName('ConGY').Value:=Trim(frmZHCPListSel.Order_Main.fieldbyname('ZIGY').AsString);
|
|
|
|
|
|
FieldByName('XHNo').Value:=i+1;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZHCPListSel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.Image2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Panel4.Visible := false;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.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;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.IFBHSClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if IFBHS.Checked = True then
|
|
|
|
|
|
begin
|
|
|
|
|
|
IFHS.Checked := false;
|
|
|
|
|
|
end
|
|
|
|
|
|
else
|
|
|
|
|
|
begin
|
|
|
|
|
|
IFHS.Checked := true;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
i:Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Sub.IsEmpty then Exit;
|
|
|
|
|
|
CopyAddRowCDS(Order_Sub);
|
|
|
|
|
|
i:=Order_Sub.RecordCount;
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('MLConId').Value:=null;
|
|
|
|
|
|
FieldByName('CSID').Value:=null;
|
|
|
|
|
|
FieldByName('ConColor').Value:=null;
|
|
|
|
|
|
FieldByName('ConColNo').Value:=null;
|
|
|
|
|
|
FieldByName('ConKHColNo').Value:=null;
|
|
|
|
|
|
FieldByName('XHNo').Value:=i;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.v1QtyPropertiesEditValueChanged(
|
|
|
|
|
|
Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
mvalue,FQty,FPrice,FMoney,FBZFee,FFieldName,FFeeMoney:String;
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue:=TcxTextEdit(Sender).EditingText;
|
|
|
|
|
|
if Trim(mvalue)='' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
mvalue:='0';
|
|
|
|
|
|
end;
|
|
|
|
|
|
FFieldName:=Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName(FFieldName).Value:=Trim(mvalue);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
FPrice:=Trim(Order_Sub.fieldbyname('ConPrice').AsString);
|
|
|
|
|
|
if Trim(FPrice)='' then FPrice:='0';
|
|
|
|
|
|
FQty:=Trim(Order_Sub.fieldbyname('Qty').AsString);
|
|
|
|
|
|
if Trim(FQty)='' then FQty:='0';
|
|
|
|
|
|
FFeeMoney:=Trim(Order_Sub.fieldbyname('FeeMoney').AsString);
|
|
|
|
|
|
if Trim(FFeeMoney)='' then FFeeMoney:='0';
|
|
|
|
|
|
|
|
|
|
|
|
FMoney:=Trim(Order_Sub.fieldbyname('ConMoney').AsString);
|
|
|
|
|
|
if Trim(FMoney)='' then FMoney:='0';
|
|
|
|
|
|
|
|
|
|
|
|
if Trim(FFieldName)<>'ConMoney' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FMoney:=FloatToStr(StrToFloat(FQty)*StrToFloat(FPrice)+StrToFloat(FFeeMoney));
|
|
|
|
|
|
end;
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('ConMoney').Value:=StrToFloat(FMoney);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
tv1.Controller.EditingController.ShowEdit();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if Order_Sub.IsEmpty then
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
if Trim(Order_Sub.fieldbyname('CSID').AsString) <> '' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with ADOTemp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
sql.Clear;
|
|
|
|
|
|
sql.Add('select * from ML_OrderSubidNew where isnull(ConSubId,'''')='''+Trim(Order_Sub.fieldbyname('CSID').AsString)+'''');
|
|
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if ADOTemp.IsEmpty=False then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
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 TfrmMLOrderInPutHZ.ToolButton4Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
i:Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
i:=Self.Order_Sub.RecordCount;
|
|
|
|
|
|
with Self.Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Append;
|
|
|
|
|
|
FieldByName('XHNo').Value:=i+1;
|
|
|
|
|
|
Post;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.v1ConHXPropertiesButtonClick(Sender: TObject;
|
|
|
|
|
|
AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZdyAttachCP_HX_Sel:=TfrmZdyAttachCP_HX_Sel.Create(Application);
|
|
|
|
|
|
with frmZdyAttachCP_HX_Sel do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('ConHX').Value:=Trim(frmZdyAttachCP_HX_Sel.CDS_HZ.fieldbyname('zdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZdyAttachCP_HX_Sel.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.ToolButton5Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
FName,mvalue,FCaption:string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
ToolBar2.SetFocus;
|
|
|
|
|
|
FName:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|
|
|
|
|
FCaption:=Tv1.Controller.FocusedColumn.Caption;
|
|
|
|
|
|
mvalue:=Trim(Order_Sub.fieldbyname(FName).AsString);
|
|
|
|
|
|
if Trim(FCaption)='<27><>ɫ' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>滻<EFBFBD><E6BBBB>','<27><>ʾ',0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Trim(FCaption)='<27><>ɫ(Ӣ<><D3A2>)' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('<27><>ɫ(Ӣ<><D3A2>)<29><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>滻<EFBFBD><E6BBBB>','<27><>ʾ',0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Trim(FCaption)='COLOR' then
|
|
|
|
|
|
begin
|
|
|
|
|
|
Application.MessageBox('COLOR<4F><52><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>滻1','<27><>ʾ',0);
|
|
|
|
|
|
Exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
if Application.MessageBox(PChar('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><'+Trim(FCaption)+'> <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>'+Trim(mvalue)+' <20><><EFBFBD><EFBFBD>'),'<27><>ʾ',32+4)<>IDYES then Exit;
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
First;
|
|
|
|
|
|
while not Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName(FName).Value:=Trim(mvalue);
|
|
|
|
|
|
Post;
|
|
|
|
|
|
Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.v1Column2PropertiesButtonClick(
|
|
|
|
|
|
Sender: TObject; AButtonIndex: Integer);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag:='FeeName';
|
|
|
|
|
|
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
with Order_Sub do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Edit;
|
|
|
|
|
|
FieldByName('FeeName').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.PriceTKBtnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag:='PriceTKYX';
|
|
|
|
|
|
flagname:='<27>۸<EFBFBD><DBB8><EFBFBD><EFBFBD><EFBFBD>';
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
PriceTK.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.ToPlaceBtnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag:='ToPlaceYX';
|
|
|
|
|
|
flagname:='Ŀ<>ĵ<EFBFBD>';
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ToPlace.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmMLOrderInPutHZ.FromPlaceBtnClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
try
|
|
|
|
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|
|
|
|
|
with frmZDYHelp do
|
|
|
|
|
|
begin
|
|
|
|
|
|
flag:='FromPlaceYX';
|
|
|
|
|
|
flagname:='<27><><EFBFBD>˸ۿ<CBB8>';
|
|
|
|
|
|
if ShowModal=1 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FromPlace.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
frmZDYHelp.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
end.
|
|
|
|
|
|
|