1963 lines
52 KiB
ObjectPascal
1963 lines
52 KiB
ObjectPascal
![]() |
unit U_MJManageNewFDNew;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, strUtils, SysUtils, Variants, Classes, Graphics, Controls,
|
|||
|
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridCustomTableView, cxGridTableView,
|
|||
|
cxGridBandedTableView, cxGridDBBandedTableView, cxGridLevel, cxClasses,
|
|||
|
cxControls, cxGridCustomView, cxGridDBTableView, cxGrid, StdCtrls, ComCtrls,
|
|||
|
ExtCtrls, ToolWin, cxGridCustomPopupMenu, cxGridPopupMenu, ADODB, DBClient,
|
|||
|
cxDropDownEdit, RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System,
|
|||
|
RM_GridReport, cxCheckBox, Menus, MovePanel, cxTextEdit, Buttons,
|
|||
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator;
|
|||
|
|
|||
|
function CommOpen(fhandle: hwnd; sCommName: PAnsiChar; IntTime: integer; IsMessage: integer): integer; stdcall; external 'JCYData10.DLL';
|
|||
|
|
|||
|
function CommClose(sCommName: PAnsiChar): integer; stdcall; external 'JCYData10.DLL';
|
|||
|
|
|||
|
type
|
|||
|
TfrmMJManageNewFDNew = class(TForm)
|
|||
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
cxStyle1: TcxStyle;
|
|||
|
cxStyle2: TcxStyle;
|
|||
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
DataSource1: TDataSource;
|
|||
|
Order_MJ: TClientDataSet;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ADOCmd: TADOQuery;
|
|||
|
ADOTmp: TADOQuery;
|
|||
|
RMDB_Main: TRMDBDataSet;
|
|||
|
RM2: TRMGridReport;
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBClose: TToolButton;
|
|||
|
cxGrid2: TcxGrid;
|
|||
|
Tv2: TcxGridDBTableView;
|
|||
|
tv2CDType: TcxGridDBColumn;
|
|||
|
tv2CDWZ: TcxGridDBColumn;
|
|||
|
Tv2CDQty: TcxGridDBColumn;
|
|||
|
Tv2CDReason: TcxGridDBColumn;
|
|||
|
cxGridLevel1: TcxGridLevel;
|
|||
|
TBCD: TToolButton;
|
|||
|
cxGrid3: TcxGrid;
|
|||
|
Tv3: TcxGridDBTableView;
|
|||
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
cxGridLevel2: TcxGridLevel;
|
|||
|
DataSource2: TDataSource;
|
|||
|
CDS_MJCD: TClientDataSet;
|
|||
|
DataSource3: TDataSource;
|
|||
|
CDS_MJID: TClientDataSet;
|
|||
|
v2Column1: TcxGridDBColumn;
|
|||
|
Timer1: TTimer;
|
|||
|
ADOQueryPrint: TADOQuery;
|
|||
|
v2Column2: TcxGridDBColumn;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
ScrollBox1: TScrollBox;
|
|||
|
SpeedButton13: TSpeedButton;
|
|||
|
SpeedButton14: TSpeedButton;
|
|||
|
SpeedButton15: TSpeedButton;
|
|||
|
SpeedButton16: TSpeedButton;
|
|||
|
SpeedButton17: TSpeedButton;
|
|||
|
SpeedButton18: TSpeedButton;
|
|||
|
SpeedButton21: TSpeedButton;
|
|||
|
SpeedButton22: TSpeedButton;
|
|||
|
SpeedButton23: TSpeedButton;
|
|||
|
SpeedButton24: TSpeedButton;
|
|||
|
SpeedButton25: TSpeedButton;
|
|||
|
SpeedButton26: TSpeedButton;
|
|||
|
SpeedButton29: TSpeedButton;
|
|||
|
SpeedButton30: TSpeedButton;
|
|||
|
SpeedButton31: TSpeedButton;
|
|||
|
SpeedButton32: TSpeedButton;
|
|||
|
SpeedButton33: TSpeedButton;
|
|||
|
SpeedButton34: TSpeedButton;
|
|||
|
SpeedButton37: TSpeedButton;
|
|||
|
SpeedButton38: TSpeedButton;
|
|||
|
SpeedButton39: TSpeedButton;
|
|||
|
SpeedButton40: TSpeedButton;
|
|||
|
SpeedButton41: TSpeedButton;
|
|||
|
SpeedButton42: TSpeedButton;
|
|||
|
MovePanel1: TMovePanel;
|
|||
|
Label17: TLabel;
|
|||
|
Label18: TLabel;
|
|||
|
Label19: TLabel;
|
|||
|
Label20: TLabel;
|
|||
|
Label21: TLabel;
|
|||
|
Edit1: TEdit;
|
|||
|
Button1: TButton;
|
|||
|
Button4: TButton;
|
|||
|
Edit2: TEdit;
|
|||
|
cxStyleRepository2: TcxStyleRepository;
|
|||
|
cxStyle3: TcxStyle;
|
|||
|
cxStyleRepository3: TcxStyleRepository;
|
|||
|
cxStyle4: TcxStyle;
|
|||
|
cxStyleRepository4: TcxStyleRepository;
|
|||
|
cxStyle5: TcxStyle;
|
|||
|
cxStyleRepository5: TcxStyleRepository;
|
|||
|
cxStyle6: TcxStyle;
|
|||
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
ADOQueryMainDSC: TADOQuery;
|
|||
|
SpeedButton45: TSpeedButton;
|
|||
|
SpeedButton46: TSpeedButton;
|
|||
|
SpeedButton47: TSpeedButton;
|
|||
|
SpeedButton48: TSpeedButton;
|
|||
|
SpeedButton50: TSpeedButton;
|
|||
|
SpeedButton51: TSpeedButton;
|
|||
|
SpeedButton54: TSpeedButton;
|
|||
|
SpeedButton55: TSpeedButton;
|
|||
|
Panel1: TPanel;
|
|||
|
Label1: TLabel;
|
|||
|
APID: TEdit;
|
|||
|
Label2: TLabel;
|
|||
|
BTAdd: TButton;
|
|||
|
BTEdit: TButton;
|
|||
|
Label16: TLabel;
|
|||
|
SpeedButton56: TSpeedButton;
|
|||
|
SpeedButton57: TSpeedButton;
|
|||
|
SpeedButton58: TSpeedButton;
|
|||
|
SpeedButton59: TSpeedButton;
|
|||
|
SpeedButton62: TSpeedButton;
|
|||
|
SpeedButton63: TSpeedButton;
|
|||
|
SpeedButton64: TSpeedButton;
|
|||
|
SpeedButton65: TSpeedButton;
|
|||
|
SpeedButton66: TSpeedButton;
|
|||
|
SpeedButton67: TSpeedButton;
|
|||
|
SpeedButton70: TSpeedButton;
|
|||
|
SpeedButton71: TSpeedButton;
|
|||
|
SpeedButton72: TSpeedButton;
|
|||
|
SpeedButton73: TSpeedButton;
|
|||
|
SpeedButton74: TSpeedButton;
|
|||
|
SpeedButton75: TSpeedButton;
|
|||
|
Label7: TLabel;
|
|||
|
CDQty: TEdit;
|
|||
|
Label8: TLabel;
|
|||
|
Panel2: TPanel;
|
|||
|
Label9: TLabel;
|
|||
|
MJFK: TEdit;
|
|||
|
Label3: TLabel;
|
|||
|
MJLen: TEdit;
|
|||
|
Label5: TLabel;
|
|||
|
Label6: TLabel;
|
|||
|
BTPrint: TButton;
|
|||
|
Button5: TButton;
|
|||
|
Edit3: TEdit;
|
|||
|
Label10: TLabel;
|
|||
|
Edit4: TEdit;
|
|||
|
Label12: TLabel;
|
|||
|
Label15: TLabel;
|
|||
|
Label22: TLabel;
|
|||
|
Label23: TLabel;
|
|||
|
MJSJKZ: TEdit;
|
|||
|
Panel3: TPanel;
|
|||
|
SpeedButton1: TSpeedButton;
|
|||
|
SpeedButton2: TSpeedButton;
|
|||
|
SpeedButton3: TSpeedButton;
|
|||
|
SpeedButton4: TSpeedButton;
|
|||
|
SpeedButton5: TSpeedButton;
|
|||
|
SpeedButton6: TSpeedButton;
|
|||
|
SpeedButton7: TSpeedButton;
|
|||
|
SpeedButton8: TSpeedButton;
|
|||
|
SpeedButton9: TSpeedButton;
|
|||
|
SpeedButton10: TSpeedButton;
|
|||
|
SpeedButton11: TSpeedButton;
|
|||
|
SpeedButton12: TSpeedButton;
|
|||
|
SpeedButton49: TSpeedButton;
|
|||
|
v3Column1: TcxGridDBColumn;
|
|||
|
v3Column2: TcxGridDBColumn;
|
|||
|
Label24: TLabel;
|
|||
|
Label25: TLabel;
|
|||
|
v3Column3: TcxGridDBColumn;
|
|||
|
Label28: TLabel;
|
|||
|
Edit5: TEdit;
|
|||
|
Label26: TLabel;
|
|||
|
Edit6: TEdit;
|
|||
|
C_CodeName: TEdit;
|
|||
|
Label4: TLabel;
|
|||
|
C_Color: TEdit;
|
|||
|
Label11: TLabel;
|
|||
|
BCGangNo: TEdit;
|
|||
|
Label13: TLabel;
|
|||
|
Label14: TLabel;
|
|||
|
CheckBox3: TCheckBox;
|
|||
|
MJQty1: TEdit;
|
|||
|
Label27: TLabel;
|
|||
|
Label29: TLabel;
|
|||
|
Label30: TLabel;
|
|||
|
Label31: TLabel;
|
|||
|
Edit7: TEdit;
|
|||
|
Label32: TLabel;
|
|||
|
Edit8: TEdit;
|
|||
|
Label33: TLabel;
|
|||
|
Label34: TLabel;
|
|||
|
Edit9: TEdit;
|
|||
|
Label35: TLabel;
|
|||
|
Edit10: TEdit;
|
|||
|
Label36: TLabel;
|
|||
|
ADOQueryTmp: TADOQuery;
|
|||
|
Button2: TButton;
|
|||
|
Label37: TLabel;
|
|||
|
ComboBox1: TComboBox;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure Tv2CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure TBCDClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure MJMaoZClick(Sender: TObject);
|
|||
|
procedure MJLenClick(Sender: TObject);
|
|||
|
procedure MJFKClick(Sender: TObject);
|
|||
|
procedure MJBanZuClick(Sender: TObject);
|
|||
|
procedure MJSJKZClick(Sender: TObject);
|
|||
|
procedure Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure Tv3CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
procedure FormClick(Sender: TObject);
|
|||
|
procedure Button12Click(Sender: TObject);
|
|||
|
procedure BTAddClick(Sender: TObject);
|
|||
|
procedure BTEditClick(Sender: TObject);
|
|||
|
procedure BTPrintClick(Sender: TObject);
|
|||
|
procedure Tv2CDQtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
procedure SpeedButton1Click(Sender: TObject);
|
|||
|
procedure SpeedButton12Click(Sender: TObject);
|
|||
|
procedure SpeedButton13Click(Sender: TObject);
|
|||
|
procedure cxGridDBColumn2PropertiesChange(Sender: TObject);
|
|||
|
procedure Button1Click(Sender: TObject);
|
|||
|
procedure Button4Click(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure Button5Click(Sender: TObject);
|
|||
|
procedure SpeedButton49Click(Sender: TObject);
|
|||
|
procedure APIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure Edit1Click(Sender: TObject);
|
|||
|
procedure Edit2Change(Sender: TObject);
|
|||
|
procedure Edit3Click(Sender: TObject);
|
|||
|
procedure Edit4Click(Sender: TObject);
|
|||
|
procedure Edit5Click(Sender: TObject);
|
|||
|
procedure Edit6Click(Sender: TObject);
|
|||
|
procedure MJLenKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure MJQty1KeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure Edit7Click(Sender: TObject);
|
|||
|
procedure Edit8Click(Sender: TObject);
|
|||
|
procedure Edit9Click(Sender: TObject);
|
|||
|
procedure C_CodeNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
procedure C_CodeNameExit(Sender: TObject);
|
|||
|
procedure C_ColorExit(Sender: TObject);
|
|||
|
procedure BCGangNoExit(Sender: TObject);
|
|||
|
procedure SpeedButton19Click(Sender: TObject);
|
|||
|
procedure Button2Click(Sender: TObject);
|
|||
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
private
|
|||
|
{ Private declarations }
|
|||
|
FInt, PState, PrintInt, SCInitGrid, FState: Integer;
|
|||
|
FColumn, FBanZu, FAPID, FMainId, FSubId, Fgangp: string;
|
|||
|
MValue, FCDName: string;
|
|||
|
procedure InitJP();
|
|||
|
procedure InitCDGrid();
|
|||
|
procedure InitCDGridID();
|
|||
|
procedure AddCD(Fbtn: TButton);
|
|||
|
procedure AddSL(Fbtn: TButton);
|
|||
|
function SaveData(): Boolean;
|
|||
|
procedure BtnStatus(BSInt: Boolean);
|
|||
|
procedure AddSLNew(Fbtn: TSpeedButton);
|
|||
|
procedure AddCDNew(Fbtn: TSpeedButton);
|
|||
|
procedure SavedataCK();
|
|||
|
procedure On1201(var Message: Tmessage); message 1201;
|
|||
|
public
|
|||
|
iscom: boolean;
|
|||
|
canshu: string;
|
|||
|
{ Public declarations }
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmMJManageNewFDNew: TfrmMJManageNewFDNew;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_Fun, U_ZDYHelp, U_iniParam;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
procedure TfrmMJManageNewFDNew.On1201(var Message: Tmessage);
|
|||
|
var
|
|||
|
i1, i2: integer;
|
|||
|
unitname: string;
|
|||
|
fdata: double;
|
|||
|
begin
|
|||
|
i1 := Message.WParam;
|
|||
|
i2 := Message.LParam;
|
|||
|
|
|||
|
if not CheckBox3.Checked then
|
|||
|
exit;
|
|||
|
|
|||
|
// IF trim(DParameters10)='<27><>С<EFBFBD><D0A1>'then
|
|||
|
// MJLen.Text:= format('%.2f',[i1/100000])
|
|||
|
// else
|
|||
|
MJLen.Text := format('%.1f', [i1 / 100000]);
|
|||
|
if i2 = 0 then
|
|||
|
Label9.Caption := 'M'
|
|||
|
else
|
|||
|
Label9.Caption := 'Y';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
frmMJManageNewFDNew := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
if iscom then
|
|||
|
CommClose(pchar('com2'));
|
|||
|
//DataLink_WFBProducttion.ADOLink.Connected:=False;
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.InitCDGrid();
|
|||
|
begin
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
if PState = 1 then
|
|||
|
sql.Add('select * from WFB_MJJY_CD where MJID='''' ')
|
|||
|
else
|
|||
|
sql.Add('select * from WFB_MJJY_CD where MJID=''' + Trim(CDS_MJID.fieldbyname('MJID').AsString) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_MJCD);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_MJCD);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.InitCDGridID();
|
|||
|
begin
|
|||
|
with ADOQueryMain do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY where APID=''' + Trim(FAPID) + '''');
|
|||
|
sql.Add('and Filler=' + quotedstr(trim(DName)));
|
|||
|
sql.Add('and convert(char(10),FillTime,120)=''' + formatdateTime('yyyy-MM-dd', date()) + ''' ');
|
|||
|
if Trim(SCXFlag) <> '' then
|
|||
|
sql.Add(' and JTType=''' + Trim(SCXFlag) + '''');
|
|||
|
sql.Add(' order by MJID desc');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS20(ADOQueryMain, CDS_MJID);
|
|||
|
SInitCDSData20(ADOQueryMain, CDS_MJID);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.TBCloseClick(Sender: TObject);
|
|||
|
var
|
|||
|
maxno: string;
|
|||
|
begin
|
|||
|
if CDS_MJCD.IsEmpty = False then
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.FieldByName('MCID').AsString) = '' then
|
|||
|
begin
|
|||
|
//try
|
|||
|
//ADOCmd.Connection.BeginTrans;
|
|||
|
{with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete from WFB_MJJY_CD_Temp where JTType='''+Trim(SCXFlag)+'''');
|
|||
|
Execsql;
|
|||
|
end;
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if GetLSNo(ADOCmd,maxno,'LS','WFB_MJJY_CD_Temp',2,1)=False then
|
|||
|
begin
|
|||
|
// ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<>õ<EFBFBD><C3B5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY_CD_Temp where 1<>1');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('MCID').Value:=Trim(maxno);
|
|||
|
SSetSaveDataCDSNew(ADOCmd,Tv2,CDS_MJCD,'WFB_MJJY_CD_Temp',0);
|
|||
|
FieldByName('JTType').Value:=Trim(SCXFlag);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end; }
|
|||
|
close;
|
|||
|
//ADOCmd.Connection.CommitTrans;
|
|||
|
//ModalResult:=1;
|
|||
|
//except
|
|||
|
//ADOCmd.Connection.RollbackTrans;
|
|||
|
//Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
//end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Close;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Close;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Tv2CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
//FInt:=0;
|
|||
|
//Tv1.DataController.FocusedRecordIndex;
|
|||
|
//fsj:=Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.TBCDClick(Sender: TObject);
|
|||
|
begin
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := 'WFBCD';
|
|||
|
flagname := '<27>õ<EFBFBD>';
|
|||
|
fnote := True;
|
|||
|
V1Note.Caption := 'Ӣ<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
Self.InitJP();
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.FormShow(Sender: TObject);
|
|||
|
begin
|
|||
|
Label2.Caption := '';
|
|||
|
Label24.Caption := '';
|
|||
|
Label25.Caption := '';
|
|||
|
Label29.Caption := '';
|
|||
|
Label30.Caption := '';
|
|||
|
Label31.Caption := '';
|
|||
|
InitJP();
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select BanZu from SY_User where UserId=''' + Trim(DCode) + '''');
|
|||
|
Open;
|
|||
|
FBanZu := Trim(Fieldbyname('BanZu').AsString);
|
|||
|
end;
|
|||
|
{if Trim(FBanZu)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ð<EFBFBD><C3B0>飡','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end; }
|
|||
|
if iscom then
|
|||
|
begin
|
|||
|
if CommOpen(frmMJManageNewFDNew.Handle, '', 500, 1) < 1 then
|
|||
|
begin
|
|||
|
showmessage('<27><EFBFBD><F2BFAAB4>ڴ<EFBFBD><DAB4><EFBFBD>');
|
|||
|
end;
|
|||
|
end;
|
|||
|
APID.SetFocus;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.InitJP();
|
|||
|
var
|
|||
|
AA: array[0..100] of string;
|
|||
|
i, j: Integer;
|
|||
|
begin
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select ZDYName from KH_Zdy where Type=''WFBCD'' order by ZDYNO ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
Application.MessageBox('û<>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>õ㣡', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
First;
|
|||
|
i := 0;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
AA[i] := Trim(fieldbyname('ZDYName').AsString);
|
|||
|
i := i + 1;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
i := i - 1;
|
|||
|
if i > 63 then
|
|||
|
begin
|
|||
|
i := 63;
|
|||
|
end;
|
|||
|
for j := 0 to i do
|
|||
|
begin
|
|||
|
with ScrollBox1 do
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[j]).Visible := True;
|
|||
|
TSpeedButton(Controls[j]).Hint := AA[j];
|
|||
|
if Length(AA[j]) > 4 then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[j]).Caption := Copy(Trim(AA[j]), 1, 4) + #13 + Copy(Trim(AA[j]), 5, Length(AA[j]) - 4);
|
|||
|
end
|
|||
|
else
|
|||
|
TSpeedButton(Controls[j]).Caption := AA[j];
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.AddCD(Fbtn: TButton);
|
|||
|
begin
|
|||
|
if PState < 1 then
|
|||
|
Exit;
|
|||
|
if Order_MJ.IsEmpty then
|
|||
|
Exit;
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('cdname').Value := Trim(TButton(Fbtn).Caption);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.AddCDNew(Fbtn: TSpeedButton);
|
|||
|
begin
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('cdname').Value := Trim(TSpeedButton(Fbtn).Hint);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.AddSL(Fbtn: TButton);
|
|||
|
begin
|
|||
|
if PState < 1 then
|
|||
|
Exit;
|
|||
|
if Order_MJ.IsEmpty then
|
|||
|
Exit;
|
|||
|
|
|||
|
//if MJMaoZ.Focused then
|
|||
|
if FInt = 4 then
|
|||
|
Exit;
|
|||
|
if CDS_MJCD.IsEmpty = False then
|
|||
|
begin
|
|||
|
FColumn := Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
if Trim(FColumn) <> '' then
|
|||
|
begin
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName(FColumn).Value := Trim(FieldByName(FColumn).AsString) + Trim(TButton(Fbtn).Caption);
|
|||
|
if Trim(fieldbyname('CDQtyS').AsString) <> '' then
|
|||
|
Fieldbyname('CDQty').Value := Trim(fieldbyname('CDQtyS').AsString);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.AddSLNew(Fbtn: TSpeedButton);
|
|||
|
begin
|
|||
|
if PState < 1 then
|
|||
|
Exit;
|
|||
|
if Trim(FAPID) = '' then
|
|||
|
Exit;
|
|||
|
|
|||
|
//if MJMaoZ.Focused then
|
|||
|
if FInt = 4 then
|
|||
|
Exit;
|
|||
|
if FInt = 11 then
|
|||
|
begin
|
|||
|
if TSpeedButton(Fbtn).Tag = 9 then
|
|||
|
Exit;
|
|||
|
Edit1.Text := Trim(Edit1.Text) + Trim(TSpeedButton(Fbtn).Caption);
|
|||
|
Edit1.SelectAll;
|
|||
|
end
|
|||
|
else if FInt = 12 then
|
|||
|
begin
|
|||
|
if TSpeedButton(Fbtn).Tag = 9 then
|
|||
|
Exit;
|
|||
|
Edit2.Text := Trim(Edit2.Text) + Trim(TSpeedButton(Fbtn).Caption);
|
|||
|
Edit2.SelectAll;
|
|||
|
end; { else
|
|||
|
if CDS_MJCD.IsEmpty=False then
|
|||
|
begin
|
|||
|
FColumn:=Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
if Trim(FColumn)<>'' then
|
|||
|
begin
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName(FColumn).Value:=Trim(FieldByName(FColumn).AsString)+Trim(TButton(Fbtn).Caption);
|
|||
|
if Trim(fieldbyname('CDQtyS').AsString)<>'' then
|
|||
|
Fieldbyname('CDQty').Value:=Trim(fieldbyname('CDQtyS').AsString);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end; }
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Tv2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
//if Tv2.OptionsSelection.CellSelect=True then
|
|||
|
if CDS_MJCD.IsEmpty then
|
|||
|
Exit;
|
|||
|
|
|||
|
if Trim(CDS_MJCD.fieldbyname('MCID').AsString) = '' then
|
|||
|
begin
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
CDS_MJCD.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJMaoZClick(Sender: TObject);
|
|||
|
begin
|
|||
|
FInt := 1;
|
|||
|
FColumn := '';
|
|||
|
panel3.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJLenClick(Sender: TObject);
|
|||
|
begin
|
|||
|
FInt := 2;
|
|||
|
FColumn := '';
|
|||
|
panel3.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJFKClick(Sender: TObject);
|
|||
|
begin
|
|||
|
FInt := 3;
|
|||
|
FColumn := '';
|
|||
|
panel3.Visible := True;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJBanZuClick(Sender: TObject);
|
|||
|
begin
|
|||
|
FInt := 4;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJSJKZClick(Sender: TObject);
|
|||
|
begin
|
|||
|
FInt := 4;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Tv1CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
//DataLink_WFBProducttion.ADOLink.Connected:=False;
|
|||
|
FInt := 4;
|
|||
|
// if PState=1 then Exit;
|
|||
|
InitCDGridID();
|
|||
|
//InitCDGrid();
|
|||
|
{with ADOTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY where MJID='''+Trim(CDS_MJID.fieldbyname('MJID').AsString)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
MJMaoZ.Text:='';
|
|||
|
MJLen.Text:='';
|
|||
|
MJFK.Text:='';
|
|||
|
MJSJKZ.Text:='';
|
|||
|
end else
|
|||
|
SSetWinData(ADOTmp,Panel5); }
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Tv3CellClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
begin
|
|||
|
if CDS_MJCD.IsEmpty = False then
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.fieldbyname('MJID').AsString) = '' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
FInt := 4;
|
|||
|
PState := 0;
|
|||
|
InitCDGrid();
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY where MJID=''' + Trim(CDS_MJID.fieldbyname('MJID').AsString) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
C_CodeName.Text := Trim(ADOTmp.fieldbyname('C_CodeName').AsString);
|
|||
|
C_Color.Text := Trim(ADOTmp.fieldbyname('C_Color').AsString);
|
|||
|
BCgangNo.Text := Trim(ADOTmp.fieldbyname('BCgangNo').AsString);
|
|||
|
MJFK.Text := Trim(ADOTmp.fieldbyname('MJFK').AsString);
|
|||
|
MJSJKZ.Text := Trim(ADOTmp.fieldbyname('MJSJKZ').AsString);
|
|||
|
MJLen.Text := Trim(ADOTmp.fieldbyname('MJLen').AsString);
|
|||
|
// MJQty1.Text:=Trim(ADOTmp.fieldbyname('MJQty1').AsString);
|
|||
|
//MJQty2.Text:=Trim(ADOTmp.fieldbyname('MJQty2').AsString);
|
|||
|
// MJMaoZ.Text:=Trim(ADOTmp.fieldbyname('MJMaoZ').AsString);
|
|||
|
Label15.Caption := Trim(CDS_MJID.fieldbyname('MJID').AsString);
|
|||
|
if Trim(ADOTmp.fieldbyname('MJType').AsString) = '<27><>Ʒ' then
|
|||
|
begin
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
Edit5.Text := '';
|
|||
|
end
|
|||
|
else if Trim(ADOTmp.fieldbyname('MJType').AsString) = '<27><>Ʒ' then
|
|||
|
begin
|
|||
|
Edit4.Text := '<27><>';
|
|||
|
Edit3.Text := '';
|
|||
|
Edit5.Text := '';
|
|||
|
end
|
|||
|
else if Trim(ADOTmp.fieldbyname('MJType').AsString) = '<27><>ɫƷ' then
|
|||
|
begin
|
|||
|
Edit4.Text := '';
|
|||
|
Edit3.Text := '';
|
|||
|
Edit5.Text := '<27><>';
|
|||
|
end;
|
|||
|
BtnStatus(False);
|
|||
|
Label16.Caption := '';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.FormClick(Sender: TObject);
|
|||
|
begin
|
|||
|
FInt := 4;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Button12Click(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
if PState < 1 then
|
|||
|
Exit;
|
|||
|
if Trim(FAPID) = '' then
|
|||
|
Exit;
|
|||
|
if FInt = 4 then
|
|||
|
Exit;
|
|||
|
begin
|
|||
|
FColumn := Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
if Trim(FColumn) <> '' then
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.FieldByName(FColumn).AsString) <> '' then
|
|||
|
begin
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
if Length(CDS_MJCD.FieldByName(FColumn).AsString) = 1 then
|
|||
|
begin
|
|||
|
FieldByName(FColumn).Value := null;
|
|||
|
FieldByName('CDQty').Value := 0;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FieldByName(FColumn).Value := Copy(Trim(FieldByName(FColumn).AsString), 1, Length(Trim(FieldByName(FColumn).AsString)) - 1);
|
|||
|
FieldByName('CDQty').Value := FieldByName(FColumn).Value;
|
|||
|
end;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmMJManageNewFDNew.SaveData(): Boolean;
|
|||
|
var
|
|||
|
maxno, fapTM, FMJID, BZID: string;
|
|||
|
FMJLen, fhcQty: Double;
|
|||
|
FOrder, i: Integer;
|
|||
|
begin
|
|||
|
|
|||
|
if PState = 1 then
|
|||
|
FMJID := ''
|
|||
|
else if PState = 2 then
|
|||
|
FMJID := Trim(CDS_MJID.fieldbyname('MJID').AsString)
|
|||
|
else if PState < 1 then
|
|||
|
Exit;
|
|||
|
|
|||
|
FMJLen := StrToFloatdef(trim(MJLen.Text), 0);
|
|||
|
if trim(Edit7.Text) <> '' then
|
|||
|
FMJLen := FMJLen + 1;
|
|||
|
if trim(Edit8.Text) <> '' then
|
|||
|
FMJLen := FMJLen + 2;
|
|||
|
if trim(Edit9.Text) <> '' then
|
|||
|
FMJLen := FMJLen + 3;
|
|||
|
if FMJLen < 0 then
|
|||
|
FMJLen := 0;
|
|||
|
try
|
|||
|
ADOCmd.Connection.BeginTrans;
|
|||
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from WFB_MJJY where MJId=''' + Trim(FMJID) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(FMJID) = '' then
|
|||
|
begin
|
|||
|
{with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.Add('select * from JYOrder_Sub_AnPai_MX where AOrdQty3=0 and APID='''+Trim(FAPID)+''' order by ApsubId ');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOQueryTmp,maxno,'','APTM',4,1)=False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>','<27><>ʾ',0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
fapTM:=maxno;
|
|||
|
maxno:=trim(SCXFlag)+trim(fapTM);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
fapTM:=trim(ADOTmp.fieldbyname('APTm').AsString);
|
|||
|
fhcQty:=ADOTmp.fieldbyname('AOrdQty1').AsFloat;
|
|||
|
maxno:=trim(SCXFlag)+trim(fapTM);
|
|||
|
end; }
|
|||
|
if GetLSNo(ADOQueryTmp, maxno, '', 'APTM', 4, 1) = False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>쳣<EFBFBD><ECB3A3>', '<27><>ʾ', 0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
fapTM := maxno;
|
|||
|
maxno := trim(SCXFlag) + trim(fapTM);
|
|||
|
Append;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
maxno := Trim(FMJID);
|
|||
|
Edit;
|
|||
|
end;
|
|||
|
FieldByName('MainId').value := Trim(FMainId);
|
|||
|
FieldByName('SubId').value := Trim(FSubId);
|
|||
|
FieldByName('APId').value := Trim(FAPID);
|
|||
|
FieldByName('MJID').Value := Trim(maxno);
|
|||
|
FieldByName('MJStr2').Value := 'δ<><CEB4><EFBFBD><EFBFBD>';
|
|||
|
FieldByName('MJBanZu').Value := Trim(FBanZu);
|
|||
|
|
|||
|
FieldByName('C_CodeName').Value := Trim(C_CodeName.Text);
|
|||
|
FieldByName('C_Color').Value := Trim(C_Color.Text);
|
|||
|
FieldByName('BCGangNo').Value := Trim(BCGangNo.Text);
|
|||
|
FieldByName('MJQTy1').Value := fhcQty;
|
|||
|
FieldByName('MJLen').Value := FMJLen;
|
|||
|
|
|||
|
if Trim(MJFK.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('MJFK').Value := StrToFloat(MJFK.Text);
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(MJSJKZ.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('MJSJKZ').Value := StrToFloat(MJSJKZ.Text);
|
|||
|
end;
|
|||
|
if Trim(Edit3.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('MJType').Value := '<27><>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit4.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('MJType').Value := '<27><>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit5.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('MJType').Value := '<27><>ɫƷ';
|
|||
|
end;
|
|||
|
FieldByName('MJTypeOther').Value := Trim(Label9.Caption);
|
|||
|
FieldByName('MJStr1').Value := Trim(Label13.Caption);
|
|||
|
FieldByName('MJXH').Value := 1;
|
|||
|
if Trim(FMJID) = '' then
|
|||
|
begin
|
|||
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
FieldByName('EditTime').Value := SGetServerDateTime(ADOTmp);
|
|||
|
end;
|
|||
|
if Trim(SCXFlag) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('JTType').Value := Trim(SCXFlag);
|
|||
|
end;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
{
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from JYOrder_Sub_AnPai_MX where APTM='''+Trim(FAPTM)+'''');
|
|||
|
Open;
|
|||
|
if IsEmpty then
|
|||
|
begin
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select isnull(max(ApsubId),0)+1 as fApsubId from JYOrder_Sub_AnPai_MX where Apid='''+Trim(FAPID)+'''');
|
|||
|
Open;
|
|||
|
i:=fieldbyname('fApsubId').AsInteger;
|
|||
|
end;
|
|||
|
append;
|
|||
|
FieldByName('ApId').Value:=Trim(FAPID);
|
|||
|
FieldByName('ApsubId').Value:=i;
|
|||
|
FieldByName('APTM').Value:=Trim(maxno);
|
|||
|
FieldByName('AOrdQty2').Value:=0;
|
|||
|
FieldByName('AOrdQty1').Value:=0;
|
|||
|
FieldByName('AOrdQty3').Value:=fmjlen;
|
|||
|
FieldByName('AorddefNote1').Value:='';
|
|||
|
if Trim(Edit3.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Aorddefstr1').Value:='<27><>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit4.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Aorddefstr1').Value:='һ<>ȴ<EFBFBD>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit5.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Aorddefstr1').Value:='<27><><EFBFBD>ȴ<EFBFBD>Ʒ';
|
|||
|
end;
|
|||
|
post;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
edit;
|
|||
|
FieldByName('APTM').Value:=Trim(maxno);
|
|||
|
FieldByName('AOrdQty3').Value:=fmjlen;
|
|||
|
if Trim(Edit3.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Aorddefstr1').Value:='<27><>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit4.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Aorddefstr1').Value:='һ<>ȴ<EFBFBD>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit5.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('Aorddefstr1').Value:='<27><><EFBFBD>ȴ<EFBFBD>Ʒ';
|
|||
|
end;
|
|||
|
post;
|
|||
|
end;
|
|||
|
end; }
|
|||
|
FMJID := Trim(maxno);
|
|||
|
///<2F><><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.fieldbyname('MCID').AsString) = '' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOTmp, maxno, 'MC', 'WFB_MJJY_CD', 5, 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(CDS_MJCD.fieldbyname('MCID').AsString);
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from WFB_MJJY_CD ');
|
|||
|
sql.Add(' where MCID=''' + Trim(maxno) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
if Trim(CDS_MJCD.fieldbyname('MCID').AsString) = '' then
|
|||
|
Append
|
|||
|
else
|
|||
|
Edit;
|
|||
|
FieldByName('MJId').Value := Trim(FMJID);
|
|||
|
FieldByName('MCID').Value := Trim(maxno);
|
|||
|
SSetSaveDataCDSNew(ADOCmd, Tv2, CDS_MJCD, 'WFB_MJJY_CD', 0);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
CDS_MJCD.Edit;
|
|||
|
CDS_MJCD.FieldByName('MCID').Value := Trim(maxno);
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with CDS_MJID do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('MJID').Value := Trim(FMJID);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('update WFB_MJJY SET CDList= dbo.F_Get_Order_SubStr(MJID,''MJCDHZSL'')');
|
|||
|
sql.Add('where MJID=''' + Trim(FMJID) + ''' ');
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select count(*) as gangp from WFB_MJJY ');
|
|||
|
sql.Add(' where subid=''' + Trim(Fsubid) + ''' and BCGangNo=''' + Trim(BCGangNo.Text) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if StrToFloat(ADOCmd.fieldbyname('gangp').AsString) > StrToFloatdef(Fgangp, 0) then
|
|||
|
begin
|
|||
|
if Application.MessageBox('<27><><EFBFBD><EFBFBD><D7BE><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>ﵽ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
// application.MessageBox('<27><><EFBFBD><EFBFBD><D7BE><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE>ﵽ', '<27><>ʾ');
|
|||
|
Exit;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
ADOCmd.Connection.CommitTrans;
|
|||
|
Result := True;
|
|||
|
PState := 0;
|
|||
|
except
|
|||
|
Result := False;
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.BTAddClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Label2.Caption) = '' then
|
|||
|
Exit;
|
|||
|
PState := 1;
|
|||
|
FInt := 11;
|
|||
|
// pint=1;
|
|||
|
InitCDGridID();
|
|||
|
InitCDGrid();
|
|||
|
BtnStatus(True);
|
|||
|
Label16.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.BTEditClick(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_MJID.IsEmpty then
|
|||
|
Exit;
|
|||
|
PState := 2;
|
|||
|
Label16.Caption := '<27><EFBFBD>';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.BTPrintClick(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
mvalue: Double;
|
|||
|
Txt, fImagePath: string;
|
|||
|
Moudle: THandle;
|
|||
|
Makebar: TMakebar;
|
|||
|
Mixtext: TMixtext;
|
|||
|
fRoll: Tstringlist;
|
|||
|
i: integer;
|
|||
|
begin
|
|||
|
if Trim(FAPID) = '' then
|
|||
|
Exit;
|
|||
|
MJLen.SetFocus;
|
|||
|
if FInt = 4 then
|
|||
|
begin
|
|||
|
if CDS_MJID.IsEmpty = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룿<EFBFBD>볢<EFBFBD><EBB3A2><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if trim(C_CodeName.Text) = '0' then
|
|||
|
begin
|
|||
|
Application.MessageBox('Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if trim(C_Color.Text) = '0' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(MJLen.Text) = '' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD>Ȳ<EFBFBD><C8B2><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if TryStrToFloat(MJLen.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if strtointdef(trim(Edit10.Text), 1) < 0 then
|
|||
|
begin
|
|||
|
application.MessageBox('ƥ<><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>1<EFBFBD><31>', '<27><>ʾ', 0);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
if LeftStr(trim(C_Color.Text), 1) = '0' then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(MJFK.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(MJFK.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
if Trim(MJSJKZ.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(MJSJKZ.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
|
|||
|
{ if PState=1 then
|
|||
|
begin
|
|||
|
if Application.MessageBox('<27>Ƿ<EFBFBD>Ҫ<EFBFBD><D2AA>ӡ<EFBFBD><D3A1><EFBFBD>룿<EFBFBD><EBA3BF>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<DEB8>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
end; }
|
|||
|
|
|||
|
fRoll := Tstringlist.Create;
|
|||
|
for i := 1 to strtointdef(Edit10.Text, 1) do
|
|||
|
begin
|
|||
|
if SaveData() then
|
|||
|
begin
|
|||
|
fRoll.Add(CDS_MJID.FieldByName('MJID').AsString);
|
|||
|
BTAdd.Click;
|
|||
|
end
|
|||
|
else
|
|||
|
exit;
|
|||
|
end;
|
|||
|
|
|||
|
if fRoll.Count < 1 then
|
|||
|
exit;
|
|||
|
//BtnStatus(False);
|
|||
|
MJFK.Text := '';
|
|||
|
//MJSJKZ.Text:='';
|
|||
|
MJLen.Text := '';
|
|||
|
// MJMaoZ.Text:='';
|
|||
|
// MJQty1.Text:='';
|
|||
|
// MJQty2.Text:='';
|
|||
|
// MJSJKZ.Text:='';
|
|||
|
Label15.Caption := '';
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
Edit5.Text := '';
|
|||
|
// Edit7.Text:='';
|
|||
|
// Edit8.Text:='';
|
|||
|
// Edit9.Text:='';
|
|||
|
if Trim(Edit6.Text) = '<27><>' then
|
|||
|
begin
|
|||
|
for i := 0 to fRoll.Count - 1 do
|
|||
|
begin
|
|||
|
try
|
|||
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
Txt := Trim(fRoll.Strings[i]);
|
|||
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
if FileExists(fImagePath) then
|
|||
|
DeleteFile(fImagePath);
|
|||
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select A.*,C_CodeNameZW=(select Top 1 defnote3 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and Type=''CP'') ');
|
|||
|
sql.Add(',C_colorName=(select Top 1 DEFstr6 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and X.DEFstr3=A.C_Color and Type=''CP'') ');
|
|||
|
sql.Add(' from WFB_MJJY A');
|
|||
|
SQL.Add(' where A.MJID=''' + Trim(fRoll.Strings[i]) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͨ<>ñ<EFBFBD>ǩ.rmf';
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
RM2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1);
|
|||
|
// RM2.ShowReport;
|
|||
|
RM2.PrintReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\ͨ<>ñ<EFBFBD>ǩ.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
MJLen.SetFocus;
|
|||
|
Label16.Caption := '';
|
|||
|
BTAdd.Click;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.SavedataCK();
|
|||
|
var
|
|||
|
CRID: Integer;
|
|||
|
MaxCkNo, MaxCkSubNo: string;
|
|||
|
begin
|
|||
|
//if Trim(Cds_Main.fieldbyname('SubType').AsString)='<27><><EFBFBD><EFBFBD>' then
|
|||
|
//////////////////////////////////////////////////////////////<2F><><EFBFBD>浽<EFBFBD><E6B5BD><EFBFBD><EFBFBD>Ʒ<EFBFBD>ֿ<EFBFBD>////////////////////////////////////////////////
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
SQL.add('Update CK_BanCP_CRID Set CRID=CRID+1');
|
|||
|
sql.Add('select * from CK_BanCP_CRID');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
CRID := ADOCmd.fieldbyname('CRID').Value;
|
|||
|
if GetLSNo(ADOCmd, MaxCkNo, 'JR', 'CK_BanCP_CR', 4, 1) = False then
|
|||
|
begin
|
|||
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD>Ʒ<EFBFBD>ֿ<EFBFBD><D6BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_CR where 1<>1');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('MainId').Value := Trim(FMainId);
|
|||
|
FieldByName('SubId').Value := Trim(FSubId);
|
|||
|
FieldByName('APID').Value := Trim(FAPID);
|
|||
|
FieldByName('MJID').Value := Trim(CDS_MJID.fieldbyname('MJId').AsString);
|
|||
|
FieldByName('BCID').Value := Trim(MaxCkNo);
|
|||
|
FieldByName('CRTime').Value := SGetServerDateTime(ADOTmp);
|
|||
|
FieldByName('CRFlag').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
FieldByName('CRType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
//FieldByName('JTType').Value:=Trim(XJFlag);
|
|||
|
FieldByName('CRID').Value := CRID;
|
|||
|
|
|||
|
if Trim(MJLen.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('Qty').Value := StrToFloat(MJLen.Text);
|
|||
|
end;
|
|||
|
FieldByName('QtyUnit').Value := Trim(Label9.Caption);
|
|||
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
FieldByName('FillTime').Value := SGetServerDateTime(ADOTmp);
|
|||
|
if Trim(Edit3.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('CPType').Value := '<27><>Ʒ';
|
|||
|
end;
|
|||
|
if Trim(Edit4.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('CPType').Value := '<27><>Ʒ';
|
|||
|
end;
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from CK_BanCP_KC where 1<>1');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('CRID').Value := CRID;
|
|||
|
FieldByName('BCID').Value := Trim(MaxCkNo);
|
|||
|
FieldByName('MJID').Value := Trim(CDS_MJID.fieldbyname('MJID').AsString);
|
|||
|
|
|||
|
if Trim(MJLen.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('KCQty').Value := StrToFloat(MJLen.Text);
|
|||
|
end;
|
|||
|
FieldByName('KCQtyUnit').Value := Trim(Label9.Caption);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.BtnStatus(BSInt: Boolean);
|
|||
|
begin
|
|||
|
// Tv2.OptionsSelection.CellSelect:=BSInt;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Tv2CDQtyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
var
|
|||
|
mvalue: string;
|
|||
|
begin
|
|||
|
try
|
|||
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
if Trim(mvalue) <> '' then
|
|||
|
begin
|
|||
|
CDS_MJCD.Edit;
|
|||
|
CDS_MJCD.FieldByName('CDQty').Value := mvalue;
|
|||
|
CDS_MJCD.Post;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
CDS_MJCD.Edit;
|
|||
|
CDS_MJCD.FieldByName('CDQty').Value := 0;
|
|||
|
CDS_MJCD.Post;
|
|||
|
end;
|
|||
|
CDS_MJCD.Edit;
|
|||
|
CDS_MJCD.FieldByName('CDQtyS').Value := mvalue;
|
|||
|
except
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>֣<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.SpeedButton1Click(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
fsj := Trim(TSpeedButton(Sender).Hint);
|
|||
|
if Trim(fsj) = '' then
|
|||
|
Exit;
|
|||
|
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption);
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.SpeedButton12Click(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
|
|||
|
if Trim(fsj) = '' then
|
|||
|
Exit;
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := Copy(fsj, 1, Length(fsj) - 1);
|
|||
|
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.SpeedButton13Click(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
if Trim(Label2.Caption) = '' then
|
|||
|
Exit;
|
|||
|
// if Label2.Visible=False then Exit;
|
|||
|
{with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select * from Order_JYResult where APID='''+Trim(FAPID)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD>δ¼<CEB4><C2BC>,<2C><><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD>!','<27><>ʾ',0);
|
|||
|
Exit;
|
|||
|
end; }
|
|||
|
if Trim(CDS_MJCD.fieldbyname('MJID').AsString) <> '' then
|
|||
|
begin
|
|||
|
BTAdd.Click;
|
|||
|
end;
|
|||
|
if Trim(Label15.Caption) <> '' then
|
|||
|
begin
|
|||
|
MJFK.Text := '';
|
|||
|
//MJSJKZ.Text:='';
|
|||
|
MJLen.Text := '';
|
|||
|
// MJMaoZ.Text:='';
|
|||
|
// MJQty1.Text:='';
|
|||
|
// MJSJKZ.Text:='';
|
|||
|
Label15.Caption := '';
|
|||
|
|
|||
|
end;
|
|||
|
if Trim(FAPID) = '' then
|
|||
|
Exit;
|
|||
|
FCDName := Trim(TSpeedButton(Sender).Hint);
|
|||
|
MovePanel1.Visible := True;
|
|||
|
Label21.Caption := Trim(FCDName);
|
|||
|
FInt := 11;
|
|||
|
PState := 1;
|
|||
|
Edit1.SetFocus;
|
|||
|
//CDQty.SetFocus;
|
|||
|
Panel3.Visible := True;
|
|||
|
with Panel3 do
|
|||
|
begin
|
|||
|
for i := 0 to ControlCount - 1 do
|
|||
|
begin
|
|||
|
if Controls[i] is TSpeedButton then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[i]).Hint := Trim(Edit1.Name);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.cxGridDBColumn2PropertiesChange(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
begin
|
|||
|
|
|||
|
fsj := Trim(Order_MJ.fieldbyname('SubId').AsString);
|
|||
|
Order_MJ.DisableControls;
|
|||
|
with Order_MJ do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(Order_MJ.fieldbyname('SubId').AsString) <> fsj then
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('SSel').Value := False;
|
|||
|
end;
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
Order_MJ.EnableControls;
|
|||
|
Order_MJ.Locate('SubId', fsj, []);
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Button1Click(Sender: TObject);
|
|||
|
var
|
|||
|
mvalue: Double;
|
|||
|
begin
|
|||
|
{ if Trim(Edit1.Text)='' then
|
|||
|
begin
|
|||
|
Application.MessageBox('λ<>ò<EFBFBD><C3B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
exit;
|
|||
|
end; }
|
|||
|
if Trim(Edit1.Text) <> '' then
|
|||
|
begin
|
|||
|
if Trim(Edit2.Text) <> '' then
|
|||
|
begin
|
|||
|
if StrToFloat(Edit2.Text) < StrToFloat(Edit1.Text) then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>õ<EFBFBD>λ<EFBFBD><CEBB>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
if CDQty.Text <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(CDQty.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end;
|
|||
|
with CDS_MJCD do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('cdname').Value := Trim(FCDName);
|
|||
|
FieldByName('CDbeg').Value := Trim(Edit1.Text);
|
|||
|
FieldByName('CDEnd').Value := Trim(Edit2.Text);
|
|||
|
if Trim(CDQty.Text) <> '' then
|
|||
|
begin
|
|||
|
FieldByName('CDQty').Value := StrToFloat(CDQty.Text);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
FieldByName('CDQty').Value := 0;
|
|||
|
end;
|
|||
|
{if Trim(Edit2.Text)<>'' then
|
|||
|
begin
|
|||
|
FieldByName('CDQty').Value:=StrToFloat(Edit2.Text)-StrToFloat(Edit1.Text);
|
|||
|
end else
|
|||
|
begin
|
|||
|
FieldByName('CDQty').Value:=0;
|
|||
|
end; }
|
|||
|
|
|||
|
Post;
|
|||
|
end;
|
|||
|
Edit1.Text := '';
|
|||
|
Edit2.Text := '';
|
|||
|
CDQty.Text := '';
|
|||
|
MovePanel1.Visible := False;
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Button4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Edit1.Text := '';
|
|||
|
Edit2.Text := '';
|
|||
|
CDQty.Text := '';
|
|||
|
MovePanel1.Visible := False;
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.ToolButton1Click(Sender: TObject);
|
|||
|
begin
|
|||
|
//InitGrid();
|
|||
|
InitJP();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Button5Click(Sender: TObject);
|
|||
|
var
|
|||
|
fPrintFile: string;
|
|||
|
Txt, fImagePath: string;
|
|||
|
Moudle: THandle;
|
|||
|
Makebar: TMakebar;
|
|||
|
Mixtext: TMixtext;
|
|||
|
NewFile: TFileStream;
|
|||
|
OldFile: TFileStream;
|
|||
|
begin
|
|||
|
if CDS_MJID.IsEmpty then
|
|||
|
Exit;
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('Update WFB_MJJY Set PrtAgnFlag=1,PrtAgnDate=getdate(),PrtAgnPerson=''' + Trim(DName) + '''');
|
|||
|
sql.Add(' where MJID=''' + Trim(CDS_MJID.fieldbyname('MJID').AsString) + '''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
|
|||
|
try
|
|||
|
Moudle := LoadLibrary('MakeQRBarcode.dll');
|
|||
|
@Makebar := GetProcAddress(Moudle, 'Make');
|
|||
|
@Mixtext := GetProcAddress(Moudle, 'MixText');
|
|||
|
Txt := Trim(CDS_MJID.fieldbyname('MJID').AsString);
|
|||
|
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
|
|||
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
|
|||
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
|
|||
|
if FileExists(fImagePath) then
|
|||
|
DeleteFile(fImagePath);
|
|||
|
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
|
|||
|
except
|
|||
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_ICONERROR);
|
|||
|
exit;
|
|||
|
end;
|
|||
|
with ADOQueryPrint do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select A.*,C_CodeNameZW=(select Top 1 defnote3 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and Type=''CP'') ');
|
|||
|
sql.Add(',C_colorName=(select Top 1 DEFstr6 from KH_Zdy_Attachment X where X.ZdyName=A.C_CodeName and X.DEFstr3=A.C_Color and Type=''CP'') ');
|
|||
|
sql.Add(' from WFB_MJJY A');
|
|||
|
SQL.Add(' where A.MJID=''' + Trim(CDS_MJID.fieldbyname('MJID').AsString) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\ͨ<>ñ<EFBFBD>ǩ.rmf';
|
|||
|
if FileExists(fPrintFile) then
|
|||
|
begin
|
|||
|
RMVariables['QRBARCODE'] := fImagePath;
|
|||
|
RM2.LoadFromFile(fPrintFile);
|
|||
|
// RM2.ShowReport;
|
|||
|
RM2.PrintReport;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD>ǩ.rmf'), '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.SpeedButton49Click(Sender: TObject);
|
|||
|
begin
|
|||
|
Panel3.Visible := False;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.APIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
Button2.Click;
|
|||
|
{ with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.* ');
|
|||
|
sql.Add('from JYOrder_Sub_AnPai A');
|
|||
|
sql.Add('where APID='''+Trim(APID.Text)+'''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty=False then
|
|||
|
begin
|
|||
|
// Label2.Visible:=True;
|
|||
|
Label2.Caption:=Trim(ADOTmp.fieldbyname('APID').AsString);
|
|||
|
// Label24.Visible:=True;
|
|||
|
Label24.Caption:='Ʒ<><C6B7><EFBFBD><EFBFBD>'+Trim(ADOTmp.fieldbyname('C_CodeName').AsString);
|
|||
|
// Label25.Visible:=True;
|
|||
|
Label25.Caption:='<27><>ɫ<EFBFBD><C9AB>'+Trim(ADOTmp.fieldbyname('C_Color').AsString);
|
|||
|
Label29.Caption:='ƥ<><C6A5><EFBFBD><EFBFBD>'+Trim(ADOTmp.fieldbyname('AordQty2').AsString);
|
|||
|
Label30.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+Trim(ADOTmp.fieldbyname('AordQty1').AsString);
|
|||
|
Label31.Caption:='<27>ţ<D7BA>'+Trim(ADOTmp.fieldbyname('AOrddefStr1').AsString);
|
|||
|
FAPID:=Trim(APID.Text);
|
|||
|
FMainId:=Trim(ADOTmp.fieldbyname('MainId').AsString);
|
|||
|
FSubId:=Trim(ADOTmp.fieldbyname('SubId').AsString);
|
|||
|
Label9.Caption:=Trim(ADOTmp.fieldbyname('AOrddefstr3').AsString);
|
|||
|
Label13.Caption:=Trim(ADOTmp.fieldbyname('AOrddefstr2').AsString);
|
|||
|
Label19.Caption:=Trim(Label9.Caption);
|
|||
|
Label20.Caption:=Trim(Label9.Caption);
|
|||
|
Label7.Caption:=Trim(Label9.Caption);
|
|||
|
C_CodeName.Text:=Trim(ADOTmp.fieldbyname('C_CodeName').AsString);
|
|||
|
C_Color.Text:=Trim(ADOTmp.fieldbyname('C_Color').AsString);
|
|||
|
BCGangNo.Text:=Trim(ADOTmp.fieldbyname('AOrddefstr1').AsString);
|
|||
|
BTAdd.Click;
|
|||
|
end else
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
//Label2.Visible:=False;
|
|||
|
Label2.Caption:='';
|
|||
|
Label24.Caption:='';
|
|||
|
Label25.Caption:='';
|
|||
|
Label29.Caption:='';
|
|||
|
Label30.Caption:='';
|
|||
|
Label31.Caption:='';
|
|||
|
C_CodeName.Text:='';
|
|||
|
C_Color.Text:='';
|
|||
|
BCGangNo.Text:='';
|
|||
|
mjlen.Text:='';
|
|||
|
|
|||
|
APID.Text:='';
|
|||
|
FAPID:='';
|
|||
|
FMainId:='';
|
|||
|
FSubId:='';
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
|
|||
|
APID.Text:='';
|
|||
|
BTAdd.Click; }
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit1Click(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
Panel3.Visible := True;
|
|||
|
with Panel3 do
|
|||
|
begin
|
|||
|
for i := 0 to ControlCount - 1 do
|
|||
|
begin
|
|||
|
if Controls[i] is TSpeedButton then
|
|||
|
begin
|
|||
|
TSpeedButton(Controls[i]).Hint := Trim(TEdit(Sender).Name);
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit2Change(Sender: TObject);
|
|||
|
var
|
|||
|
mvalue: Double;
|
|||
|
begin
|
|||
|
if Trim(Edit1.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(Edit1.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
if Trim(Edit2.Text) <> '' then
|
|||
|
begin
|
|||
|
if TryStrToFloat(Edit2.Text, mvalue) = False then
|
|||
|
begin
|
|||
|
Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
CDQty.Text := FloatToStr(StrToFloat(Edit2.Text) - StrToFloat(Edit1.Text));
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit3Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit3.Text) = '' then
|
|||
|
begin
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
Edit5.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit3.Text := '';
|
|||
|
Edit4.Text := '<27><>';
|
|||
|
Edit5.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit4.Text) = '' then
|
|||
|
begin
|
|||
|
Edit4.Text := '<27><>';
|
|||
|
Edit3.Text := '';
|
|||
|
Edit5.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit4.Text := '';
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit5.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit5Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit5.Text) = '' then
|
|||
|
begin
|
|||
|
Edit5.Text := '<27><>';
|
|||
|
Edit3.Text := '';
|
|||
|
Edit4.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit5.Text := '';
|
|||
|
Edit3.Text := '<27><>';
|
|||
|
Edit4.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit6Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit6.Text) = '' then
|
|||
|
begin
|
|||
|
Edit6.Text := '<27><>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit6.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJLenKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
BTPrint.Click;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.MJQty1KeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
MJLen.SetFocus;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit7Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit7.Text) = '' then
|
|||
|
begin
|
|||
|
Edit7.Text := '<27><>';
|
|||
|
Edit8.Text := '';
|
|||
|
Edit9.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit7.Text := '';
|
|||
|
Edit8.Text := '';
|
|||
|
Edit9.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit8Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit8.Text) = '' then
|
|||
|
begin
|
|||
|
Edit7.Text := '';
|
|||
|
Edit8.Text := '<27><>';
|
|||
|
Edit9.Text := '';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit7.Text := '';
|
|||
|
Edit8.Text := '';
|
|||
|
Edit9.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Edit9Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if Trim(Edit9.Text) = '' then
|
|||
|
begin
|
|||
|
Edit7.Text := '';
|
|||
|
Edit8.Text := '';
|
|||
|
Edit9.Text := '<27><>';
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit7.Text := '';
|
|||
|
Edit8.Text := '';
|
|||
|
Edit9.Text := '';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.C_CodeNameKeyPress(Sender: TObject; var Key: Char);
|
|||
|
begin
|
|||
|
if Key = #13 then
|
|||
|
begin
|
|||
|
Key := #0;
|
|||
|
perform(WM_NEXTDLGCTL, 0, 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.C_CodeNameExit(Sender: TObject);
|
|||
|
begin
|
|||
|
if trim(C_CodeName.Text) = '' then
|
|||
|
exit;
|
|||
|
|
|||
|
if rightBstr(trim(C_CodeName.Text), 1) <> '#' then
|
|||
|
begin
|
|||
|
C_CodeName.Text := trim(C_CodeName.Text) + '#';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.C_ColorExit(Sender: TObject);
|
|||
|
begin
|
|||
|
if trim(C_Color.Text) = '' then
|
|||
|
exit;
|
|||
|
|
|||
|
if rightBstr(trim(C_Color.Text), 1) <> '#' then
|
|||
|
begin
|
|||
|
C_Color.Text := trim(C_Color.Text) + '#';
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.BCGangNoExit(Sender: TObject);
|
|||
|
begin
|
|||
|
{ IF trim(BCGangNo.Text)='' then exit;
|
|||
|
|
|||
|
IF rightBstr(trim(BCGangNo.Text),1)<>'W'THEN
|
|||
|
BEGIn
|
|||
|
BCGangNo.Text:=trim(BCGangNo.Text)+'W';
|
|||
|
END; }
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.SpeedButton19Click(Sender: TObject);
|
|||
|
begin
|
|||
|
// TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).OnKeyPress(owers,#13) ;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.Button2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if trim(APID.Text) <> '' then
|
|||
|
begin
|
|||
|
if trim(canshu) <> '<27><>Ȩ<EFBFBD><C8A8>' then
|
|||
|
begin
|
|||
|
if trim(APID.Text) = '1234' then
|
|||
|
exit;
|
|||
|
end;
|
|||
|
// IF trim(canshu)<>'<27><>Ȩ<EFBFBD><C8A8>' then exit;
|
|||
|
with ADOTmp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('select A.* ');
|
|||
|
sql.Add('from JYOrder_Sub_AnPai A');
|
|||
|
sql.Add('where APID=''' + Trim(APID.Text) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
if ADOTmp.IsEmpty = False then
|
|||
|
begin
|
|||
|
// Label2.Visible:=True;
|
|||
|
Label2.Caption := Trim(ADOTmp.fieldbyname('APID').AsString);
|
|||
|
// Label24.Visible:=True;
|
|||
|
Label24.Caption := 'Ʒ<><C6B7><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('C_CodeName').AsString);
|
|||
|
// Label25.Visible:=True;
|
|||
|
Label25.Caption := '<27><>ɫ<EFBFBD><C9AB>' + Trim(ADOTmp.fieldbyname('C_Color').AsString);
|
|||
|
Label29.Caption := 'ƥ<><C6A5><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('AordQty2').AsString);
|
|||
|
Label30.Caption := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' + Trim(ADOTmp.fieldbyname('AordQty1').AsString);
|
|||
|
Label31.Caption := '<27>ţ<D7BA>' + Trim(ADOTmp.fieldbyname('AOrddefStr1').AsString);
|
|||
|
Fgangp := Trim(ADOTmp.fieldbyname('AordQty2').AsString);
|
|||
|
FAPID := Trim(APID.Text);
|
|||
|
FMainId := Trim(ADOTmp.fieldbyname('MainId').AsString);
|
|||
|
FSubId := Trim(ADOTmp.fieldbyname('SubId').AsString);
|
|||
|
Label9.Caption := Trim(ADOTmp.fieldbyname('AOrddefstr3').AsString);
|
|||
|
Label13.Caption := Trim(ADOTmp.fieldbyname('AOrddefstr2').AsString);
|
|||
|
Label19.Caption := Trim(Label9.Caption);
|
|||
|
Label20.Caption := Trim(Label9.Caption);
|
|||
|
Label7.Caption := Trim(Label9.Caption);
|
|||
|
C_CodeName.Text := Trim(ADOTmp.fieldbyname('C_CodeName').AsString);
|
|||
|
C_Color.Text := Trim(ADOTmp.fieldbyname('C_Color').AsString);
|
|||
|
BCGangNo.Text := Trim(ADOTmp.fieldbyname('AOrddefstr1').AsString);
|
|||
|
BTAdd.Click;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
//Label2.Visible:=False;
|
|||
|
Label2.Caption := '';
|
|||
|
Label24.Caption := '';
|
|||
|
Label25.Caption := '';
|
|||
|
Label29.Caption := '';
|
|||
|
Label30.Caption := '';
|
|||
|
Label31.Caption := '';
|
|||
|
C_CodeName.Text := '';
|
|||
|
C_Color.Text := '';
|
|||
|
BCGangNo.Text := '';
|
|||
|
mjlen.Text := '';
|
|||
|
|
|||
|
APID.Text := '';
|
|||
|
FAPID := '';
|
|||
|
FMainId := '';
|
|||
|
FSubId := '';
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
Edit7.Text := '';
|
|||
|
Edit8.Text := '';
|
|||
|
Edit9.Text := '';
|
|||
|
APID.Text := '';
|
|||
|
BTAdd.Click;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmMJManageNewFDNew.ToolButton2Click(Sender: TObject);
|
|||
|
begin
|
|||
|
with ADOCmd do
|
|||
|
begin
|
|||
|
close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('UPDATE SY_MaxBH SET BHNo=BHNo+10 WHERE BHstr=''MC'' AND BHType=''WFB_MJJY_CD'' ');
|
|||
|
sql.Add(' AND BHDate=RIGHT(YEAR(getdate()) * 10000 + MONTH(getdate()) * 100 + DAY(getdate()), 6) And Type=''1'' ');
|
|||
|
ShowMessage(SQL.text);
|
|||
|
execsql;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|